@incloodsolutions/devkit 0.0.3 → 0.0.5
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/README.md +180 -41
- package/dist/{aws/cdk/constructs/api-gateway-v2-construct.cjs → aws-cdk/constructs/api-gateway-v2.cjs} +2 -2
- package/dist/aws-cdk/constructs/api-gateway-v2.cjs.map +1 -0
- package/dist/{aws/cdk/constructs/api-gateway-v2-construct.d.ts → aws-cdk/constructs/api-gateway-v2.d.cts} +2 -1
- package/dist/{aws/cdk/constructs/api-gateway-v2-construct.d.cts → aws-cdk/constructs/api-gateway-v2.d.ts} +2 -1
- package/dist/{aws/cdk/constructs/api-gateway-v2-construct.js → aws-cdk/constructs/api-gateway-v2.js} +2 -2
- package/dist/aws-cdk/constructs/api-gateway-v2.js.map +1 -0
- package/dist/{aws/cdk/constructs/api-gateway-websocket-construct.cjs → aws-cdk/constructs/api-gateway-websocket.cjs} +18 -6
- package/dist/aws-cdk/constructs/api-gateway-websocket.cjs.map +1 -0
- package/dist/{aws/cdk/constructs/api-gateway-websocket-construct.d.ts → aws-cdk/constructs/api-gateway-websocket.d.cts} +2 -1
- package/dist/{aws/cdk/constructs/api-gateway-websocket-construct.d.cts → aws-cdk/constructs/api-gateway-websocket.d.ts} +2 -1
- package/dist/{aws/cdk/constructs/api-gateway-websocket-construct.js → aws-cdk/constructs/api-gateway-websocket.js} +18 -6
- package/dist/aws-cdk/constructs/api-gateway-websocket.js.map +1 -0
- package/dist/{aws/cdk/constructs/api-gateway-construct.cjs → aws-cdk/constructs/api-gateway.cjs} +6 -3
- package/dist/aws-cdk/constructs/api-gateway.cjs.map +1 -0
- package/dist/{aws/cdk/constructs/api-gateway-construct.d.ts → aws-cdk/constructs/api-gateway.d.cts} +2 -1
- package/dist/{aws/cdk/constructs/api-gateway-construct.d.cts → aws-cdk/constructs/api-gateway.d.ts} +2 -1
- package/dist/{aws/cdk/constructs/api-gateway-construct.js → aws-cdk/constructs/api-gateway.js} +6 -3
- package/dist/aws-cdk/constructs/api-gateway.js.map +1 -0
- package/dist/{aws/cdk/constructs/cloudfront-construct.cjs → aws-cdk/constructs/cloudfront.cjs} +2 -2
- package/dist/aws-cdk/constructs/cloudfront.cjs.map +1 -0
- package/dist/{aws/cdk/constructs/cloudfront-construct.d.ts → aws-cdk/constructs/cloudfront.d.cts} +2 -1
- package/dist/{aws/cdk/constructs/cloudfront-construct.d.cts → aws-cdk/constructs/cloudfront.d.ts} +2 -1
- package/dist/{aws/cdk/constructs/cloudfront-construct.js → aws-cdk/constructs/cloudfront.js} +2 -2
- package/dist/aws-cdk/constructs/cloudfront.js.map +1 -0
- package/dist/{aws/cdk/constructs/cloudwatch-construct.cjs → aws-cdk/constructs/cloudwatch.cjs} +2 -2
- package/dist/aws-cdk/constructs/cloudwatch.cjs.map +1 -0
- package/dist/{aws/cdk/constructs/cloudwatch-construct.d.ts → aws-cdk/constructs/cloudwatch.d.cts} +2 -1
- package/dist/{aws/cdk/constructs/cloudwatch-construct.d.cts → aws-cdk/constructs/cloudwatch.d.ts} +2 -1
- package/dist/{aws/cdk/constructs/cloudwatch-construct.js → aws-cdk/constructs/cloudwatch.js} +2 -2
- package/dist/aws-cdk/constructs/cloudwatch.js.map +1 -0
- package/dist/{aws/cdk/constructs/dynamo-db-construct.cjs → aws-cdk/constructs/dynamo-db.cjs} +2 -2
- package/dist/aws-cdk/constructs/dynamo-db.cjs.map +1 -0
- package/dist/{aws/cdk/constructs/dynamo-db-construct.d.ts → aws-cdk/constructs/dynamo-db.d.cts} +2 -1
- package/dist/{aws/cdk/constructs/dynamo-db-construct.d.cts → aws-cdk/constructs/dynamo-db.d.ts} +2 -1
- package/dist/{aws/cdk/constructs/dynamo-db-construct.js → aws-cdk/constructs/dynamo-db.js} +2 -2
- package/dist/aws-cdk/constructs/dynamo-db.js.map +1 -0
- package/dist/{aws/cdk/constructs/event-bridge-construct.cjs → aws-cdk/constructs/event-bridge.cjs} +2 -2
- package/dist/aws-cdk/constructs/event-bridge.cjs.map +1 -0
- package/dist/{aws/cdk/constructs/event-bridge-construct.d.ts → aws-cdk/constructs/event-bridge.d.cts} +2 -1
- package/dist/{aws/cdk/constructs/event-bridge-construct.d.cts → aws-cdk/constructs/event-bridge.d.ts} +2 -1
- package/dist/{aws/cdk/constructs/event-bridge-construct.js → aws-cdk/constructs/event-bridge.js} +2 -2
- package/dist/aws-cdk/constructs/event-bridge.js.map +1 -0
- package/dist/{aws/cdk/constructs/lambda-authorizer-v2-construct.cjs → aws-cdk/constructs/lambda-authorizer-v2.cjs} +6 -3
- package/dist/aws-cdk/constructs/lambda-authorizer-v2.cjs.map +1 -0
- package/dist/{aws/cdk/constructs/lambda-authorizer-v2-construct.d.ts → aws-cdk/constructs/lambda-authorizer-v2.d.cts} +2 -1
- package/dist/{aws/cdk/constructs/lambda-authorizer-v2-construct.d.cts → aws-cdk/constructs/lambda-authorizer-v2.d.ts} +2 -1
- package/dist/{aws/cdk/constructs/lambda-authorizer-v2-construct.js → aws-cdk/constructs/lambda-authorizer-v2.js} +6 -3
- package/dist/aws-cdk/constructs/lambda-authorizer-v2.js.map +1 -0
- package/dist/{aws/cdk/constructs/lambda-authorizer-construct.cjs → aws-cdk/constructs/lambda-authorizer.cjs} +2 -2
- package/dist/aws-cdk/constructs/lambda-authorizer.cjs.map +1 -0
- package/dist/{aws/cdk/constructs/lambda-authorizer-construct.d.cts → aws-cdk/constructs/lambda-authorizer.d.cts} +2 -1
- package/dist/{aws/cdk/constructs/lambda-authorizer-construct.d.ts → aws-cdk/constructs/lambda-authorizer.d.ts} +2 -1
- package/dist/{aws/cdk/constructs/lambda-authorizer-construct.js → aws-cdk/constructs/lambda-authorizer.js} +2 -2
- package/dist/aws-cdk/constructs/lambda-authorizer.js.map +1 -0
- package/dist/{aws/cdk/constructs/lambda-layer-construct.cjs → aws-cdk/constructs/lambda-layer.cjs} +3 -6
- package/dist/aws-cdk/constructs/lambda-layer.cjs.map +1 -0
- package/dist/{aws/cdk/constructs/lambda-layer-construct.d.ts → aws-cdk/constructs/lambda-layer.d.cts} +2 -1
- package/dist/{aws/cdk/constructs/lambda-layer-construct.d.cts → aws-cdk/constructs/lambda-layer.d.ts} +2 -1
- package/dist/{aws/cdk/constructs/lambda-layer-construct.js → aws-cdk/constructs/lambda-layer.js} +3 -6
- package/dist/aws-cdk/constructs/lambda-layer.js.map +1 -0
- package/dist/{aws/cdk/constructs/lambda-construct.cjs → aws-cdk/constructs/lambda.cjs} +4 -4
- package/dist/aws-cdk/constructs/lambda.cjs.map +1 -0
- package/dist/{aws/cdk/constructs/lambda-construct.d.ts → aws-cdk/constructs/lambda.d.cts} +2 -1
- package/dist/{aws/cdk/constructs/lambda-construct.d.cts → aws-cdk/constructs/lambda.d.ts} +2 -1
- package/dist/{aws/cdk/constructs/lambda-construct.js → aws-cdk/constructs/lambda.js} +4 -4
- package/dist/aws-cdk/constructs/lambda.js.map +1 -0
- package/dist/{aws/cdk/constructs/role-policy-construct.cjs → aws-cdk/constructs/role-policy.cjs} +2 -2
- package/dist/aws-cdk/constructs/role-policy.cjs.map +1 -0
- package/dist/{aws/cdk/constructs/role-policy-construct.d.ts → aws-cdk/constructs/role-policy.d.cts} +2 -1
- package/dist/{aws/cdk/constructs/role-policy-construct.d.cts → aws-cdk/constructs/role-policy.d.ts} +2 -1
- package/dist/{aws/cdk/constructs/role-policy-construct.js → aws-cdk/constructs/role-policy.js} +2 -2
- package/dist/aws-cdk/constructs/role-policy.js.map +1 -0
- package/dist/aws-cdk/constructs/route53.cjs +79 -0
- package/dist/aws-cdk/constructs/route53.cjs.map +1 -0
- package/dist/aws-cdk/constructs/route53.d.cts +95 -0
- package/dist/aws-cdk/constructs/route53.d.ts +95 -0
- package/dist/aws-cdk/constructs/route53.js +77 -0
- package/dist/aws-cdk/constructs/route53.js.map +1 -0
- package/dist/{aws/cdk/constructs/s3-deployment-construct.cjs → aws-cdk/constructs/s3-deployment.cjs} +20 -11
- package/dist/aws-cdk/constructs/s3-deployment.cjs.map +1 -0
- package/dist/{aws/cdk/constructs/s3-deployment-construct.d.ts → aws-cdk/constructs/s3-deployment.d.cts} +2 -1
- package/dist/{aws/cdk/constructs/s3-deployment-construct.d.cts → aws-cdk/constructs/s3-deployment.d.ts} +2 -1
- package/dist/{aws/cdk/constructs/s3-deployment-construct.js → aws-cdk/constructs/s3-deployment.js} +20 -11
- package/dist/aws-cdk/constructs/s3-deployment.js.map +1 -0
- package/dist/{aws/cdk/constructs/s3-construct.cjs → aws-cdk/constructs/s3.cjs} +2 -2
- package/dist/aws-cdk/constructs/s3.cjs.map +1 -0
- package/dist/{aws/cdk/constructs/s3-construct.d.ts → aws-cdk/constructs/s3.d.cts} +2 -1
- package/dist/{aws/cdk/constructs/s3-construct.d.cts → aws-cdk/constructs/s3.d.ts} +2 -1
- package/dist/{aws/cdk/constructs/s3-construct.js → aws-cdk/constructs/s3.js} +2 -2
- package/dist/aws-cdk/constructs/s3.js.map +1 -0
- package/dist/{aws/cdk/constructs/sns-construct.cjs → aws-cdk/constructs/sns.cjs} +2 -2
- package/dist/aws-cdk/constructs/sns.cjs.map +1 -0
- package/dist/{aws/cdk/constructs/sns-construct.d.ts → aws-cdk/constructs/sns.d.cts} +2 -1
- package/dist/{aws/cdk/constructs/sns-construct.d.cts → aws-cdk/constructs/sns.d.ts} +2 -1
- package/dist/{aws/cdk/constructs/sns-construct.js → aws-cdk/constructs/sns.js} +2 -2
- package/dist/aws-cdk/constructs/sns.js.map +1 -0
- package/dist/{aws/cdk/constructs/sqs-construct.cjs → aws-cdk/constructs/sqs.cjs} +2 -2
- package/dist/aws-cdk/constructs/sqs.cjs.map +1 -0
- package/dist/{aws/cdk/constructs/sqs-construct.d.ts → aws-cdk/constructs/sqs.d.cts} +2 -1
- package/dist/{aws/cdk/constructs/sqs-construct.d.cts → aws-cdk/constructs/sqs.d.ts} +2 -1
- package/dist/{aws/cdk/constructs/sqs-construct.js → aws-cdk/constructs/sqs.js} +2 -2
- package/dist/aws-cdk/constructs/sqs.js.map +1 -0
- package/dist/{aws/cdk/constructs/vpc-construct.cjs → aws-cdk/constructs/vpc.cjs} +2 -2
- package/dist/aws-cdk/constructs/vpc.cjs.map +1 -0
- package/dist/{aws/cdk/constructs/vpc-construct.d.ts → aws-cdk/constructs/vpc.d.cts} +2 -1
- package/dist/{aws/cdk/constructs/vpc-construct.d.cts → aws-cdk/constructs/vpc.d.ts} +2 -1
- package/dist/{aws/cdk/constructs/vpc-construct.js → aws-cdk/constructs/vpc.js} +2 -2
- package/dist/aws-cdk/constructs/vpc.js.map +1 -0
- package/dist/aws-cdk/stacks/lambda-api.cjs +252 -0
- package/dist/aws-cdk/stacks/lambda-api.cjs.map +1 -0
- package/dist/aws-cdk/stacks/lambda-api.d.cts +16 -0
- package/dist/aws-cdk/stacks/lambda-api.d.ts +16 -0
- package/dist/aws-cdk/stacks/lambda-api.js +250 -0
- package/dist/aws-cdk/stacks/lambda-api.js.map +1 -0
- package/dist/aws-cdk/stacks/lambda-sns.cjs +211 -0
- package/dist/aws-cdk/stacks/lambda-sns.cjs.map +1 -0
- package/dist/aws-cdk/stacks/lambda-sns.d.cts +17 -0
- package/dist/aws-cdk/stacks/lambda-sns.d.ts +17 -0
- package/dist/aws-cdk/stacks/lambda-sns.js +209 -0
- package/dist/aws-cdk/stacks/lambda-sns.js.map +1 -0
- package/dist/aws-cdk/stacks/lambda-sqs.cjs +220 -0
- package/dist/aws-cdk/stacks/lambda-sqs.cjs.map +1 -0
- package/dist/aws-cdk/stacks/lambda-sqs.d.cts +18 -0
- package/dist/aws-cdk/stacks/lambda-sqs.d.ts +18 -0
- package/dist/aws-cdk/stacks/lambda-sqs.js +218 -0
- package/dist/aws-cdk/stacks/lambda-sqs.js.map +1 -0
- package/dist/aws-types.cjs +4 -0
- package/dist/aws-types.cjs.map +1 -0
- package/dist/aws-types.d.cts +55 -0
- package/dist/aws-types.d.ts +55 -0
- package/dist/aws-types.js +3 -0
- package/dist/aws-types.js.map +1 -0
- package/dist/{aws/cdk/constructs/index.cjs → aws.cjs} +244 -23
- package/dist/aws.cjs.map +1 -0
- package/dist/aws.d.cts +40 -0
- package/dist/aws.d.ts +40 -0
- package/dist/{aws/index.js → aws.js} +243 -26
- package/dist/aws.js.map +1 -0
- package/dist/index.cjs +242 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -18
- package/dist/index.d.ts +24 -18
- package/dist/index.js +241 -24
- package/dist/index.js.map +1 -1
- package/package.json +160 -25
- package/dist/aws/cdk/constructs/api-gateway-construct.cjs.map +0 -1
- package/dist/aws/cdk/constructs/api-gateway-construct.js.map +0 -1
- package/dist/aws/cdk/constructs/api-gateway-v2-construct.cjs.map +0 -1
- package/dist/aws/cdk/constructs/api-gateway-v2-construct.js.map +0 -1
- package/dist/aws/cdk/constructs/api-gateway-websocket-construct.cjs.map +0 -1
- package/dist/aws/cdk/constructs/api-gateway-websocket-construct.js.map +0 -1
- package/dist/aws/cdk/constructs/cloudfront-construct.cjs.map +0 -1
- package/dist/aws/cdk/constructs/cloudfront-construct.js.map +0 -1
- package/dist/aws/cdk/constructs/cloudwatch-construct.cjs.map +0 -1
- package/dist/aws/cdk/constructs/cloudwatch-construct.js.map +0 -1
- package/dist/aws/cdk/constructs/dynamo-db-construct.cjs.map +0 -1
- package/dist/aws/cdk/constructs/dynamo-db-construct.js.map +0 -1
- package/dist/aws/cdk/constructs/event-bridge-construct.cjs.map +0 -1
- package/dist/aws/cdk/constructs/event-bridge-construct.js.map +0 -1
- package/dist/aws/cdk/constructs/index.cjs.map +0 -1
- package/dist/aws/cdk/constructs/index.d.cts +0 -34
- package/dist/aws/cdk/constructs/index.d.ts +0 -34
- package/dist/aws/cdk/constructs/index.js +0 -863
- package/dist/aws/cdk/constructs/index.js.map +0 -1
- package/dist/aws/cdk/constructs/lambda-authorizer-construct.cjs.map +0 -1
- package/dist/aws/cdk/constructs/lambda-authorizer-construct.js.map +0 -1
- package/dist/aws/cdk/constructs/lambda-authorizer-v2-construct.cjs.map +0 -1
- package/dist/aws/cdk/constructs/lambda-authorizer-v2-construct.js.map +0 -1
- package/dist/aws/cdk/constructs/lambda-construct.cjs.map +0 -1
- package/dist/aws/cdk/constructs/lambda-construct.js.map +0 -1
- package/dist/aws/cdk/constructs/lambda-layer-construct.cjs.map +0 -1
- package/dist/aws/cdk/constructs/lambda-layer-construct.js.map +0 -1
- package/dist/aws/cdk/constructs/role-policy-construct.cjs.map +0 -1
- package/dist/aws/cdk/constructs/role-policy-construct.js.map +0 -1
- package/dist/aws/cdk/constructs/s3-construct.cjs.map +0 -1
- package/dist/aws/cdk/constructs/s3-construct.js.map +0 -1
- package/dist/aws/cdk/constructs/s3-deployment-construct.cjs.map +0 -1
- package/dist/aws/cdk/constructs/s3-deployment-construct.js.map +0 -1
- package/dist/aws/cdk/constructs/sns-construct.cjs.map +0 -1
- package/dist/aws/cdk/constructs/sns-construct.js.map +0 -1
- package/dist/aws/cdk/constructs/sqs-construct.cjs.map +0 -1
- package/dist/aws/cdk/constructs/sqs-construct.js.map +0 -1
- package/dist/aws/cdk/constructs/vpc-construct.cjs.map +0 -1
- package/dist/aws/cdk/constructs/vpc-construct.js.map +0 -1
- package/dist/aws/cdk/index.cjs +0 -881
- package/dist/aws/cdk/index.cjs.map +0 -1
- package/dist/aws/cdk/index.d.cts +0 -34
- package/dist/aws/cdk/index.d.ts +0 -34
- package/dist/aws/cdk/index.js +0 -863
- package/dist/aws/cdk/index.js.map +0 -1
- package/dist/aws/cli/index.cjs +0 -4
- package/dist/aws/cli/index.cjs.map +0 -1
- package/dist/aws/cli/index.d.cts +0 -2
- package/dist/aws/cli/index.d.ts +0 -2
- package/dist/aws/cli/index.js +0 -3
- package/dist/aws/cli/index.js.map +0 -1
- package/dist/aws/index.cjs +0 -881
- package/dist/aws/index.cjs.map +0 -1
- package/dist/aws/index.d.cts +0 -34
- package/dist/aws/index.d.ts +0 -34
- package/dist/aws/index.js.map +0 -1
- package/dist/aws/types/index.cjs +0 -4
- package/dist/aws/types/index.cjs.map +0 -1
- package/dist/aws/types/index.d.cts +0 -18
- package/dist/aws/types/index.d.ts +0 -18
- package/dist/aws/types/index.js +0 -3
- package/dist/aws/types/index.js.map +0 -1
- package/dist/lint/index.cjs +0 -4
- package/dist/lint/index.cjs.map +0 -1
- package/dist/lint/index.d.cts +0 -2
- package/dist/lint/index.d.ts +0 -2
- package/dist/lint/index.js +0 -3
- package/dist/lint/index.js.map +0 -1
- package/dist/prettier/index.cjs +0 -4
- package/dist/prettier/index.cjs.map +0 -1
- package/dist/prettier/index.d.cts +0 -2
- package/dist/prettier/index.d.ts +0 -2
- package/dist/prettier/index.js +0 -3
- package/dist/prettier/index.js.map +0 -1
- package/dist/utility/index.cjs +0 -4
- package/dist/utility/index.cjs.map +0 -1
- package/dist/utility/index.d.cts +0 -2
- package/dist/utility/index.d.ts +0 -2
- package/dist/utility/index.js +0 -3
- package/dist/utility/index.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -14,6 +14,7 @@ var awsEventsTargets = require('aws-cdk-lib/aws-events-targets');
|
|
|
14
14
|
var awsApigatewayv2Authorizers = require('aws-cdk-lib/aws-apigatewayv2-authorizers');
|
|
15
15
|
var awsLambda = require('aws-cdk-lib/aws-lambda');
|
|
16
16
|
var awsIam = require('aws-cdk-lib/aws-iam');
|
|
17
|
+
var awsRoute53 = require('aws-cdk-lib/aws-route53');
|
|
17
18
|
var awsS3 = require('aws-cdk-lib/aws-s3');
|
|
18
19
|
var awsCloudfrontOrigins = require('aws-cdk-lib/aws-cloudfront-origins');
|
|
19
20
|
var awsS3Deployment = require('aws-cdk-lib/aws-s3-deployment');
|
|
@@ -101,7 +102,10 @@ var BaseApiGatewayConstruct = class _BaseApiGatewayConstruct extends constructs.
|
|
|
101
102
|
this.addRoutes(resource, route.children, integration, currentPath);
|
|
102
103
|
}
|
|
103
104
|
if (this.enableDebug) {
|
|
104
|
-
toolkit.printLog(
|
|
105
|
+
toolkit.printLog(
|
|
106
|
+
_BaseApiGatewayConstruct.name,
|
|
107
|
+
`Route created: ${route.method} ${currentPath}`
|
|
108
|
+
);
|
|
105
109
|
}
|
|
106
110
|
});
|
|
107
111
|
}
|
|
@@ -189,27 +193,39 @@ var BaseApiGatewayWebSocketConstruct = class extends constructs.Construct {
|
|
|
189
193
|
*/
|
|
190
194
|
connectRouteOptions: {
|
|
191
195
|
...props.handlers.connect?.option,
|
|
192
|
-
integration: new awsApigatewayv2Integrations.WebSocketLambdaIntegration(
|
|
196
|
+
integration: new awsApigatewayv2Integrations.WebSocketLambdaIntegration(
|
|
197
|
+
"connectIntegration",
|
|
198
|
+
props.handlers.connect.function
|
|
199
|
+
)
|
|
193
200
|
},
|
|
194
201
|
/**
|
|
195
202
|
* Route for disconnection events ($disconnect)
|
|
196
203
|
*/
|
|
197
204
|
disconnectRouteOptions: {
|
|
198
205
|
...props.handlers.disconnect?.option,
|
|
199
|
-
integration: new awsApigatewayv2Integrations.WebSocketLambdaIntegration(
|
|
206
|
+
integration: new awsApigatewayv2Integrations.WebSocketLambdaIntegration(
|
|
207
|
+
"disconnectIntegration",
|
|
208
|
+
props.handlers.disconnect.function
|
|
209
|
+
)
|
|
200
210
|
},
|
|
201
211
|
/**
|
|
202
212
|
* Default route for unmatched messages ($default)
|
|
203
213
|
*/
|
|
204
214
|
defaultRouteOptions: {
|
|
205
215
|
...props.handlers.default?.option,
|
|
206
|
-
integration: new awsApigatewayv2Integrations.WebSocketLambdaIntegration(
|
|
216
|
+
integration: new awsApigatewayv2Integrations.WebSocketLambdaIntegration(
|
|
217
|
+
"defaultIntegration",
|
|
218
|
+
props.handlers.default.function
|
|
219
|
+
)
|
|
207
220
|
}
|
|
208
221
|
});
|
|
209
222
|
this.socketApi.addRoute("notifications", {
|
|
210
223
|
...props.handlers.message?.option,
|
|
211
224
|
/** Lambda integration for message handling */
|
|
212
|
-
integration: new awsApigatewayv2Integrations.WebSocketLambdaIntegration(
|
|
225
|
+
integration: new awsApigatewayv2Integrations.WebSocketLambdaIntegration(
|
|
226
|
+
"routes",
|
|
227
|
+
props.handlers.message.function
|
|
228
|
+
)
|
|
213
229
|
});
|
|
214
230
|
const webSocketStage = new awsApigatewayv2.WebSocketStage(this, `${id}_stage`, {
|
|
215
231
|
...props.options?.webSocketStageOptions,
|
|
@@ -495,7 +511,10 @@ var BaseLambdaAuthoriserV2Construct = class extends constructs.Construct {
|
|
|
495
511
|
* Supported response types for the authorizer
|
|
496
512
|
* Defaults to IAM and SIMPLE responses
|
|
497
513
|
*/
|
|
498
|
-
responseTypes: props?.options?.authorizerOptions?.responseTypes || [
|
|
514
|
+
responseTypes: props?.options?.authorizerOptions?.responseTypes || [
|
|
515
|
+
awsApigatewayv2Authorizers.HttpLambdaResponseType.IAM,
|
|
516
|
+
awsApigatewayv2Authorizers.HttpLambdaResponseType.SIMPLE
|
|
517
|
+
]
|
|
499
518
|
});
|
|
500
519
|
new awsCdkLib.CfnOutput(this, "LambdaAuthorizerV2_ID", {
|
|
501
520
|
value: this.authoriser.authorizerId
|
|
@@ -526,9 +545,9 @@ var BaseLambdaConstruct = class extends constructs.Construct {
|
|
|
526
545
|
...props?.options?.lambdaOptions,
|
|
527
546
|
/**
|
|
528
547
|
* Lambda function name
|
|
529
|
-
* Defaults to "<stackName
|
|
548
|
+
* Defaults to "<stackName>" if not provided
|
|
530
549
|
*/
|
|
531
|
-
functionName: `${props?.options?.lambdaOptions?.functionName || props?.stackName}
|
|
550
|
+
functionName: `${props?.options?.lambdaOptions?.functionName || props?.stackName}`,
|
|
532
551
|
/**
|
|
533
552
|
* Function description
|
|
534
553
|
*/
|
|
@@ -612,10 +631,7 @@ var BaseLambdaLayerConstruct = class extends constructs.Construct {
|
|
|
612
631
|
/**
|
|
613
632
|
* Supported CPU architectures
|
|
614
633
|
*/
|
|
615
|
-
compatibleArchitectures: [
|
|
616
|
-
awsLambda.Architecture.ARM_64,
|
|
617
|
-
awsLambda.Architecture.X86_64
|
|
618
|
-
],
|
|
634
|
+
compatibleArchitectures: [awsLambda.Architecture.ARM_64, awsLambda.Architecture.X86_64],
|
|
619
635
|
/**
|
|
620
636
|
* Supported runtimes
|
|
621
637
|
*/
|
|
@@ -672,6 +688,72 @@ var BaseRolePolicyConstruct = class extends constructs.Construct {
|
|
|
672
688
|
});
|
|
673
689
|
}
|
|
674
690
|
};
|
|
691
|
+
var BaseRoute53Construct = class extends constructs.Construct {
|
|
692
|
+
static {
|
|
693
|
+
__name(this, "BaseRoute53Construct");
|
|
694
|
+
}
|
|
695
|
+
/** The hosted zone this construct created, imported, or looked up */
|
|
696
|
+
hostedZone;
|
|
697
|
+
/**
|
|
698
|
+
* @param scope Parent construct
|
|
699
|
+
* @param id Unique construct identifier
|
|
700
|
+
* @param props Configuration for the hosted zone and its records
|
|
701
|
+
*/
|
|
702
|
+
constructor(scope, id, props) {
|
|
703
|
+
super(scope, id);
|
|
704
|
+
const options = props?.options ?? {};
|
|
705
|
+
if (options.hostedZoneOptions) {
|
|
706
|
+
this.hostedZone = new awsRoute53.HostedZone(
|
|
707
|
+
this,
|
|
708
|
+
`${id}-HostedZone`,
|
|
709
|
+
options.hostedZoneOptions
|
|
710
|
+
);
|
|
711
|
+
} else if (options.fromExistingHostedZoneAttributes) {
|
|
712
|
+
this.hostedZone = awsRoute53.HostedZone.fromHostedZoneAttributes(
|
|
713
|
+
this,
|
|
714
|
+
`${id}-HostedZone`,
|
|
715
|
+
options.fromExistingHostedZoneAttributes
|
|
716
|
+
);
|
|
717
|
+
} else if (options.fromLookupOptions) {
|
|
718
|
+
this.hostedZone = awsRoute53.HostedZone.fromLookup(
|
|
719
|
+
this,
|
|
720
|
+
`${id}-HostedZone`,
|
|
721
|
+
options.fromLookupOptions
|
|
722
|
+
);
|
|
723
|
+
} else {
|
|
724
|
+
throw new toolkit.CustomException(
|
|
725
|
+
"BaseRoute53Construct requires one of hostedZoneOptions, fromExistingHostedZoneAttributes, or fromLookupOptions"
|
|
726
|
+
);
|
|
727
|
+
}
|
|
728
|
+
options.aRecords?.forEach((record, index) => {
|
|
729
|
+
new awsRoute53.ARecord(this, `${id}-ARecord-${index}`, {
|
|
730
|
+
...record,
|
|
731
|
+
zone: this.hostedZone
|
|
732
|
+
});
|
|
733
|
+
});
|
|
734
|
+
options.aaaaRecords?.forEach((record, index) => {
|
|
735
|
+
new awsRoute53.AaaaRecord(this, `${id}-AaaaRecord-${index}`, {
|
|
736
|
+
...record,
|
|
737
|
+
zone: this.hostedZone
|
|
738
|
+
});
|
|
739
|
+
});
|
|
740
|
+
options.cnameRecords?.forEach((record, index) => {
|
|
741
|
+
new awsRoute53.CnameRecord(this, `${id}-CnameRecord-${index}`, {
|
|
742
|
+
...record,
|
|
743
|
+
zone: this.hostedZone
|
|
744
|
+
});
|
|
745
|
+
});
|
|
746
|
+
options.txtRecords?.forEach((record, index) => {
|
|
747
|
+
new awsRoute53.TxtRecord(this, `${id}-TxtRecord-${index}`, {
|
|
748
|
+
...record,
|
|
749
|
+
zone: this.hostedZone
|
|
750
|
+
});
|
|
751
|
+
});
|
|
752
|
+
new awsCdkLib.CfnOutput(this, "Route53HostedZoneId", {
|
|
753
|
+
value: this.hostedZone.hostedZoneId
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
};
|
|
675
757
|
var BaseS3Construct = class extends constructs.Construct {
|
|
676
758
|
static {
|
|
677
759
|
__name(this, "BaseS3Construct");
|
|
@@ -716,10 +798,14 @@ var BaseS3DeploymentConstruct = class extends constructs.Construct {
|
|
|
716
798
|
constructor(scope, id, props) {
|
|
717
799
|
super(scope, id);
|
|
718
800
|
if (!props.options?.cloudfrontOptions?.defaultBehavior?.origin && !props?.withS3Bucket && props.withCloudfront) {
|
|
719
|
-
throw new toolkit.CustomException(
|
|
801
|
+
throw new toolkit.CustomException(
|
|
802
|
+
"Cloudfront distribution S3_Bucket origins must be defined!"
|
|
803
|
+
);
|
|
720
804
|
}
|
|
721
805
|
if (!props.options?.bucketDeploymentOptions?.destinationBucket && !props?.withS3Bucket) {
|
|
722
|
-
throw new toolkit.CustomException(
|
|
806
|
+
throw new toolkit.CustomException(
|
|
807
|
+
"Deployment S3_Bucket destination must be defined!"
|
|
808
|
+
);
|
|
723
809
|
}
|
|
724
810
|
if (props?.withS3Bucket) {
|
|
725
811
|
this.bucket = new BaseS3Construct(this, "bucket", {
|
|
@@ -737,13 +823,18 @@ var BaseS3DeploymentConstruct = class extends constructs.Construct {
|
|
|
737
823
|
/**
|
|
738
824
|
* Map additional behaviors and ensure origin is assigned
|
|
739
825
|
*/
|
|
740
|
-
additionalBehaviors: Object.entries(
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
826
|
+
additionalBehaviors: Object.entries(
|
|
827
|
+
props.options?.cloudfrontOptions?.additionalBehaviors || {}
|
|
828
|
+
).reduce(
|
|
829
|
+
(behavior, [pattern, behaviorOptions]) => {
|
|
830
|
+
behavior[pattern] = {
|
|
831
|
+
...behaviorOptions,
|
|
832
|
+
origin: behaviorOptions.origin || s3Origin
|
|
833
|
+
};
|
|
834
|
+
return behavior;
|
|
835
|
+
},
|
|
836
|
+
{}
|
|
837
|
+
),
|
|
747
838
|
/**
|
|
748
839
|
* Default behavior configuration
|
|
749
840
|
*/
|
|
@@ -859,6 +950,132 @@ var BaseVpcConstruct = class extends constructs.Construct {
|
|
|
859
950
|
});
|
|
860
951
|
}
|
|
861
952
|
};
|
|
953
|
+
var BaseLambdaApiStack = class extends awsCdkLib.Stack {
|
|
954
|
+
static {
|
|
955
|
+
__name(this, "BaseLambdaApiStack");
|
|
956
|
+
}
|
|
957
|
+
constructor(scope, id, props) {
|
|
958
|
+
super(scope, id, props);
|
|
959
|
+
let layers = [];
|
|
960
|
+
if (props?.stackOptions?.layerOptions) {
|
|
961
|
+
if (!props.stackOptions?.layerOptions?.name || !props.stackOptions?.layerOptions?.version) {
|
|
962
|
+
throw new toolkit.CustomException("Invalid layer options provided! Both layer 'name' and 'version' are required.");
|
|
963
|
+
}
|
|
964
|
+
const { existingLayer } = new BaseLambdaLayerConstruct(
|
|
965
|
+
this,
|
|
966
|
+
"layer",
|
|
967
|
+
{
|
|
968
|
+
options: {
|
|
969
|
+
fromExistingLayerArn: `arn:aws:lambda:${props.env?.region}:${props.env?.account}:layer:${props.stackOptions?.layerOptions?.name}:${props.stackOptions?.layerOptions?.version}`
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
);
|
|
973
|
+
layers.push(existingLayer);
|
|
974
|
+
}
|
|
975
|
+
const { function: lambdaFunction } = new BaseLambdaConstruct(this, "lambda", {
|
|
976
|
+
stage: props.stackOptions?.stage,
|
|
977
|
+
stackName: props.stackName,
|
|
978
|
+
options: {
|
|
979
|
+
lambdaOptions: { layers }
|
|
980
|
+
}
|
|
981
|
+
});
|
|
982
|
+
new BaseApiGatewayV2Construct(this, "apiGateway", {
|
|
983
|
+
handlerFunctions: [lambdaFunction],
|
|
984
|
+
options: {
|
|
985
|
+
gatewayOptions: {
|
|
986
|
+
apiName: props.stackName,
|
|
987
|
+
corsPreflight: {
|
|
988
|
+
allowOrigins: ["*"]
|
|
989
|
+
}
|
|
990
|
+
},
|
|
991
|
+
routeOptions: [
|
|
992
|
+
{
|
|
993
|
+
path: "/{proxy+}",
|
|
994
|
+
methods: [awsApigatewayv2.HttpMethod.ANY]
|
|
995
|
+
}
|
|
996
|
+
]
|
|
997
|
+
}
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
};
|
|
1001
|
+
var BaseLambdaSqsStack = class extends awsCdkLib.Stack {
|
|
1002
|
+
static {
|
|
1003
|
+
__name(this, "BaseLambdaSqsStack");
|
|
1004
|
+
}
|
|
1005
|
+
constructor(scope, id, props) {
|
|
1006
|
+
super(scope, id, props);
|
|
1007
|
+
let layers = [];
|
|
1008
|
+
if (props?.stackOptions?.layerOptions) {
|
|
1009
|
+
if (!props.stackOptions?.layerOptions?.name || !props.stackOptions?.layerOptions?.version) {
|
|
1010
|
+
throw new toolkit.CustomException("Invalid layer options provided");
|
|
1011
|
+
}
|
|
1012
|
+
const { existingLayer } = new BaseLambdaLayerConstruct(
|
|
1013
|
+
this,
|
|
1014
|
+
"layer",
|
|
1015
|
+
{
|
|
1016
|
+
options: {
|
|
1017
|
+
fromExistingLayerArn: `arn:aws:lambda:${props.env?.region}:${props.env?.account}:layer:${props.stackOptions?.layerOptions?.name}:${props.stackOptions?.layerOptions?.version}`
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
);
|
|
1021
|
+
layers.push(existingLayer);
|
|
1022
|
+
}
|
|
1023
|
+
const { function: lambdaFunction } = new BaseLambdaConstruct(this, "lambda", {
|
|
1024
|
+
stage: props.stackOptions?.stage,
|
|
1025
|
+
stackName: props.stackName,
|
|
1026
|
+
options: {
|
|
1027
|
+
lambdaOptions: { layers }
|
|
1028
|
+
}
|
|
1029
|
+
});
|
|
1030
|
+
new BaseSqsConstruct(this, "sqs", {
|
|
1031
|
+
targetFunctions: [lambdaFunction],
|
|
1032
|
+
options: {
|
|
1033
|
+
eventSourceMappingOptions: {},
|
|
1034
|
+
queueOptions: {}
|
|
1035
|
+
}
|
|
1036
|
+
});
|
|
1037
|
+
}
|
|
1038
|
+
};
|
|
1039
|
+
var BaseLambdaSnsStack = class extends awsCdkLib.Stack {
|
|
1040
|
+
static {
|
|
1041
|
+
__name(this, "BaseLambdaSnsStack");
|
|
1042
|
+
}
|
|
1043
|
+
constructor(scope, id, props) {
|
|
1044
|
+
super(scope, id, props);
|
|
1045
|
+
let layers = [];
|
|
1046
|
+
if (props?.stackOptions?.layerOptions) {
|
|
1047
|
+
if (!props.stackOptions?.layerOptions?.name || !props.stackOptions?.layerOptions?.version) {
|
|
1048
|
+
throw new toolkit.CustomException("Invalid layer options provided");
|
|
1049
|
+
}
|
|
1050
|
+
const { existingLayer } = new BaseLambdaLayerConstruct(
|
|
1051
|
+
this,
|
|
1052
|
+
"layer",
|
|
1053
|
+
{
|
|
1054
|
+
options: {
|
|
1055
|
+
fromExistingLayerArn: `arn:aws:lambda:${props.env?.region}:${props.env?.account}:layer:${props.stackOptions?.layerOptions?.name}:${props.stackOptions?.layerOptions?.version}`
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
);
|
|
1059
|
+
layers.push(existingLayer);
|
|
1060
|
+
}
|
|
1061
|
+
const { function: lambdaFunction } = new BaseLambdaConstruct(this, "lambda", {
|
|
1062
|
+
stage: props.stackOptions?.stage,
|
|
1063
|
+
stackName: props.stackName,
|
|
1064
|
+
options: {
|
|
1065
|
+
lambdaOptions: { layers }
|
|
1066
|
+
}
|
|
1067
|
+
});
|
|
1068
|
+
new BaseSnsConstruct(this, "sns", {
|
|
1069
|
+
options: {
|
|
1070
|
+
targetFunctions: [lambdaFunction],
|
|
1071
|
+
topicOptions: {
|
|
1072
|
+
...props?.stackOptions?.topicOptions,
|
|
1073
|
+
topicName: props?.stackOptions?.topicOptions?.topicName || props.stackName
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
});
|
|
1077
|
+
}
|
|
1078
|
+
};
|
|
862
1079
|
|
|
863
1080
|
exports.BaseApiGatewayConstruct = BaseApiGatewayConstruct;
|
|
864
1081
|
exports.BaseApiGatewayV2Construct = BaseApiGatewayV2Construct;
|
|
@@ -867,11 +1084,15 @@ exports.BaseCloudfrontConstruct = BaseCloudfrontConstruct;
|
|
|
867
1084
|
exports.BaseCloudwatchLogGroupConstruct = BaseCloudwatchLogGroupConstruct;
|
|
868
1085
|
exports.BaseDynamoDBConstruct = BaseDynamoDBConstruct;
|
|
869
1086
|
exports.BaseEventBridgeConstruct = BaseEventBridgeConstruct;
|
|
1087
|
+
exports.BaseLambdaApiStack = BaseLambdaApiStack;
|
|
870
1088
|
exports.BaseLambdaAuthoriserConstruct = BaseLambdaAuthoriserConstruct;
|
|
871
1089
|
exports.BaseLambdaAuthoriserV2Construct = BaseLambdaAuthoriserV2Construct;
|
|
872
1090
|
exports.BaseLambdaConstruct = BaseLambdaConstruct;
|
|
873
1091
|
exports.BaseLambdaLayerConstruct = BaseLambdaLayerConstruct;
|
|
1092
|
+
exports.BaseLambdaSnsStack = BaseLambdaSnsStack;
|
|
1093
|
+
exports.BaseLambdaSqsStack = BaseLambdaSqsStack;
|
|
874
1094
|
exports.BaseRolePolicyConstruct = BaseRolePolicyConstruct;
|
|
1095
|
+
exports.BaseRoute53Construct = BaseRoute53Construct;
|
|
875
1096
|
exports.BaseS3Construct = BaseS3Construct;
|
|
876
1097
|
exports.BaseS3DeploymentConstruct = BaseS3DeploymentConstruct;
|
|
877
1098
|
exports.BaseSnsConstruct = BaseSnsConstruct;
|