@friggframework/devtools 2.0.0-next.44 → 2.0.0-next.45
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.
|
@@ -68,8 +68,7 @@ const getAppEnvironmentVars = (AppDefinition) => {
|
|
|
68
68
|
}
|
|
69
69
|
if (skippedKeys.length > 0) {
|
|
70
70
|
console.log(
|
|
71
|
-
` ⚠️ Skipped ${
|
|
72
|
-
skippedKeys.length
|
|
71
|
+
` ⚠️ Skipped ${skippedKeys.length
|
|
73
72
|
} reserved AWS Lambda variables: ${skippedKeys.join(', ')}`
|
|
74
73
|
);
|
|
75
74
|
}
|
|
@@ -852,7 +851,7 @@ const applyKmsConfiguration = (
|
|
|
852
851
|
if (AppDefinition.encryption?.createResourceIfNoneFound !== true) {
|
|
853
852
|
throw new Error(
|
|
854
853
|
'KMS field-level encryption is enabled but no KMS key was found. ' +
|
|
855
|
-
|
|
854
|
+
'Either provide an existing KMS key or set encryption.createResourceIfNoneFound to true to create a new key.'
|
|
856
855
|
);
|
|
857
856
|
}
|
|
858
857
|
|
|
@@ -891,9 +890,8 @@ const applyKmsConfiguration = (
|
|
|
891
890
|
Resource: '*',
|
|
892
891
|
Condition: {
|
|
893
892
|
StringEquals: {
|
|
894
|
-
'kms:ViaService': `lambda.${
|
|
895
|
-
|
|
896
|
-
}.amazonaws.com`,
|
|
893
|
+
'kms:ViaService': `lambda.${process.env.AWS_REGION || 'us-east-1'
|
|
894
|
+
}.amazonaws.com`,
|
|
897
895
|
},
|
|
898
896
|
},
|
|
899
897
|
},
|
|
@@ -1295,13 +1293,13 @@ const configureVpc = (definition, AppDefinition, discoveredResources) => {
|
|
|
1295
1293
|
};
|
|
1296
1294
|
|
|
1297
1295
|
definition.resources.Resources.FriggPublicSubnetRouteTableAssociation =
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1296
|
+
{
|
|
1297
|
+
Type: 'AWS::EC2::SubnetRouteTableAssociation',
|
|
1298
|
+
Properties: {
|
|
1299
|
+
SubnetId: { Ref: 'FriggPublicSubnet' },
|
|
1300
|
+
RouteTableId: { Ref: 'FriggPublicRouteTable' },
|
|
1301
|
+
},
|
|
1302
|
+
};
|
|
1305
1303
|
|
|
1306
1304
|
definition.resources.Resources.FriggLambdaRouteTable = {
|
|
1307
1305
|
Type: 'AWS::EC2::RouteTable',
|
|
@@ -1318,22 +1316,22 @@ const configureVpc = (definition, AppDefinition, discoveredResources) => {
|
|
|
1318
1316
|
};
|
|
1319
1317
|
|
|
1320
1318
|
definition.resources.Resources.FriggPrivateSubnet1RouteTableAssociation =
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1319
|
+
{
|
|
1320
|
+
Type: 'AWS::EC2::SubnetRouteTableAssociation',
|
|
1321
|
+
Properties: {
|
|
1322
|
+
SubnetId: { Ref: 'FriggPrivateSubnet1' },
|
|
1323
|
+
RouteTableId: { Ref: 'FriggLambdaRouteTable' },
|
|
1324
|
+
},
|
|
1325
|
+
};
|
|
1328
1326
|
|
|
1329
1327
|
definition.resources.Resources.FriggPrivateSubnet2RouteTableAssociation =
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1328
|
+
{
|
|
1329
|
+
Type: 'AWS::EC2::SubnetRouteTableAssociation',
|
|
1330
|
+
Properties: {
|
|
1331
|
+
SubnetId: { Ref: 'FriggPrivateSubnet2' },
|
|
1332
|
+
RouteTableId: { Ref: 'FriggLambdaRouteTable' },
|
|
1333
|
+
},
|
|
1334
|
+
};
|
|
1337
1335
|
}
|
|
1338
1336
|
} else if (subnetManagement === 'use-existing') {
|
|
1339
1337
|
if (
|
|
@@ -1350,12 +1348,12 @@ const configureVpc = (definition, AppDefinition, discoveredResources) => {
|
|
|
1350
1348
|
AppDefinition.vpc.subnets?.ids?.length > 0
|
|
1351
1349
|
? AppDefinition.vpc.subnets.ids
|
|
1352
1350
|
: discoveredResources.privateSubnetId1 &&
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1351
|
+
discoveredResources.privateSubnetId2
|
|
1352
|
+
? [
|
|
1353
|
+
discoveredResources.privateSubnetId1,
|
|
1354
|
+
discoveredResources.privateSubnetId2,
|
|
1355
|
+
]
|
|
1356
|
+
: [];
|
|
1359
1357
|
|
|
1360
1358
|
if (vpcConfig.subnetIds.length < 2) {
|
|
1361
1359
|
if (AppDefinition.vpc.selfHeal) {
|
|
@@ -1562,13 +1560,13 @@ const configureVpc = (definition, AppDefinition, discoveredResources) => {
|
|
|
1562
1560
|
};
|
|
1563
1561
|
|
|
1564
1562
|
definition.resources.Resources.FriggPublicSubnetRouteTableAssociation =
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1563
|
+
{
|
|
1564
|
+
Type: 'AWS::EC2::SubnetRouteTableAssociation',
|
|
1565
|
+
Properties: {
|
|
1566
|
+
SubnetId: { Ref: 'FriggPublicSubnet' },
|
|
1567
|
+
RouteTableId: { Ref: 'FriggPublicRouteTable' },
|
|
1568
|
+
},
|
|
1569
|
+
};
|
|
1572
1570
|
}
|
|
1573
1571
|
|
|
1574
1572
|
definition.resources.Resources.FriggNATGateway = {
|
|
@@ -1579,11 +1577,11 @@ const configureVpc = (definition, AppDefinition, discoveredResources) => {
|
|
|
1579
1577
|
AllocationId: useExistingEip
|
|
1580
1578
|
? discoveredResources.existingElasticIpAllocationId
|
|
1581
1579
|
: {
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1580
|
+
'Fn::GetAtt': [
|
|
1581
|
+
'FriggNATGatewayEIP',
|
|
1582
|
+
'AllocationId',
|
|
1583
|
+
],
|
|
1584
|
+
},
|
|
1587
1585
|
SubnetId: discoveredResources.publicSubnetId || {
|
|
1588
1586
|
Ref: 'FriggPublicSubnet',
|
|
1589
1587
|
},
|
|
@@ -1957,9 +1955,8 @@ const attachIntegrations = (definition, AppDefinition) => {
|
|
|
1957
1955
|
}
|
|
1958
1956
|
|
|
1959
1957
|
const integrationName = integration.Definition.name;
|
|
1960
|
-
const queueReference = `${
|
|
1961
|
-
|
|
1962
|
-
}Queue`;
|
|
1958
|
+
const queueReference = `${integrationName.charAt(0).toUpperCase() + integrationName.slice(1)
|
|
1959
|
+
}Queue`;
|
|
1963
1960
|
const queueName = `\${self:service}--\${self:provider.stage}-${queueReference}`;
|
|
1964
1961
|
|
|
1965
1962
|
definition.functions[integrationName] = {
|
|
@@ -2012,6 +2009,30 @@ const attachIntegrations = (definition, AppDefinition) => {
|
|
|
2012
2009
|
};
|
|
2013
2010
|
|
|
2014
2011
|
definition.custom[queueReference] = queueName;
|
|
2012
|
+
|
|
2013
|
+
// Add webhook handler if enabled
|
|
2014
|
+
const webhookConfig = integration.Definition.webhooks;
|
|
2015
|
+
if (webhookConfig && (webhookConfig === true || webhookConfig.enabled === true)) {
|
|
2016
|
+
const webhookFunctionName = `${integrationName}Webhook`;
|
|
2017
|
+
|
|
2018
|
+
definition.functions[webhookFunctionName] = {
|
|
2019
|
+
handler: `node_modules/@friggframework/core/handlers/routers/integration-webhook-routers.handlers.${integrationName}Webhook.handler`,
|
|
2020
|
+
events: [
|
|
2021
|
+
{
|
|
2022
|
+
httpApi: {
|
|
2023
|
+
path: `/api/${integrationName}-integration/webhooks`,
|
|
2024
|
+
method: 'POST',
|
|
2025
|
+
},
|
|
2026
|
+
},
|
|
2027
|
+
{
|
|
2028
|
+
httpApi: {
|
|
2029
|
+
path: `/api/${integrationName}-integration/webhooks/{integrationId}`,
|
|
2030
|
+
method: 'POST',
|
|
2031
|
+
},
|
|
2032
|
+
},
|
|
2033
|
+
],
|
|
2034
|
+
};
|
|
2035
|
+
}
|
|
2015
2036
|
}
|
|
2016
2037
|
};
|
|
2017
2038
|
|
|
@@ -2055,7 +2076,6 @@ const composeServerlessDefinition = async (AppDefinition) => {
|
|
|
2055
2076
|
if (!isLocalBuild) {
|
|
2056
2077
|
applyKmsConfiguration(definition, AppDefinition, discoveredResources);
|
|
2057
2078
|
configureVpc(definition, AppDefinition, discoveredResources);
|
|
2058
|
-
configurePostgres(definition, AppDefinition, discoveredResources);
|
|
2059
2079
|
configureSsm(definition, AppDefinition);
|
|
2060
2080
|
} else {
|
|
2061
2081
|
console.log(
|
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.
|
|
4
|
+
"version": "2.0.0-next.45",
|
|
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.
|
|
13
|
-
"@friggframework/test": "2.0.0-next.
|
|
12
|
+
"@friggframework/schemas": "2.0.0-next.45",
|
|
13
|
+
"@friggframework/test": "2.0.0-next.45",
|
|
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
|
-
"@friggframework/prettier-config": "2.0.0-next.
|
|
35
|
+
"@friggframework/eslint-config": "2.0.0-next.45",
|
|
36
|
+
"@friggframework/prettier-config": "2.0.0-next.45",
|
|
37
37
|
"aws-sdk-client-mock": "^4.1.0",
|
|
38
38
|
"aws-sdk-client-mock-jest": "^4.1.0",
|
|
39
39
|
"jest": "^30.1.3",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "996a15bcdfaa4252b9891a33f1b1c84548d66bbc"
|
|
72
72
|
}
|