@friggframework/devtools 2.0.0--canary.400.bed3308.0 → 2.0.0--canary.404.e9d4980.0
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.
- package/frigg-cli/build-command/index.js +3 -18
- package/frigg-cli/deploy-command/index.js +3 -19
- package/frigg-cli/index.js +1 -73
- package/frigg-cli/install-command/index.js +2 -15
- package/frigg-cli/start-command/index.js +2 -17
- package/infrastructure/create-frigg-infrastructure.js +2 -2
- package/infrastructure/serverless-template.js +79 -529
- package/package.json +5 -9
- package/frigg-cli/.eslintrc.js +0 -141
- package/frigg-cli/__tests__/jest.config.js +0 -102
- package/frigg-cli/__tests__/unit/commands/build.test.js +0 -483
- package/frigg-cli/__tests__/unit/commands/install.test.js +0 -418
- package/frigg-cli/__tests__/unit/commands/ui.test.js +0 -592
- package/frigg-cli/__tests__/utils/command-tester.js +0 -170
- package/frigg-cli/__tests__/utils/mock-factory.js +0 -270
- package/frigg-cli/__tests__/utils/test-fixtures.js +0 -463
- package/frigg-cli/__tests__/utils/test-setup.js +0 -286
- package/frigg-cli/generate-command/__tests__/generate-command.test.js +0 -312
- package/frigg-cli/generate-command/azure-generator.js +0 -43
- package/frigg-cli/generate-command/gcp-generator.js +0 -47
- package/frigg-cli/generate-command/index.js +0 -350
- package/frigg-cli/generate-command/terraform-generator.js +0 -555
- package/frigg-cli/generate-iam-command.js +0 -115
- package/frigg-cli/package.json +0 -75
- package/frigg-cli/ui-command/index.js +0 -167
- package/frigg-cli/utils/app-resolver.js +0 -319
- package/frigg-cli/utils/backend-path.js +0 -38
- package/frigg-cli/utils/process-manager.js +0 -199
- package/frigg-cli/utils/repo-detection.js +0 -405
- package/infrastructure/AWS-DISCOVERY-TROUBLESHOOTING.md +0 -245
- package/infrastructure/AWS-IAM-CREDENTIAL-NEEDS.md +0 -620
- package/infrastructure/DEPLOYMENT-INSTRUCTIONS.md +0 -268
- package/infrastructure/GENERATE-IAM-DOCS.md +0 -253
- package/infrastructure/IAM-POLICY-TEMPLATES.md +0 -176
- package/infrastructure/README-TESTING.md +0 -332
- package/infrastructure/README.md +0 -421
- package/infrastructure/WEBSOCKET-CONFIGURATION.md +0 -105
- package/infrastructure/__tests__/fixtures/mock-aws-resources.js +0 -391
- package/infrastructure/__tests__/helpers/test-utils.js +0 -277
- package/infrastructure/aws-discovery.js +0 -568
- package/infrastructure/aws-discovery.test.js +0 -373
- package/infrastructure/build-time-discovery.js +0 -206
- package/infrastructure/build-time-discovery.test.js +0 -375
- package/infrastructure/frigg-deployment-iam-stack.yaml +0 -393
- package/infrastructure/iam-generator.js +0 -810
- package/infrastructure/iam-generator.test.js +0 -169
- package/infrastructure/iam-policy-basic.json +0 -236
- package/infrastructure/iam-policy-full.json +0 -305
- package/infrastructure/integration.test.js +0 -383
- package/infrastructure/run-discovery.js +0 -110
- package/infrastructure/serverless-template.test.js +0 -553
- package/management-ui/.eslintrc.js +0 -22
- package/management-ui/README.md +0 -203
- package/management-ui/components.json +0 -21
- package/management-ui/index.html +0 -13
- package/management-ui/merge-conflict-cleaner.py +0 -371
- package/management-ui/package-lock.json +0 -10997
- package/management-ui/package.json +0 -76
- package/management-ui/postcss.config.js +0 -6
- package/management-ui/server/api/backend.js +0 -256
- package/management-ui/server/api/cli.js +0 -315
- package/management-ui/server/api/codegen.js +0 -663
- package/management-ui/server/api/connections.js +0 -857
- package/management-ui/server/api/discovery.js +0 -185
- package/management-ui/server/api/environment/index.js +0 -1
- package/management-ui/server/api/environment/router.js +0 -378
- package/management-ui/server/api/environment.js +0 -328
- package/management-ui/server/api/integrations.js +0 -479
- package/management-ui/server/api/logs.js +0 -248
- package/management-ui/server/api/monitoring.js +0 -282
- package/management-ui/server/api/open-ide.js +0 -31
- package/management-ui/server/api/project.js +0 -553
- package/management-ui/server/api/users/sessions.js +0 -371
- package/management-ui/server/api/users/simulation.js +0 -254
- package/management-ui/server/api/users.js +0 -362
- package/management-ui/server/api-contract.md +0 -275
- package/management-ui/server/index.js +0 -428
- package/management-ui/server/middleware/errorHandler.js +0 -70
- package/management-ui/server/middleware/security.js +0 -32
- package/management-ui/server/processManager.js +0 -296
- package/management-ui/server/server.js +0 -188
- package/management-ui/server/services/aws-monitor.js +0 -413
- package/management-ui/server/services/npm-registry.js +0 -347
- package/management-ui/server/services/template-engine.js +0 -538
- package/management-ui/server/utils/cliIntegration.js +0 -220
- package/management-ui/server/utils/environment/auditLogger.js +0 -471
- package/management-ui/server/utils/environment/awsParameterStore.js +0 -264
- package/management-ui/server/utils/environment/encryption.js +0 -278
- package/management-ui/server/utils/environment/envFileManager.js +0 -286
- package/management-ui/server/utils/import-commonjs.js +0 -28
- package/management-ui/server/utils/response.js +0 -83
- package/management-ui/server/websocket/handler.js +0 -325
- package/management-ui/src/App.jsx +0 -51
- package/management-ui/src/assets/FriggLogo.svg +0 -1
- package/management-ui/src/components/AppRouter.jsx +0 -65
- package/management-ui/src/components/Button.jsx +0 -2
- package/management-ui/src/components/Card.jsx +0 -9
- package/management-ui/src/components/EnvironmentCompare.jsx +0 -400
- package/management-ui/src/components/EnvironmentEditor.jsx +0 -372
- package/management-ui/src/components/EnvironmentImportExport.jsx +0 -469
- package/management-ui/src/components/EnvironmentSchema.jsx +0 -491
- package/management-ui/src/components/EnvironmentSecurity.jsx +0 -463
- package/management-ui/src/components/ErrorBoundary.jsx +0 -73
- package/management-ui/src/components/IntegrationCard.jsx +0 -199
- package/management-ui/src/components/IntegrationCardEnhanced.jsx +0 -490
- package/management-ui/src/components/IntegrationExplorer.jsx +0 -379
- package/management-ui/src/components/IntegrationStatus.jsx +0 -235
- package/management-ui/src/components/Layout.jsx +0 -250
- package/management-ui/src/components/LoadingSpinner.jsx +0 -45
- package/management-ui/src/components/RepositoryPicker.jsx +0 -248
- package/management-ui/src/components/SessionMonitor.jsx +0 -255
- package/management-ui/src/components/StatusBadge.jsx +0 -70
- package/management-ui/src/components/UserContextSwitcher.jsx +0 -154
- package/management-ui/src/components/UserSimulation.jsx +0 -299
- package/management-ui/src/components/Welcome.jsx +0 -434
- package/management-ui/src/components/codegen/APIEndpointGenerator.jsx +0 -637
- package/management-ui/src/components/codegen/APIModuleSelector.jsx +0 -227
- package/management-ui/src/components/codegen/CodeGenerationWizard.jsx +0 -247
- package/management-ui/src/components/codegen/CodePreviewEditor.jsx +0 -316
- package/management-ui/src/components/codegen/DynamicModuleForm.jsx +0 -271
- package/management-ui/src/components/codegen/FormBuilder.jsx +0 -737
- package/management-ui/src/components/codegen/IntegrationGenerator.jsx +0 -855
- package/management-ui/src/components/codegen/ProjectScaffoldWizard.jsx +0 -797
- package/management-ui/src/components/codegen/SchemaBuilder.jsx +0 -303
- package/management-ui/src/components/codegen/TemplateSelector.jsx +0 -586
- package/management-ui/src/components/codegen/index.js +0 -10
- package/management-ui/src/components/connections/ConnectionConfigForm.jsx +0 -362
- package/management-ui/src/components/connections/ConnectionHealthMonitor.jsx +0 -182
- package/management-ui/src/components/connections/ConnectionTester.jsx +0 -200
- package/management-ui/src/components/connections/EntityRelationshipMapper.jsx +0 -292
- package/management-ui/src/components/connections/OAuthFlow.jsx +0 -204
- package/management-ui/src/components/connections/index.js +0 -5
- package/management-ui/src/components/index.js +0 -21
- package/management-ui/src/components/monitoring/APIGatewayMetrics.jsx +0 -222
- package/management-ui/src/components/monitoring/LambdaMetrics.jsx +0 -169
- package/management-ui/src/components/monitoring/MetricsChart.jsx +0 -197
- package/management-ui/src/components/monitoring/MonitoringDashboard.jsx +0 -393
- package/management-ui/src/components/monitoring/SQSMetrics.jsx +0 -246
- package/management-ui/src/components/monitoring/index.js +0 -6
- package/management-ui/src/components/monitoring/monitoring.css +0 -218
- package/management-ui/src/components/theme-provider.jsx +0 -52
- package/management-ui/src/components/theme-toggle.jsx +0 -39
- package/management-ui/src/components/ui/badge.tsx +0 -36
- package/management-ui/src/components/ui/button.test.jsx +0 -56
- package/management-ui/src/components/ui/button.tsx +0 -57
- package/management-ui/src/components/ui/card.tsx +0 -76
- package/management-ui/src/components/ui/dropdown-menu.tsx +0 -199
- package/management-ui/src/components/ui/select.tsx +0 -157
- package/management-ui/src/components/ui/skeleton.jsx +0 -15
- package/management-ui/src/hooks/useFrigg.jsx +0 -387
- package/management-ui/src/hooks/useSocket.jsx +0 -58
- package/management-ui/src/index.css +0 -194
- package/management-ui/src/lib/utils.ts +0 -6
- package/management-ui/src/main.jsx +0 -10
- package/management-ui/src/pages/CodeGeneration.jsx +0 -14
- package/management-ui/src/pages/Connections.jsx +0 -252
- package/management-ui/src/pages/ConnectionsEnhanced.jsx +0 -427
- package/management-ui/src/pages/Dashboard.jsx +0 -311
- package/management-ui/src/pages/Environment.jsx +0 -314
- package/management-ui/src/pages/IntegrationConfigure.jsx +0 -544
- package/management-ui/src/pages/IntegrationDiscovery.jsx +0 -479
- package/management-ui/src/pages/IntegrationTest.jsx +0 -494
- package/management-ui/src/pages/Integrations.jsx +0 -254
- package/management-ui/src/pages/Monitoring.jsx +0 -17
- package/management-ui/src/pages/Simulation.jsx +0 -155
- package/management-ui/src/pages/Users.jsx +0 -492
- package/management-ui/src/services/api.js +0 -41
- package/management-ui/src/services/apiModuleService.js +0 -193
- package/management-ui/src/services/websocket-handlers.js +0 -120
- package/management-ui/src/test/api/project.test.js +0 -273
- package/management-ui/src/test/components/Welcome.test.jsx +0 -378
- package/management-ui/src/test/mocks/server.js +0 -178
- package/management-ui/src/test/setup.js +0 -61
- package/management-ui/src/test/utils/test-utils.jsx +0 -134
- package/management-ui/src/utils/repository.js +0 -98
- package/management-ui/src/utils/repository.test.js +0 -118
- package/management-ui/src/workflows/phase2-integration-workflows.js +0 -884
- package/management-ui/tailwind.config.js +0 -63
- package/management-ui/tsconfig.json +0 -37
- package/management-ui/tsconfig.node.json +0 -10
- package/management-ui/vite.config.js +0 -26
- package/management-ui/vitest.config.js +0 -38
|
@@ -1,26 +1,7 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const fs = require('fs');
|
|
3
|
-
const { AWSDiscovery } = require('./aws-discovery');
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
* Check if AWS discovery should run based on AppDefinition
|
|
7
|
-
* @param {Object} AppDefinition - Application definition
|
|
8
|
-
* @returns {boolean} True if discovery should run
|
|
9
|
-
*/
|
|
10
|
-
const shouldRunDiscovery = (AppDefinition) => {
|
|
11
|
-
return AppDefinition.vpc?.enable === true ||
|
|
12
|
-
AppDefinition.encryption?.useDefaultKMSForFieldLevelEncryption === true ||
|
|
13
|
-
AppDefinition.ssm?.enable === true;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Find the actual path to node_modules directory
|
|
18
|
-
* Tries multiple methods to locate node_modules:
|
|
19
|
-
* 1. Traversing up from current directory
|
|
20
|
-
* 2. Using npm root command
|
|
21
|
-
* 3. Looking for package.json and adjacent node_modules
|
|
22
|
-
* @returns {string} Path to node_modules directory
|
|
23
|
-
*/
|
|
4
|
+
// Function to find the actual path to node_modules
|
|
24
5
|
const findNodeModulesPath = () => {
|
|
25
6
|
try {
|
|
26
7
|
// Method 1: Try to find node_modules by traversing up from current directory
|
|
@@ -94,12 +75,7 @@ const findNodeModulesPath = () => {
|
|
|
94
75
|
}
|
|
95
76
|
};
|
|
96
77
|
|
|
97
|
-
|
|
98
|
-
* Modify handler paths to point to the correct node_modules location
|
|
99
|
-
* Only modifies paths when running in offline mode
|
|
100
|
-
* @param {Object} functions - Serverless functions configuration object
|
|
101
|
-
* @returns {Object} Modified functions object with updated handler paths
|
|
102
|
-
*/
|
|
78
|
+
// Function to modify handler paths to point to the correct node_modules
|
|
103
79
|
const modifyHandlerPaths = (functions) => {
|
|
104
80
|
// Check if we're running in offline mode
|
|
105
81
|
const isOffline = process.argv.includes('offline');
|
|
@@ -118,8 +94,7 @@ const modifyHandlerPaths = (functions) => {
|
|
|
118
94
|
const functionDef = modifiedFunctions[functionName];
|
|
119
95
|
if (functionDef?.handler?.includes('node_modules/')) {
|
|
120
96
|
// Replace node_modules/ with the actual path to node_modules/
|
|
121
|
-
|
|
122
|
-
functionDef.handler = functionDef.handler.replace('node_modules/', `${relativePath}/`);
|
|
97
|
+
functionDef.handler = functionDef.handler.replace('node_modules/', '../node_modules/');
|
|
123
98
|
console.log(`Updated handler for ${functionName}: ${functionDef.handler}`);
|
|
124
99
|
}
|
|
125
100
|
}
|
|
@@ -127,14 +102,7 @@ const modifyHandlerPaths = (functions) => {
|
|
|
127
102
|
return modifiedFunctions;
|
|
128
103
|
};
|
|
129
104
|
|
|
130
|
-
|
|
131
|
-
* Create VPC infrastructure resources for CloudFormation
|
|
132
|
-
* Creates VPC, subnets, NAT gateway, route tables, and security groups
|
|
133
|
-
* @param {Object} AppDefinition - Application definition object
|
|
134
|
-
* @param {Object} AppDefinition.vpc - VPC configuration
|
|
135
|
-
* @param {string} [AppDefinition.vpc.cidrBlock='10.0.0.0/16'] - CIDR block for VPC
|
|
136
|
-
* @returns {Object} CloudFormation resources for VPC infrastructure
|
|
137
|
-
*/
|
|
105
|
+
// Helper function to create VPC infrastructure resources
|
|
138
106
|
const createVPCInfrastructure = (AppDefinition) => {
|
|
139
107
|
const vpcResources = {
|
|
140
108
|
// VPC
|
|
@@ -437,72 +405,7 @@ const createVPCInfrastructure = (AppDefinition) => {
|
|
|
437
405
|
return vpcResources;
|
|
438
406
|
};
|
|
439
407
|
|
|
440
|
-
|
|
441
|
-
* Compose a complete serverless framework configuration from app definition
|
|
442
|
-
* @param {Object} AppDefinition - Application definition object
|
|
443
|
-
* @param {string} [AppDefinition.name] - Application name
|
|
444
|
-
* @param {string} [AppDefinition.provider='aws'] - Cloud provider
|
|
445
|
-
* @param {Array} AppDefinition.integrations - Array of integration definitions
|
|
446
|
-
* @param {Object} [AppDefinition.vpc] - VPC configuration
|
|
447
|
-
* @param {Object} [AppDefinition.encryption] - KMS encryption configuration
|
|
448
|
-
* @param {Object} [AppDefinition.ssm] - SSM parameter store configuration
|
|
449
|
-
* @param {Object} [AppDefinition.websockets] - WebSocket configuration
|
|
450
|
-
* @param {boolean} [AppDefinition.websockets.enable=false] - Enable WebSocket support for live update streaming
|
|
451
|
-
* @returns {Object} Complete serverless framework configuration
|
|
452
|
-
*/
|
|
453
|
-
const composeServerlessDefinition = async (AppDefinition) => {
|
|
454
|
-
// Store discovered resources
|
|
455
|
-
let discoveredResources = {};
|
|
456
|
-
<<<<<<< HEAD
|
|
457
|
-
=======
|
|
458
|
-
|
|
459
|
-
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
460
|
-
// Run AWS discovery if needed
|
|
461
|
-
if (shouldRunDiscovery(AppDefinition)) {
|
|
462
|
-
console.log('🔍 Running AWS resource discovery for serverless template...');
|
|
463
|
-
try {
|
|
464
|
-
const region = process.env.AWS_REGION || 'us-east-1';
|
|
465
|
-
const discovery = new AWSDiscovery(region);
|
|
466
|
-
<<<<<<< HEAD
|
|
467
|
-
=======
|
|
468
|
-
|
|
469
|
-
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
470
|
-
const config = {
|
|
471
|
-
vpc: AppDefinition.vpc || {},
|
|
472
|
-
encryption: AppDefinition.encryption || {},
|
|
473
|
-
ssm: AppDefinition.ssm || {}
|
|
474
|
-
};
|
|
475
|
-
<<<<<<< HEAD
|
|
476
|
-
|
|
477
|
-
discoveredResources = await discovery.discoverResources(config);
|
|
478
|
-
|
|
479
|
-
=======
|
|
480
|
-
|
|
481
|
-
discoveredResources = await discovery.discoverResources(config);
|
|
482
|
-
|
|
483
|
-
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
484
|
-
console.log('✅ AWS discovery completed successfully!');
|
|
485
|
-
if (discoveredResources.defaultVpcId) {
|
|
486
|
-
console.log(` VPC: ${discoveredResources.defaultVpcId}`);
|
|
487
|
-
}
|
|
488
|
-
if (discoveredResources.privateSubnetId1 && discoveredResources.privateSubnetId2) {
|
|
489
|
-
console.log(` Subnets: ${discoveredResources.privateSubnetId1}, ${discoveredResources.privateSubnetId2}`);
|
|
490
|
-
}
|
|
491
|
-
if (discoveredResources.defaultSecurityGroupId) {
|
|
492
|
-
console.log(` Security Group: ${discoveredResources.defaultSecurityGroupId}`);
|
|
493
|
-
}
|
|
494
|
-
if (discoveredResources.defaultKmsKeyId) {
|
|
495
|
-
console.log(` KMS Key: ${discoveredResources.defaultKmsKeyId}`);
|
|
496
|
-
}
|
|
497
|
-
} catch (error) {
|
|
498
|
-
console.error('❌ AWS discovery failed:', error.message);
|
|
499
|
-
throw new Error(`AWS discovery failed: ${error.message}`);
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
<<<<<<< HEAD
|
|
503
|
-
=======
|
|
504
|
-
|
|
505
|
-
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
408
|
+
const composeServerlessDefinition = (AppDefinition) => {
|
|
506
409
|
const definition = {
|
|
507
410
|
frameworkVersion: '>=3.17.0',
|
|
508
411
|
service: AppDefinition.name || 'create-frigg-app',
|
|
@@ -515,19 +418,11 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
515
418
|
name: AppDefinition.provider || 'aws',
|
|
516
419
|
runtime: 'nodejs20.x',
|
|
517
420
|
timeout: 30,
|
|
518
|
-
region:
|
|
421
|
+
region: 'us-east-1',
|
|
519
422
|
stage: '${opt:stage}',
|
|
520
423
|
environment: {
|
|
521
424
|
STAGE: '${opt:stage}',
|
|
522
425
|
AWS_NODEJS_CONNECTION_REUSE_ENABLED: 1,
|
|
523
|
-
// Add discovered resources to environment if available
|
|
524
|
-
...(discoveredResources.defaultVpcId && { AWS_DISCOVERY_VPC_ID: discoveredResources.defaultVpcId }),
|
|
525
|
-
...(discoveredResources.defaultSecurityGroupId && { AWS_DISCOVERY_SECURITY_GROUP_ID: discoveredResources.defaultSecurityGroupId }),
|
|
526
|
-
...(discoveredResources.privateSubnetId1 && { AWS_DISCOVERY_SUBNET_ID_1: discoveredResources.privateSubnetId1 }),
|
|
527
|
-
...(discoveredResources.privateSubnetId2 && { AWS_DISCOVERY_SUBNET_ID_2: discoveredResources.privateSubnetId2 }),
|
|
528
|
-
...(discoveredResources.publicSubnetId && { AWS_DISCOVERY_PUBLIC_SUBNET_ID: discoveredResources.publicSubnetId }),
|
|
529
|
-
...(discoveredResources.defaultRouteTableId && { AWS_DISCOVERY_ROUTE_TABLE_ID: discoveredResources.defaultRouteTableId }),
|
|
530
|
-
...(discoveredResources.defaultKmsKeyId && { AWS_DISCOVERY_KMS_KEY_ID: discoveredResources.defaultKmsKeyId }),
|
|
531
426
|
},
|
|
532
427
|
iamRoleStatements: [
|
|
533
428
|
{
|
|
@@ -578,7 +473,7 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
578
473
|
autoCreate: false,
|
|
579
474
|
apiVersion: '2012-11-05',
|
|
580
475
|
endpoint: 'http://localhost:4566',
|
|
581
|
-
region:
|
|
476
|
+
region: 'us-east-1',
|
|
582
477
|
accessKeyId: 'root',
|
|
583
478
|
secretAccessKey: 'root',
|
|
584
479
|
skipCacheInvalidation: false,
|
|
@@ -588,6 +483,26 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
588
483
|
},
|
|
589
484
|
},
|
|
590
485
|
functions: {
|
|
486
|
+
defaultWebsocket: {
|
|
487
|
+
handler: 'node_modules/@friggframework/core/handlers/routers/websocket.handler',
|
|
488
|
+
events: [
|
|
489
|
+
{
|
|
490
|
+
websocket: {
|
|
491
|
+
route: '$connect',
|
|
492
|
+
},
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
websocket: {
|
|
496
|
+
route: '$default',
|
|
497
|
+
},
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
websocket: {
|
|
501
|
+
route: '$disconnect',
|
|
502
|
+
},
|
|
503
|
+
},
|
|
504
|
+
],
|
|
505
|
+
},
|
|
591
506
|
auth: {
|
|
592
507
|
handler: 'node_modules/@friggframework/core/handlers/routers/auth.handler',
|
|
593
508
|
events: [
|
|
@@ -652,7 +567,7 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
652
567
|
Type: 'AWS::SQS::Queue',
|
|
653
568
|
Properties: {
|
|
654
569
|
QueueName:
|
|
655
|
-
'
|
|
570
|
+
'internal-error-queue-${self:provider.stage}',
|
|
656
571
|
MessageRetentionPeriod: 300,
|
|
657
572
|
},
|
|
658
573
|
},
|
|
@@ -736,7 +651,6 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
736
651
|
},
|
|
737
652
|
};
|
|
738
653
|
|
|
739
|
-
|
|
740
654
|
// KMS Configuration based on App Definition
|
|
741
655
|
if (AppDefinition.encryption?.useDefaultKMSForFieldLevelEncryption === true) {
|
|
742
656
|
// Add KMS IAM permissions
|
|
@@ -755,14 +669,39 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
755
669
|
// Add serverless-kms-grants plugin
|
|
756
670
|
definition.plugins.push('serverless-kms-grants');
|
|
757
671
|
|
|
758
|
-
// Configure KMS grants with
|
|
672
|
+
// Configure KMS grants with default key
|
|
759
673
|
definition.custom.kmsGrants = {
|
|
760
|
-
kmsKeyId:
|
|
674
|
+
kmsKeyId: '*'
|
|
761
675
|
};
|
|
762
676
|
}
|
|
763
677
|
|
|
764
678
|
// VPC Configuration based on App Definition
|
|
765
679
|
if (AppDefinition.vpc?.enable === true) {
|
|
680
|
+
// Create VPC config from App Definition or use auto-created resources
|
|
681
|
+
const vpcConfig = {};
|
|
682
|
+
|
|
683
|
+
if (AppDefinition.vpc.securityGroupIds) {
|
|
684
|
+
// User provided custom security groups
|
|
685
|
+
vpcConfig.securityGroupIds = AppDefinition.vpc.securityGroupIds;
|
|
686
|
+
} else {
|
|
687
|
+
// Use auto-created security group
|
|
688
|
+
vpcConfig.securityGroupIds = [{ Ref: 'FriggLambdaSecurityGroup' }];
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
if (AppDefinition.vpc.subnetIds) {
|
|
692
|
+
// User provided custom subnets
|
|
693
|
+
vpcConfig.subnetIds = AppDefinition.vpc.subnetIds;
|
|
694
|
+
} else {
|
|
695
|
+
// Use auto-created private subnets
|
|
696
|
+
vpcConfig.subnetIds = [
|
|
697
|
+
{ Ref: 'FriggPrivateSubnet1' },
|
|
698
|
+
{ Ref: 'FriggPrivateSubnet2' }
|
|
699
|
+
];
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
// Set VPC config for Lambda functions
|
|
703
|
+
definition.provider.vpc = vpcConfig;
|
|
704
|
+
|
|
766
705
|
// Add VPC-related IAM permissions
|
|
767
706
|
definition.provider.iamRoleStatements.push({
|
|
768
707
|
Effect: 'Allow',
|
|
@@ -776,247 +715,17 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
776
715
|
Resource: '*'
|
|
777
716
|
});
|
|
778
717
|
|
|
779
|
-
//
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
const vpcConfig = {};
|
|
783
|
-
|
|
784
|
-
if (AppDefinition.vpc.securityGroupIds) {
|
|
785
|
-
// User provided custom security groups
|
|
786
|
-
vpcConfig.securityGroupIds = AppDefinition.vpc.securityGroupIds;
|
|
787
|
-
} else {
|
|
788
|
-
// Use auto-created security group
|
|
789
|
-
vpcConfig.securityGroupIds = [{ Ref: 'FriggLambdaSecurityGroup' }];
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
if (AppDefinition.vpc.subnetIds) {
|
|
793
|
-
// User provided custom subnets
|
|
794
|
-
vpcConfig.subnetIds = AppDefinition.vpc.subnetIds;
|
|
795
|
-
} else {
|
|
796
|
-
// Use auto-created private subnets
|
|
797
|
-
vpcConfig.subnetIds = [
|
|
798
|
-
{ Ref: 'FriggPrivateSubnet1' },
|
|
799
|
-
{ Ref: 'FriggPrivateSubnet2' }
|
|
800
|
-
];
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
// Set VPC config for Lambda functions
|
|
804
|
-
definition.provider.vpc = vpcConfig;
|
|
805
|
-
|
|
806
|
-
// Add VPC infrastructure resources to CloudFormation
|
|
807
|
-
const vpcResources = createVPCInfrastructure(AppDefinition);
|
|
808
|
-
Object.assign(definition.resources.Resources, vpcResources);
|
|
809
|
-
} else {
|
|
810
|
-
// Option 2: Use AWS Discovery (default behavior)
|
|
811
|
-
// VPC configuration using discovered or explicitly provided resources
|
|
812
|
-
const vpcConfig = {
|
|
813
|
-
<<<<<<< HEAD
|
|
814
|
-
securityGroupIds: AppDefinition.vpc.securityGroupIds ||
|
|
815
|
-
(discoveredResources.defaultSecurityGroupId ? [discoveredResources.defaultSecurityGroupId] : []),
|
|
816
|
-
subnetIds: AppDefinition.vpc.subnetIds ||
|
|
817
|
-
(discoveredResources.privateSubnetId1 && discoveredResources.privateSubnetId2 ?
|
|
818
|
-
[discoveredResources.privateSubnetId1, discoveredResources.privateSubnetId2] :
|
|
819
|
-
[])
|
|
820
|
-
=======
|
|
821
|
-
securityGroupIds: AppDefinition.vpc.securityGroupIds ||
|
|
822
|
-
(discoveredResources.defaultSecurityGroupId ? [discoveredResources.defaultSecurityGroupId] : []),
|
|
823
|
-
subnetIds: AppDefinition.vpc.subnetIds ||
|
|
824
|
-
(discoveredResources.privateSubnetId1 && discoveredResources.privateSubnetId2 ?
|
|
825
|
-
[discoveredResources.privateSubnetId1, discoveredResources.privateSubnetId2] :
|
|
826
|
-
[])
|
|
827
|
-
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
828
|
-
};
|
|
829
|
-
|
|
830
|
-
// Set VPC config for Lambda functions only if we have valid subnet IDs
|
|
831
|
-
if (vpcConfig.subnetIds.length >= 2 && vpcConfig.securityGroupIds.length > 0) {
|
|
832
|
-
definition.provider.vpc = vpcConfig;
|
|
833
|
-
<<<<<<< HEAD
|
|
834
|
-
|
|
835
|
-
// Check if we have an existing NAT Gateway to use
|
|
836
|
-
if (!discoveredResources.existingNatGatewayId) {
|
|
837
|
-
// No existing NAT Gateway, create new resources
|
|
838
|
-
|
|
839
|
-
=======
|
|
840
|
-
|
|
841
|
-
// Check if we have an existing NAT Gateway to use
|
|
842
|
-
if (!discoveredResources.existingNatGatewayId) {
|
|
843
|
-
// No existing NAT Gateway, create new resources
|
|
844
|
-
|
|
845
|
-
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
846
|
-
// Only create EIP if we don't have an existing one available
|
|
847
|
-
if (!discoveredResources.existingElasticIpAllocationId) {
|
|
848
|
-
definition.resources.Resources.FriggNATGatewayEIP = {
|
|
849
|
-
Type: 'AWS::EC2::EIP',
|
|
850
|
-
Properties: {
|
|
851
|
-
Domain: 'vpc',
|
|
852
|
-
Tags: [
|
|
853
|
-
{ Key: 'Name', Value: '${self:service}-${self:provider.stage}-nat-eip' }
|
|
854
|
-
]
|
|
855
|
-
}
|
|
856
|
-
};
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
definition.resources.Resources.FriggNATGateway = {
|
|
860
|
-
Type: 'AWS::EC2::NatGateway',
|
|
861
|
-
Properties: {
|
|
862
|
-
<<<<<<< HEAD
|
|
863
|
-
AllocationId: discoveredResources.existingElasticIpAllocationId ||
|
|
864
|
-
{ 'Fn::GetAtt': ['FriggNATGatewayEIP', 'AllocationId'] },
|
|
865
|
-
=======
|
|
866
|
-
AllocationId: discoveredResources.existingElasticIpAllocationId ||
|
|
867
|
-
{ 'Fn::GetAtt': ['FriggNATGatewayEIP', 'AllocationId'] },
|
|
868
|
-
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
869
|
-
SubnetId: discoveredResources.publicSubnetId || discoveredResources.privateSubnetId1, // Use first discovered subnet if no public subnet found
|
|
870
|
-
Tags: [
|
|
871
|
-
{ Key: 'Name', Value: '${self:service}-${self:provider.stage}-nat-gateway' }
|
|
872
|
-
]
|
|
873
|
-
}
|
|
874
|
-
};
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
// Create route table for Lambda subnets to use NAT Gateway
|
|
878
|
-
definition.resources.Resources.FriggLambdaRouteTable = {
|
|
879
|
-
Type: 'AWS::EC2::RouteTable',
|
|
880
|
-
Properties: {
|
|
881
|
-
VpcId: discoveredResources.defaultVpcId || { Ref: 'FriggVPC' },
|
|
882
|
-
Tags: [
|
|
883
|
-
{ Key: 'Name', Value: '${self:service}-${self:provider.stage}-lambda-rt' }
|
|
884
|
-
]
|
|
885
|
-
}
|
|
886
|
-
};
|
|
887
|
-
|
|
888
|
-
definition.resources.Resources.FriggNATRoute = {
|
|
889
|
-
Type: 'AWS::EC2::Route',
|
|
890
|
-
Properties: {
|
|
891
|
-
RouteTableId: { Ref: 'FriggLambdaRouteTable' },
|
|
892
|
-
DestinationCidrBlock: '0.0.0.0/0',
|
|
893
|
-
NatGatewayId: discoveredResources.existingNatGatewayId || { Ref: 'FriggNATGateway' }
|
|
894
|
-
}
|
|
895
|
-
};
|
|
896
|
-
|
|
897
|
-
// Associate Lambda subnets with NAT Gateway route table
|
|
898
|
-
definition.resources.Resources.FriggSubnet1RouteAssociation = {
|
|
899
|
-
Type: 'AWS::EC2::SubnetRouteTableAssociation',
|
|
900
|
-
<<<<<<< HEAD
|
|
901
|
-
Properties: {
|
|
902
|
-
SubnetId: vpcConfig.subnetIds[0],
|
|
903
|
-
RouteTableId: { Ref: 'FriggLambdaRouteTable' }
|
|
904
|
-
}
|
|
905
|
-
};
|
|
906
|
-
|
|
907
|
-
definition.resources.Resources.FriggSubnet2RouteAssociation = {
|
|
908
|
-
Type: 'AWS::EC2::SubnetRouteTableAssociation',
|
|
909
|
-
Properties: {
|
|
910
|
-
SubnetId: vpcConfig.subnetIds[1],
|
|
911
|
-
RouteTableId: { Ref: 'FriggLambdaRouteTable' }
|
|
912
|
-
}
|
|
913
|
-
};
|
|
914
|
-
=======
|
|
915
|
-
Properties: {
|
|
916
|
-
SubnetId: vpcConfig.subnetIds[0],
|
|
917
|
-
RouteTableId: { Ref: 'FriggLambdaRouteTable' }
|
|
918
|
-
}
|
|
919
|
-
};
|
|
920
|
-
|
|
921
|
-
definition.resources.Resources.FriggSubnet2RouteAssociation = {
|
|
922
|
-
Type: 'AWS::EC2::SubnetRouteTableAssociation',
|
|
923
|
-
Properties: {
|
|
924
|
-
SubnetId: vpcConfig.subnetIds[1],
|
|
925
|
-
RouteTableId: { Ref: 'FriggLambdaRouteTable' }
|
|
926
|
-
}
|
|
927
|
-
};
|
|
928
|
-
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
929
|
-
|
|
930
|
-
// Add VPC endpoints for AWS service optimization (optional but recommended)
|
|
931
|
-
if (AppDefinition.vpc.enableVPCEndpoints !== false) {
|
|
932
|
-
definition.resources.Resources.VPCEndpointS3 = {
|
|
933
|
-
<<<<<<< HEAD
|
|
934
|
-
Type: 'AWS::EC2::VPCEndpoint',
|
|
935
|
-
Properties: {
|
|
936
|
-
VpcId: discoveredResources.defaultVpcId,
|
|
937
|
-
ServiceName: 'com.amazonaws.${self:provider.region}.s3',
|
|
938
|
-
VpcEndpointType: 'Gateway',
|
|
939
|
-
RouteTableIds: [{ Ref: 'FriggLambdaRouteTable' }]
|
|
940
|
-
}
|
|
941
|
-
};
|
|
942
|
-
|
|
943
|
-
definition.resources.Resources.VPCEndpointDynamoDB = {
|
|
944
|
-
Type: 'AWS::EC2::VPCEndpoint',
|
|
945
|
-
Properties: {
|
|
946
|
-
VpcId: discoveredResources.defaultVpcId,
|
|
947
|
-
ServiceName: 'com.amazonaws.${self:provider.region}.dynamodb',
|
|
948
|
-
VpcEndpointType: 'Gateway',
|
|
949
|
-
RouteTableIds: [{ Ref: 'FriggLambdaRouteTable' }]
|
|
950
|
-
}
|
|
951
|
-
};
|
|
952
|
-
=======
|
|
953
|
-
Type: 'AWS::EC2::VPCEndpoint',
|
|
954
|
-
Properties: {
|
|
955
|
-
VpcId: discoveredResources.defaultVpcId,
|
|
956
|
-
ServiceName: 'com.amazonaws.${self:provider.region}.s3',
|
|
957
|
-
VpcEndpointType: 'Gateway',
|
|
958
|
-
RouteTableIds: [{ Ref: 'FriggLambdaRouteTable' }]
|
|
959
|
-
}
|
|
960
|
-
};
|
|
961
|
-
|
|
962
|
-
definition.resources.Resources.VPCEndpointDynamoDB = {
|
|
963
|
-
Type: 'AWS::EC2::VPCEndpoint',
|
|
964
|
-
Properties: {
|
|
965
|
-
VpcId: discoveredResources.defaultVpcId,
|
|
966
|
-
ServiceName: 'com.amazonaws.${self:provider.region}.dynamodb',
|
|
967
|
-
VpcEndpointType: 'Gateway',
|
|
968
|
-
RouteTableIds: [{ Ref: 'FriggLambdaRouteTable' }]
|
|
969
|
-
}
|
|
970
|
-
};
|
|
971
|
-
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
|
|
977
|
-
// SSM Parameter Store Configuration based on App Definition
|
|
978
|
-
if (AppDefinition.ssm?.enable === true) {
|
|
979
|
-
// Add AWS Parameters and Secrets Lambda Extension layer
|
|
980
|
-
definition.provider.layers = [
|
|
981
|
-
'arn:aws:lambda:${self:provider.region}:177933569100:layer:AWS-Parameters-and-Secrets-Lambda-Extension:11'
|
|
982
|
-
];
|
|
983
|
-
|
|
984
|
-
// Add SSM IAM permissions
|
|
985
|
-
definition.provider.iamRoleStatements.push({
|
|
986
|
-
Effect: 'Allow',
|
|
987
|
-
Action: [
|
|
988
|
-
'ssm:GetParameter',
|
|
989
|
-
'ssm:GetParameters',
|
|
990
|
-
'ssm:GetParametersByPath'
|
|
991
|
-
],
|
|
992
|
-
Resource: [
|
|
993
|
-
'arn:aws:ssm:${self:provider.region}:*:parameter/${self:service}/${self:provider.stage}/*'
|
|
994
|
-
]
|
|
995
|
-
});
|
|
996
|
-
|
|
997
|
-
// Add environment variable for SSM parameter prefix
|
|
998
|
-
definition.provider.environment.SSM_PARAMETER_PREFIX = '/${self:service}/${self:provider.stage}';
|
|
718
|
+
// Add VPC infrastructure resources to CloudFormation
|
|
719
|
+
const vpcResources = createVPCInfrastructure(AppDefinition);
|
|
720
|
+
Object.assign(definition.resources.Resources, vpcResources);
|
|
999
721
|
}
|
|
1000
722
|
|
|
1001
723
|
// Add integration-specific functions and resources
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
if (!integration || !integration.Definition || !integration.Definition.name) {
|
|
1005
|
-
throw new Error('Invalid integration: missing Definition or name');
|
|
1006
|
-
}
|
|
1007
|
-
const integrationName = integration.Definition.name;
|
|
724
|
+
for (const integration of AppDefinition.integrations) {
|
|
725
|
+
const integrationName = integration.Definition.name;
|
|
1008
726
|
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
<<<<<<< HEAD
|
|
1012
|
-
handler: `node_modules/@friggframework/core/handlers/routers/integration-defined-routers.handlers.${integrationName}.handler`,
|
|
1013
|
-
events: [
|
|
1014
|
-
{
|
|
1015
|
-
http: {
|
|
1016
|
-
path: `/api/${integrationName}-integration/{proxy+}`,
|
|
1017
|
-
method: 'ANY',
|
|
1018
|
-
cors: true,
|
|
1019
|
-
=======
|
|
727
|
+
// Add function for the integration
|
|
728
|
+
definition.functions[integrationName] = {
|
|
1020
729
|
handler: `node_modules/@friggframework/core/handlers/routers/integration-defined-routers.handlers.${integrationName}.handler`,
|
|
1021
730
|
events: [
|
|
1022
731
|
{
|
|
@@ -1029,11 +738,11 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
1029
738
|
],
|
|
1030
739
|
};
|
|
1031
740
|
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
741
|
+
// Add SQS Queue for the integration
|
|
742
|
+
const queueReference = `${integrationName.charAt(0).toUpperCase() + integrationName.slice(1)
|
|
743
|
+
}Queue`;
|
|
744
|
+
const queueName = `\${self:service}--\${self:provider.stage}-${queueReference}`;
|
|
745
|
+
definition.resources.Resources[queueReference] = {
|
|
1037
746
|
Type: 'AWS::SQS::Queue',
|
|
1038
747
|
Properties: {
|
|
1039
748
|
QueueName: `\${self:custom.${queueReference}}`,
|
|
@@ -1048,9 +757,9 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
1048
757
|
},
|
|
1049
758
|
};
|
|
1050
759
|
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
760
|
+
// Add Queue Worker for the integration
|
|
761
|
+
const queueWorkerName = `${integrationName}QueueWorker`;
|
|
762
|
+
definition.functions[queueWorkerName] = {
|
|
1054
763
|
handler: `node_modules/@friggframework/core/handlers/workers/integration-defined-workers.handlers.${integrationName}.queueWorker`,
|
|
1055
764
|
reservedConcurrency: 5,
|
|
1056
765
|
events: [
|
|
@@ -1058,182 +767,23 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
1058
767
|
sqs: {
|
|
1059
768
|
arn: {
|
|
1060
769
|
'Fn::GetAtt': [queueReference, 'Arn'],
|
|
1061
|
-
>>>>>>> 37c4892ee8a686eb7acfcd17c333b0ed73e1f120
|
|
1062
|
-
},
|
|
1063
|
-
},
|
|
1064
|
-
],
|
|
1065
|
-
};
|
|
1066
|
-
|
|
1067
|
-
// Add SQS Queue for the integration
|
|
1068
|
-
const queueReference = `${integrationName.charAt(0).toUpperCase() + integrationName.slice(1)
|
|
1069
|
-
}Queue`;
|
|
1070
|
-
const queueName = `\${self:service}--\${self:provider.stage}-${queueReference}`;
|
|
1071
|
-
definition.resources.Resources[queueReference] = {
|
|
1072
|
-
Type: 'AWS::SQS::Queue',
|
|
1073
|
-
Properties: {
|
|
1074
|
-
QueueName: `\${self:custom.${queueReference}}`,
|
|
1075
|
-
MessageRetentionPeriod: 60,
|
|
1076
|
-
VisibilityTimeout: 1800, // 30 minutes
|
|
1077
|
-
RedrivePolicy: {
|
|
1078
|
-
maxReceiveCount: 1,
|
|
1079
|
-
deadLetterTargetArn: {
|
|
1080
|
-
'Fn::GetAtt': ['InternalErrorQueue', 'Arn'],
|
|
1081
770
|
},
|
|
1082
|
-
|
|
1083
|
-
},
|
|
1084
|
-
};
|
|
1085
|
-
|
|
1086
|
-
// Add Queue Worker for the integration
|
|
1087
|
-
const queueWorkerName = `${integrationName}QueueWorker`;
|
|
1088
|
-
definition.functions[queueWorkerName] = {
|
|
1089
|
-
handler: `node_modules/@friggframework/core/handlers/workers/integration-defined-workers.handlers.${integrationName}.queueWorker`,
|
|
1090
|
-
reservedConcurrency: 5,
|
|
1091
|
-
events: [
|
|
1092
|
-
{
|
|
1093
|
-
sqs: {
|
|
1094
|
-
arn: {
|
|
1095
|
-
'Fn::GetAtt': [queueReference, 'Arn'],
|
|
1096
|
-
},
|
|
1097
|
-
batchSize: 1,
|
|
1098
|
-
},
|
|
1099
|
-
},
|
|
1100
|
-
],
|
|
1101
|
-
timeout: 600,
|
|
1102
|
-
};
|
|
1103
|
-
|
|
1104
|
-
// Add Queue URL for the integration to the ENVironment variables
|
|
1105
|
-
definition.provider.environment = {
|
|
1106
|
-
...definition.provider.environment,
|
|
1107
|
-
[`${integrationName.toUpperCase()}_QUEUE_URL`]: {
|
|
1108
|
-
Ref: queueReference,
|
|
1109
|
-
},
|
|
1110
|
-
};
|
|
1111
|
-
|
|
1112
|
-
definition.custom[queueReference] = queueName;
|
|
1113
|
-
}
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
// Discovery has already run successfully at this point if needed
|
|
1117
|
-
// The discoveredResources object contains all the necessary AWS resources
|
|
1118
|
-
|
|
1119
|
-
// Add websocket function if enabled
|
|
1120
|
-
if (AppDefinition.websockets?.enable === true) {
|
|
1121
|
-
definition.functions.defaultWebsocket = {
|
|
1122
|
-
handler: 'node_modules/@friggframework/core/handlers/routers/websocket.handler',
|
|
1123
|
-
events: [
|
|
1124
|
-
{
|
|
1125
|
-
websocket: {
|
|
1126
|
-
route: '$connect',
|
|
1127
|
-
},
|
|
1128
|
-
},
|
|
1129
|
-
{
|
|
1130
|
-
websocket: {
|
|
1131
|
-
route: '$default',
|
|
1132
|
-
},
|
|
1133
|
-
},
|
|
1134
|
-
{
|
|
1135
|
-
websocket: {
|
|
1136
|
-
route: '$disconnect',
|
|
771
|
+
batchSize: 1,
|
|
1137
772
|
},
|
|
1138
773
|
},
|
|
1139
774
|
],
|
|
775
|
+
timeout: 600,
|
|
1140
776
|
};
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
<<<<<<< HEAD
|
|
1144
|
-
// Discovery has already run successfully at this point if needed
|
|
1145
|
-
// The discoveredResources object contains all the necessary AWS resources
|
|
1146
777
|
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
websocket: {
|
|
1154
|
-
route: '$connect',
|
|
1155
|
-
},
|
|
1156
|
-
},
|
|
1157
|
-
{
|
|
1158
|
-
websocket: {
|
|
1159
|
-
route: '$default',
|
|
1160
|
-
},
|
|
1161
|
-
},
|
|
1162
|
-
{
|
|
1163
|
-
websocket: {
|
|
1164
|
-
route: '$disconnect',
|
|
1165
|
-
},
|
|
1166
|
-
},
|
|
1167
|
-
],
|
|
1168
|
-
};
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
=======
|
|
1172
|
-
// Add Queue URL for the integration to the ENVironment variables
|
|
1173
|
-
definition.provider.environment = {
|
|
1174
|
-
...definition.provider.environment,
|
|
1175
|
-
[`${integrationName.toUpperCase()}_QUEUE_URL`]: {
|
|
1176
|
-
Ref: queueReference,
|
|
1177
|
-
},
|
|
1178
|
-
};
|
|
1179
|
-
|
|
1180
|
-
definition.custom[queueReference] = queueName;
|
|
1181
|
-
}
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
// Discovery has already run successfully at this point if needed
|
|
1185
|
-
// The discoveredResources object contains all the necessary AWS resources
|
|
1186
|
-
|
|
1187
|
-
// Add websocket function if enabled
|
|
1188
|
-
if (AppDefinition.websockets?.enable === true) {
|
|
1189
|
-
definition.functions.defaultWebsocket = {
|
|
1190
|
-
handler: 'node_modules/@friggframework/core/handlers/routers/websocket.handler',
|
|
1191
|
-
events: [
|
|
1192
|
-
{
|
|
1193
|
-
websocket: {
|
|
1194
|
-
route: '$connect',
|
|
1195
|
-
},
|
|
1196
|
-
},
|
|
1197
|
-
{
|
|
1198
|
-
websocket: {
|
|
1199
|
-
route: '$default',
|
|
1200
|
-
},
|
|
1201
|
-
},
|
|
1202
|
-
{
|
|
1203
|
-
websocket: {
|
|
1204
|
-
route: '$disconnect',
|
|
1205
|
-
},
|
|
1206
|
-
},
|
|
1207
|
-
],
|
|
778
|
+
// Add Queue URL for the integration to the ENVironment variables
|
|
779
|
+
definition.provider.environment = {
|
|
780
|
+
...definition.provider.environment,
|
|
781
|
+
[`${integrationName.toUpperCase()}_QUEUE_URL`]: {
|
|
782
|
+
Ref: queueReference,
|
|
783
|
+
},
|
|
1208
784
|
};
|
|
1209
|
-
}
|
|
1210
785
|
|
|
1211
|
-
|
|
1212
|
-
// Discovery has already run successfully at this point if needed
|
|
1213
|
-
// The discoveredResources object contains all the necessary AWS resources
|
|
1214
|
-
|
|
1215
|
-
// Add websocket function if enabled
|
|
1216
|
-
if (AppDefinition.websockets?.enable === true) {
|
|
1217
|
-
definition.functions.defaultWebsocket = {
|
|
1218
|
-
handler: 'node_modules/@friggframework/core/handlers/routers/websocket.handler',
|
|
1219
|
-
events: [
|
|
1220
|
-
{
|
|
1221
|
-
websocket: {
|
|
1222
|
-
route: '$connect',
|
|
1223
|
-
},
|
|
1224
|
-
},
|
|
1225
|
-
{
|
|
1226
|
-
websocket: {
|
|
1227
|
-
route: '$default',
|
|
1228
|
-
},
|
|
1229
|
-
},
|
|
1230
|
-
{
|
|
1231
|
-
websocket: {
|
|
1232
|
-
route: '$disconnect',
|
|
1233
|
-
},
|
|
1234
|
-
},
|
|
1235
|
-
],
|
|
1236
|
-
};
|
|
786
|
+
definition.custom[queueReference] = queueName;
|
|
1237
787
|
}
|
|
1238
788
|
|
|
1239
789
|
// Modify handler paths to point to the correct node_modules location
|