@friggframework/devtools 2.0.0-next.36 → 2.0.0-next.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,7 +27,7 @@ infrastructure/
27
27
  ├── AWS-DISCOVERY-TROUBLESHOOTING.md # AWS discovery troubleshooting
28
28
  ├── DEPLOYMENT-INSTRUCTIONS.md # General deployment instructions
29
29
  ├── README-TESTING.md # Testing strategy documentation
30
- ├──
30
+ ├──
31
31
  ├── cloudformation/ # CloudFormation templates
32
32
  │ ├── monitoring-infrastructure.yaml # Enhanced monitoring (Phase 3)
33
33
  │ ├── cdn-infrastructure.yaml # CDN and UI distribution (Phase 3)
@@ -60,71 +60,79 @@ infrastructure/
60
60
  #### 1. Serverless Template Generator (`serverless-template.js`)
61
61
 
62
62
  Generates complete serverless.yml configurations with:
63
- - VPC configuration and resource discovery
64
- - KMS encryption for field-level encryption
65
- - SSM Parameter Store integration
66
- - Integration-specific functions and queues
67
- - WebSocket support for real-time features
63
+
64
+ - VPC configuration and resource discovery
65
+ - KMS encryption for field-level encryption
66
+ - SSM Parameter Store integration
67
+ - Integration-specific functions and queues
68
+ - WebSocket support for real-time features
68
69
 
69
70
  #### 2. AWS Discovery (`aws-discovery.js`)
70
71
 
71
72
  Automatically discovers existing AWS resources:
72
- - Default VPC and security groups
73
- - Private subnets for Lambda functions
74
- - Customer-managed KMS keys
75
- - Route tables for VPC endpoints
73
+
74
+ - Default VPC and security groups
75
+ - Private subnets for Lambda functions
76
+ - Customer-managed KMS keys
77
+ - Route tables for VPC endpoints
76
78
 
77
79
  #### 3. Build-Time Discovery (`build-time-discovery.js`)
78
80
 
79
81
  Integrates AWS discovery into the build process:
80
- - Pre-build hook for serverless deployments
81
- - Environment variable injection
82
- - Template variable replacement
83
- - Error handling and fallback values
82
+
83
+ - Pre-build hook for serverless deployments
84
+ - Environment variable injection
85
+ - Template variable replacement
86
+ - Error handling and fallback values
84
87
 
85
88
  ### Phase 3 Infrastructure
86
89
 
87
90
  #### 1. Enhanced Monitoring (`cloudformation/monitoring-infrastructure.yaml`)
88
91
 
89
92
  Production-ready monitoring with:
90
- - Code generation service monitoring
91
- - UI distribution monitoring
92
- - Advanced CloudWatch dashboards
93
- - Custom metrics and alarms
93
+
94
+ - Code generation service monitoring
95
+ - UI distribution monitoring
96
+ - Advanced CloudWatch dashboards
97
+ - Custom metrics and alarms
94
98
 
95
99
  #### 2. CDN Infrastructure (`cloudformation/cdn-infrastructure.yaml`)
96
100
 
97
101
  CloudFront distribution for UI packages:
98
- - S3 bucket for multi-framework UI packages
99
- - CloudFront distribution with custom domains
100
- - Lambda function for package deployment
101
- - API Gateway for package management
102
+
103
+ - S3 bucket for multi-framework UI packages
104
+ - CloudFront distribution with custom domains
105
+ - Lambda function for package deployment
106
+ - API Gateway for package management
102
107
 
103
108
  #### 3. Code Generation Infrastructure (`cloudformation/codegen-infrastructure.yaml`)
104
109
 
105
110
  Serverless code generation platform:
106
- - SQS queue for generation requests
107
- - Lambda function with AI/ML integration
108
- - DynamoDB tracking table
109
- - S3 storage for templates and generated code
110
- - ElastiCache for template caching
111
+
112
+ - SQS queue for generation requests
113
+ - Lambda function with AI/ML integration
114
+ - DynamoDB tracking table
115
+ - S3 storage for templates and generated code
116
+ - ElastiCache for template caching
111
117
 
112
118
  #### 4. Advanced Alerting (`cloudformation/alerting-infrastructure.yaml`)
113
119
 
114
120
  Multi-channel alerting system:
115
- - Multiple SNS topics for alert severity levels
116
- - Lambda function for alert processing
117
- - PagerDuty and Slack integration
118
- - Composite alarms for system health
119
- - Advanced metrics collection
121
+
122
+ - Multiple SNS topics for alert severity levels
123
+ - Lambda function for alert processing
124
+ - PagerDuty and Slack integration
125
+ - Composite alarms for system health
126
+ - Advanced metrics collection
120
127
 
121
128
  #### 5. Deployment Pipeline (`cloudformation/deployment-pipeline.yaml`)
122
129
 
123
130
  CI/CD pipeline for automated deployments:
124
- - CodePipeline with GitHub integration
125
- - CodeBuild projects for backend and UI
126
- - Multi-stage deployment workflow
127
- - Integration testing and approval gates
131
+
132
+ - CodePipeline with GitHub integration
133
+ - CodeBuild projects for backend and UI
134
+ - Multi-stage deployment workflow
135
+ - Integration testing and approval gates
128
136
 
129
137
  ## Configuration Options
130
138
 
@@ -135,7 +143,7 @@ const appDefinition = {
135
143
  // Basic configuration
136
144
  name: 'my-frigg-app',
137
145
  provider: 'aws',
138
-
146
+
139
147
  // VPC configuration
140
148
  vpc: {
141
149
  enable: true,
@@ -144,22 +152,22 @@ const appDefinition = {
144
152
  subnetIds: [...], // Optional: custom subnets
145
153
  enableVPCEndpoints: true // Optional: create VPC endpoints
146
154
  },
147
-
155
+
148
156
  // KMS encryption
149
157
  encryption: {
150
158
  useDefaultKMSForFieldLevelEncryption: true
151
159
  },
152
-
160
+
153
161
  // SSM Parameter Store
154
162
  ssm: {
155
163
  enable: true
156
164
  },
157
-
165
+
158
166
  // WebSocket support (Phase 3)
159
167
  websockets: {
160
168
  enable: true
161
169
  },
162
-
170
+
163
171
  // Integrations
164
172
  integrations: [
165
173
  { Definition: { name: 'hubspot' } },
@@ -195,10 +203,8 @@ SERVICE_NAME=my-frigg-app
195
203
  const { composeServerlessDefinition } = require('./serverless-template');
196
204
 
197
205
  const appDefinition = {
198
- name: 'my-app',
199
- integrations: [
200
- { Definition: { name: 'hubspot' } }
201
- ]
206
+ name: 'my-app',
207
+ integrations: [{ Definition: { name: 'hubspot' } }],
202
208
  };
203
209
 
204
210
  const serverlessConfig = await composeServerlessDefinition(appDefinition);
@@ -209,13 +215,11 @@ const serverlessConfig = await composeServerlessDefinition(appDefinition);
209
215
 
210
216
  ```javascript
211
217
  const appDefinition = {
212
- name: 'secure-app',
213
- vpc: { enable: true },
214
- encryption: { useDefaultKMSForFieldLevelEncryption: true },
215
- ssm: { enable: true },
216
- integrations: [
217
- { Definition: { name: 'salesforce' } }
218
- ]
218
+ name: 'secure-app',
219
+ vpc: { enable: true },
220
+ encryption: { useDefaultKMSForFieldLevelEncryption: true },
221
+ ssm: { enable: true },
222
+ integrations: [{ Definition: { name: 'salesforce' } }],
219
223
  };
220
224
 
221
225
  const serverlessConfig = await composeServerlessDefinition(appDefinition);
@@ -225,12 +229,10 @@ const serverlessConfig = await composeServerlessDefinition(appDefinition);
225
229
 
226
230
  ```javascript
227
231
  const appDefinition = {
228
- name: 'realtime-app',
229
- websockets: { enable: true },
230
- vpc: { enable: true },
231
- integrations: [
232
- { Definition: { name: 'slack' } }
233
- ]
232
+ name: 'realtime-app',
233
+ websockets: { enable: true },
234
+ vpc: { enable: true },
235
+ integrations: [{ Definition: { name: 'slack' } }],
234
236
  };
235
237
 
236
238
  const serverlessConfig = await composeServerlessDefinition(appDefinition);
@@ -259,19 +261,21 @@ npm test -- --watch
259
261
  ### Test Categories
260
262
 
261
263
  1. **Unit Tests**: Test individual components
262
- - AWS discovery utilities
263
- - Serverless template generation
264
- - IAM policy generation
264
+
265
+ - AWS discovery utilities
266
+ - Serverless template generation
267
+ - IAM policy generation
265
268
 
266
269
  2. **Integration Tests**: Test end-to-end workflows
267
- - Complete discovery and template generation
268
- - Plugin integration
269
- - Phase 3 infrastructure validation
270
+
271
+ - Complete discovery and template generation
272
+ - Plugin integration
273
+ - Phase 3 infrastructure validation
270
274
 
271
275
  3. **Performance Tests**: Validate infrastructure limits
272
- - CloudFormation template sizes
273
- - Resource count limits
274
- - Cross-stack dependencies
276
+ - CloudFormation template sizes
277
+ - Resource count limits
278
+ - Cross-stack dependencies
275
279
 
276
280
  ### Mock Data
277
281
 
@@ -279,11 +283,12 @@ Tests use mock AWS resources to avoid real AWS API calls:
279
283
 
280
284
  ```javascript
281
285
  const mockAWSResources = {
282
- defaultVpcId: 'vpc-12345678',
283
- defaultSecurityGroupId: 'sg-12345678',
284
- privateSubnetId1: 'subnet-private-1',
285
- privateSubnetId2: 'subnet-private-2',
286
- defaultKmsKeyId: 'arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012'
286
+ defaultVpcId: 'vpc-12345678',
287
+ defaultSecurityGroupId: 'sg-12345678',
288
+ privateSubnetId1: 'subnet-private-1',
289
+ privateSubnetId2: 'subnet-private-2',
290
+ defaultKmsKeyId:
291
+ 'arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012',
287
292
  };
288
293
  ```
289
294
 
@@ -293,18 +298,18 @@ const mockAWSResources = {
293
298
 
294
299
  The infrastructure requires specific IAM permissions for AWS resource discovery and deployment:
295
300
 
296
- - **EC2**: Describe VPCs, subnets, security groups, route tables
297
- - **KMS**: List keys, describe keys
298
- - **STS**: Get caller identity
299
- - **CloudFormation**: Full access for stack operations
300
- - **Lambda**: Function management
301
- - **API Gateway**: API management
302
- - **S3**: Bucket and object operations (including tagging)
303
- - **DynamoDB**: Table operations
304
- - **SQS**: Queue operations
305
- - **SNS**: Topic operations
306
- - **CloudWatch**: Metrics and alarms
307
- - **IAM**: Role and policy management
301
+ - **EC2**: Describe VPCs, subnets, security groups, route tables
302
+ - **KMS**: List keys, describe keys
303
+ - **STS**: Get caller identity
304
+ - **CloudFormation**: Full access for stack operations
305
+ - **Lambda**: Function management
306
+ - **API Gateway**: API management
307
+ - **S3**: Bucket and object operations (including tagging)
308
+ - **DynamoDB**: Table operations
309
+ - **SQS**: Queue operations
310
+ - **SNS**: Topic operations
311
+ - **CloudWatch**: Metrics and alarms
312
+ - **IAM**: Role and policy management
308
313
 
309
314
  ### Best Practices
310
315
 
@@ -348,6 +353,8 @@ serverless print
348
353
  aws cloudformation validate-template --template-body file://template.json
349
354
  ```
350
355
 
356
+ - **Connectivity to external services (e.g., databases):** If your Lambda functions in a VPC cannot connect to external services, ensure that the `FriggLambdaSecurityGroup` has the correct **egress** rules to allow outbound traffic on the required ports (e.g., port 27017 for MongoDB).
357
+
351
358
  #### Infrastructure Test Failures
352
359
 
353
360
  ```bash
@@ -364,19 +371,22 @@ npm run test:debug
364
371
  ### Performance Optimization
365
372
 
366
373
  #### Lambda Cold Starts
367
- - Use provisioned concurrency for critical functions
368
- - Optimize function size and dependencies
369
- - Monitor cold start metrics
374
+
375
+ - Use provisioned concurrency for critical functions
376
+ - Optimize function size and dependencies
377
+ - Monitor cold start metrics
370
378
 
371
379
  #### VPC Performance
372
- - Use VPC endpoints to reduce NAT Gateway costs
373
- - Monitor ENI creation/deletion times
374
- - Consider Lambda@Edge for global distribution
380
+
381
+ - Use VPC endpoints to reduce NAT Gateway costs
382
+ - Monitor ENI creation/deletion times
383
+ - Consider Lambda@Edge for global distribution
375
384
 
376
385
  #### Cost Optimization
377
- - Use S3 Intelligent Tiering
378
- - Configure CloudWatch log retention
379
- - Monitor and alert on unexpected usage
386
+
387
+ - Use S3 Intelligent Tiering
388
+ - Configure CloudWatch log retention
389
+ - Monitor and alert on unexpected usage
380
390
 
381
391
  ## Contributing
382
392
 
@@ -405,17 +415,17 @@ npm run test:debug
405
415
 
406
416
  ## Support
407
417
 
408
- - **Documentation**: See `PHASE3-DEPLOYMENT-GUIDE.md` for detailed deployment instructions
409
- - **Testing**: See `README-TESTING.md` for testing strategy
410
- - **Troubleshooting**: See `AWS-DISCOVERY-TROUBLESHOOTING.md` for common issues
411
- - **Issues**: Create GitHub issues for bugs and feature requests
412
- - **Discussions**: Use GitHub Discussions for questions and ideas
418
+ - **Documentation**: See `PHASE3-DEPLOYMENT-GUIDE.md` for detailed deployment instructions
419
+ - **Testing**: See `README-TESTING.md` for testing strategy
420
+ - **Troubleshooting**: See `AWS-DISCOVERY-TROUBLESHOOTING.md` for common issues
421
+ - **Issues**: Create GitHub issues for bugs and feature requests
422
+ - **Discussions**: Use GitHub Discussions for questions and ideas
413
423
 
414
424
  ## Related Documentation
415
425
 
416
- - [Phase 3 Deployment Guide](./PHASE3-DEPLOYMENT-GUIDE.md)
417
- - [Testing Strategy](./README-TESTING.md)
418
- - [AWS Discovery Troubleshooting](./AWS-DISCOVERY-TROUBLESHOOTING.md)
419
- - [IAM Policy Templates](./IAM-POLICY-TEMPLATES.md)
420
- - [VPC Configuration](./VPC-CONFIGURATION.md)
421
- - [WebSocket Configuration](./WEBSOCKET-CONFIGURATION.md)
426
+ - [Phase 3 Deployment Guide](./PHASE3-DEPLOYMENT-GUIDE.md)
427
+ - [Testing Strategy](./README-TESTING.md)
428
+ - [AWS Discovery Troubleshooting](./AWS-DISCOVERY-TROUBLESHOOTING.md)
429
+ - [IAM Policy Templates](./IAM-POLICY-TEMPLATES.md)
430
+ - [VPC Configuration](./VPC-CONFIGURATION.md)
431
+ - [WebSocket Configuration](./WEBSOCKET-CONFIGURATION.md)
@@ -450,6 +450,13 @@ const createVPCInfrastructure = (AppDefinition) => {
450
450
  CidrIp: '0.0.0.0/0',
451
451
  Description: 'DNS UDP',
452
452
  },
453
+ {
454
+ IpProtocol: 'tcp',
455
+ FromPort: 27017,
456
+ ToPort: 27017,
457
+ CidrIp: '0.0.0.0/0',
458
+ Description: 'MongoDB outbound',
459
+ },
453
460
  ],
454
461
  Tags: [
455
462
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@friggframework/devtools",
3
3
  "prettier": "@friggframework/prettier-config",
4
- "version": "2.0.0-next.36",
4
+ "version": "2.0.0-next.37",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-ec2": "^3.835.0",
7
7
  "@aws-sdk/client-kms": "^3.835.0",
@@ -9,8 +9,8 @@
9
9
  "@babel/eslint-parser": "^7.18.9",
10
10
  "@babel/parser": "^7.25.3",
11
11
  "@babel/traverse": "^7.25.3",
12
- "@friggframework/schemas": "2.0.0-next.36",
13
- "@friggframework/test": "2.0.0-next.36",
12
+ "@friggframework/schemas": "2.0.0-next.37",
13
+ "@friggframework/test": "2.0.0-next.37",
14
14
  "@hapi/boom": "^10.0.1",
15
15
  "@inquirer/prompts": "^5.3.8",
16
16
  "axios": "^1.7.2",
@@ -32,8 +32,8 @@
32
32
  "serverless-http": "^2.7.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@friggframework/eslint-config": "2.0.0-next.36",
36
- "@friggframework/prettier-config": "2.0.0-next.36",
35
+ "@friggframework/eslint-config": "2.0.0-next.37",
36
+ "@friggframework/prettier-config": "2.0.0-next.37",
37
37
  "prettier": "^2.7.1",
38
38
  "serverless": "3.39.0",
39
39
  "serverless-dotenv-plugin": "^6.0.0",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "6cca53cb3091d6bd11ae37f6c459679f1b5b19a6"
68
+ "gitHead": "39f0a48fa6bd17c4b8c5caba58c88edc6d6fdd1f"
69
69
  }