@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.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Construct } from 'constructs';
|
|
2
|
-
import { Size, RemovalPolicy, CfnOutput, Duration } from 'aws-cdk-lib';
|
|
2
|
+
import { Size, RemovalPolicy, CfnOutput, Duration, Stack } from 'aws-cdk-lib';
|
|
3
3
|
import { RestApi, Cors, LambdaIntegration, TokenAuthorizer } from 'aws-cdk-lib/aws-apigateway';
|
|
4
4
|
import { printLog, CustomException, detectDuplicateProperties, AppEnvironmentEnum } from '@incloodsolutions/toolkit';
|
|
5
5
|
import { HttpLambdaIntegration, WebSocketLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
|
|
6
|
-
import { HttpApi, CorsHttpMethod, WebSocketApi, WebSocketStage } from 'aws-cdk-lib/aws-apigatewayv2';
|
|
6
|
+
import { HttpApi, CorsHttpMethod, WebSocketApi, WebSocketStage, HttpMethod } from 'aws-cdk-lib/aws-apigatewayv2';
|
|
7
7
|
import { Distribution, ViewerProtocolPolicy } from 'aws-cdk-lib/aws-cloudfront';
|
|
8
8
|
import { LogGroup, RetentionDays } from 'aws-cdk-lib/aws-logs';
|
|
9
9
|
import { Table, BillingMode } from 'aws-cdk-lib/aws-dynamodb';
|
|
@@ -12,6 +12,7 @@ import { LambdaFunction } from 'aws-cdk-lib/aws-events-targets';
|
|
|
12
12
|
import { HttpLambdaAuthorizer, HttpLambdaResponseType } from 'aws-cdk-lib/aws-apigatewayv2-authorizers';
|
|
13
13
|
import { Function, Architecture, Runtime, Code, LayerVersion, EventSourceMapping } from 'aws-cdk-lib/aws-lambda';
|
|
14
14
|
import { Role, ManagedPolicy, PolicyStatement } from 'aws-cdk-lib/aws-iam';
|
|
15
|
+
import { HostedZone, ARecord, AaaaRecord, CnameRecord, TxtRecord } from 'aws-cdk-lib/aws-route53';
|
|
15
16
|
import { Bucket } from 'aws-cdk-lib/aws-s3';
|
|
16
17
|
import { S3BucketOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
|
|
17
18
|
import { BucketDeployment } from 'aws-cdk-lib/aws-s3-deployment';
|
|
@@ -99,7 +100,10 @@ var BaseApiGatewayConstruct = class _BaseApiGatewayConstruct extends Construct {
|
|
|
99
100
|
this.addRoutes(resource, route.children, integration, currentPath);
|
|
100
101
|
}
|
|
101
102
|
if (this.enableDebug) {
|
|
102
|
-
printLog(
|
|
103
|
+
printLog(
|
|
104
|
+
_BaseApiGatewayConstruct.name,
|
|
105
|
+
`Route created: ${route.method} ${currentPath}`
|
|
106
|
+
);
|
|
103
107
|
}
|
|
104
108
|
});
|
|
105
109
|
}
|
|
@@ -187,27 +191,39 @@ var BaseApiGatewayWebSocketConstruct = class extends Construct {
|
|
|
187
191
|
*/
|
|
188
192
|
connectRouteOptions: {
|
|
189
193
|
...props.handlers.connect?.option,
|
|
190
|
-
integration: new WebSocketLambdaIntegration(
|
|
194
|
+
integration: new WebSocketLambdaIntegration(
|
|
195
|
+
"connectIntegration",
|
|
196
|
+
props.handlers.connect.function
|
|
197
|
+
)
|
|
191
198
|
},
|
|
192
199
|
/**
|
|
193
200
|
* Route for disconnection events ($disconnect)
|
|
194
201
|
*/
|
|
195
202
|
disconnectRouteOptions: {
|
|
196
203
|
...props.handlers.disconnect?.option,
|
|
197
|
-
integration: new WebSocketLambdaIntegration(
|
|
204
|
+
integration: new WebSocketLambdaIntegration(
|
|
205
|
+
"disconnectIntegration",
|
|
206
|
+
props.handlers.disconnect.function
|
|
207
|
+
)
|
|
198
208
|
},
|
|
199
209
|
/**
|
|
200
210
|
* Default route for unmatched messages ($default)
|
|
201
211
|
*/
|
|
202
212
|
defaultRouteOptions: {
|
|
203
213
|
...props.handlers.default?.option,
|
|
204
|
-
integration: new WebSocketLambdaIntegration(
|
|
214
|
+
integration: new WebSocketLambdaIntegration(
|
|
215
|
+
"defaultIntegration",
|
|
216
|
+
props.handlers.default.function
|
|
217
|
+
)
|
|
205
218
|
}
|
|
206
219
|
});
|
|
207
220
|
this.socketApi.addRoute("notifications", {
|
|
208
221
|
...props.handlers.message?.option,
|
|
209
222
|
/** Lambda integration for message handling */
|
|
210
|
-
integration: new WebSocketLambdaIntegration(
|
|
223
|
+
integration: new WebSocketLambdaIntegration(
|
|
224
|
+
"routes",
|
|
225
|
+
props.handlers.message.function
|
|
226
|
+
)
|
|
211
227
|
});
|
|
212
228
|
const webSocketStage = new WebSocketStage(this, `${id}_stage`, {
|
|
213
229
|
...props.options?.webSocketStageOptions,
|
|
@@ -493,7 +509,10 @@ var BaseLambdaAuthoriserV2Construct = class extends Construct {
|
|
|
493
509
|
* Supported response types for the authorizer
|
|
494
510
|
* Defaults to IAM and SIMPLE responses
|
|
495
511
|
*/
|
|
496
|
-
responseTypes: props?.options?.authorizerOptions?.responseTypes || [
|
|
512
|
+
responseTypes: props?.options?.authorizerOptions?.responseTypes || [
|
|
513
|
+
HttpLambdaResponseType.IAM,
|
|
514
|
+
HttpLambdaResponseType.SIMPLE
|
|
515
|
+
]
|
|
497
516
|
});
|
|
498
517
|
new CfnOutput(this, "LambdaAuthorizerV2_ID", {
|
|
499
518
|
value: this.authoriser.authorizerId
|
|
@@ -524,9 +543,9 @@ var BaseLambdaConstruct = class extends Construct {
|
|
|
524
543
|
...props?.options?.lambdaOptions,
|
|
525
544
|
/**
|
|
526
545
|
* Lambda function name
|
|
527
|
-
* Defaults to "<stackName
|
|
546
|
+
* Defaults to "<stackName>" if not provided
|
|
528
547
|
*/
|
|
529
|
-
functionName: `${props?.options?.lambdaOptions?.functionName || props?.stackName}
|
|
548
|
+
functionName: `${props?.options?.lambdaOptions?.functionName || props?.stackName}`,
|
|
530
549
|
/**
|
|
531
550
|
* Function description
|
|
532
551
|
*/
|
|
@@ -610,10 +629,7 @@ var BaseLambdaLayerConstruct = class extends Construct {
|
|
|
610
629
|
/**
|
|
611
630
|
* Supported CPU architectures
|
|
612
631
|
*/
|
|
613
|
-
compatibleArchitectures: [
|
|
614
|
-
Architecture.ARM_64,
|
|
615
|
-
Architecture.X86_64
|
|
616
|
-
],
|
|
632
|
+
compatibleArchitectures: [Architecture.ARM_64, Architecture.X86_64],
|
|
617
633
|
/**
|
|
618
634
|
* Supported runtimes
|
|
619
635
|
*/
|
|
@@ -670,6 +686,72 @@ var BaseRolePolicyConstruct = class extends Construct {
|
|
|
670
686
|
});
|
|
671
687
|
}
|
|
672
688
|
};
|
|
689
|
+
var BaseRoute53Construct = class extends Construct {
|
|
690
|
+
static {
|
|
691
|
+
__name(this, "BaseRoute53Construct");
|
|
692
|
+
}
|
|
693
|
+
/** The hosted zone this construct created, imported, or looked up */
|
|
694
|
+
hostedZone;
|
|
695
|
+
/**
|
|
696
|
+
* @param scope Parent construct
|
|
697
|
+
* @param id Unique construct identifier
|
|
698
|
+
* @param props Configuration for the hosted zone and its records
|
|
699
|
+
*/
|
|
700
|
+
constructor(scope, id, props) {
|
|
701
|
+
super(scope, id);
|
|
702
|
+
const options = props?.options ?? {};
|
|
703
|
+
if (options.hostedZoneOptions) {
|
|
704
|
+
this.hostedZone = new HostedZone(
|
|
705
|
+
this,
|
|
706
|
+
`${id}-HostedZone`,
|
|
707
|
+
options.hostedZoneOptions
|
|
708
|
+
);
|
|
709
|
+
} else if (options.fromExistingHostedZoneAttributes) {
|
|
710
|
+
this.hostedZone = HostedZone.fromHostedZoneAttributes(
|
|
711
|
+
this,
|
|
712
|
+
`${id}-HostedZone`,
|
|
713
|
+
options.fromExistingHostedZoneAttributes
|
|
714
|
+
);
|
|
715
|
+
} else if (options.fromLookupOptions) {
|
|
716
|
+
this.hostedZone = HostedZone.fromLookup(
|
|
717
|
+
this,
|
|
718
|
+
`${id}-HostedZone`,
|
|
719
|
+
options.fromLookupOptions
|
|
720
|
+
);
|
|
721
|
+
} else {
|
|
722
|
+
throw new CustomException(
|
|
723
|
+
"BaseRoute53Construct requires one of hostedZoneOptions, fromExistingHostedZoneAttributes, or fromLookupOptions"
|
|
724
|
+
);
|
|
725
|
+
}
|
|
726
|
+
options.aRecords?.forEach((record, index) => {
|
|
727
|
+
new ARecord(this, `${id}-ARecord-${index}`, {
|
|
728
|
+
...record,
|
|
729
|
+
zone: this.hostedZone
|
|
730
|
+
});
|
|
731
|
+
});
|
|
732
|
+
options.aaaaRecords?.forEach((record, index) => {
|
|
733
|
+
new AaaaRecord(this, `${id}-AaaaRecord-${index}`, {
|
|
734
|
+
...record,
|
|
735
|
+
zone: this.hostedZone
|
|
736
|
+
});
|
|
737
|
+
});
|
|
738
|
+
options.cnameRecords?.forEach((record, index) => {
|
|
739
|
+
new CnameRecord(this, `${id}-CnameRecord-${index}`, {
|
|
740
|
+
...record,
|
|
741
|
+
zone: this.hostedZone
|
|
742
|
+
});
|
|
743
|
+
});
|
|
744
|
+
options.txtRecords?.forEach((record, index) => {
|
|
745
|
+
new TxtRecord(this, `${id}-TxtRecord-${index}`, {
|
|
746
|
+
...record,
|
|
747
|
+
zone: this.hostedZone
|
|
748
|
+
});
|
|
749
|
+
});
|
|
750
|
+
new CfnOutput(this, "Route53HostedZoneId", {
|
|
751
|
+
value: this.hostedZone.hostedZoneId
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
};
|
|
673
755
|
var BaseS3Construct = class extends Construct {
|
|
674
756
|
static {
|
|
675
757
|
__name(this, "BaseS3Construct");
|
|
@@ -714,10 +796,14 @@ var BaseS3DeploymentConstruct = class extends Construct {
|
|
|
714
796
|
constructor(scope, id, props) {
|
|
715
797
|
super(scope, id);
|
|
716
798
|
if (!props.options?.cloudfrontOptions?.defaultBehavior?.origin && !props?.withS3Bucket && props.withCloudfront) {
|
|
717
|
-
throw new CustomException(
|
|
799
|
+
throw new CustomException(
|
|
800
|
+
"Cloudfront distribution S3_Bucket origins must be defined!"
|
|
801
|
+
);
|
|
718
802
|
}
|
|
719
803
|
if (!props.options?.bucketDeploymentOptions?.destinationBucket && !props?.withS3Bucket) {
|
|
720
|
-
throw new CustomException(
|
|
804
|
+
throw new CustomException(
|
|
805
|
+
"Deployment S3_Bucket destination must be defined!"
|
|
806
|
+
);
|
|
721
807
|
}
|
|
722
808
|
if (props?.withS3Bucket) {
|
|
723
809
|
this.bucket = new BaseS3Construct(this, "bucket", {
|
|
@@ -735,13 +821,18 @@ var BaseS3DeploymentConstruct = class extends Construct {
|
|
|
735
821
|
/**
|
|
736
822
|
* Map additional behaviors and ensure origin is assigned
|
|
737
823
|
*/
|
|
738
|
-
additionalBehaviors: Object.entries(
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
824
|
+
additionalBehaviors: Object.entries(
|
|
825
|
+
props.options?.cloudfrontOptions?.additionalBehaviors || {}
|
|
826
|
+
).reduce(
|
|
827
|
+
(behavior, [pattern, behaviorOptions]) => {
|
|
828
|
+
behavior[pattern] = {
|
|
829
|
+
...behaviorOptions,
|
|
830
|
+
origin: behaviorOptions.origin || s3Origin
|
|
831
|
+
};
|
|
832
|
+
return behavior;
|
|
833
|
+
},
|
|
834
|
+
{}
|
|
835
|
+
),
|
|
745
836
|
/**
|
|
746
837
|
* Default behavior configuration
|
|
747
838
|
*/
|
|
@@ -857,7 +948,133 @@ var BaseVpcConstruct = class extends Construct {
|
|
|
857
948
|
});
|
|
858
949
|
}
|
|
859
950
|
};
|
|
951
|
+
var BaseLambdaApiStack = class extends Stack {
|
|
952
|
+
static {
|
|
953
|
+
__name(this, "BaseLambdaApiStack");
|
|
954
|
+
}
|
|
955
|
+
constructor(scope, id, props) {
|
|
956
|
+
super(scope, id, props);
|
|
957
|
+
let layers = [];
|
|
958
|
+
if (props?.stackOptions?.layerOptions) {
|
|
959
|
+
if (!props.stackOptions?.layerOptions?.name || !props.stackOptions?.layerOptions?.version) {
|
|
960
|
+
throw new CustomException("Invalid layer options provided! Both layer 'name' and 'version' are required.");
|
|
961
|
+
}
|
|
962
|
+
const { existingLayer } = new BaseLambdaLayerConstruct(
|
|
963
|
+
this,
|
|
964
|
+
"layer",
|
|
965
|
+
{
|
|
966
|
+
options: {
|
|
967
|
+
fromExistingLayerArn: `arn:aws:lambda:${props.env?.region}:${props.env?.account}:layer:${props.stackOptions?.layerOptions?.name}:${props.stackOptions?.layerOptions?.version}`
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
);
|
|
971
|
+
layers.push(existingLayer);
|
|
972
|
+
}
|
|
973
|
+
const { function: lambdaFunction } = new BaseLambdaConstruct(this, "lambda", {
|
|
974
|
+
stage: props.stackOptions?.stage,
|
|
975
|
+
stackName: props.stackName,
|
|
976
|
+
options: {
|
|
977
|
+
lambdaOptions: { layers }
|
|
978
|
+
}
|
|
979
|
+
});
|
|
980
|
+
new BaseApiGatewayV2Construct(this, "apiGateway", {
|
|
981
|
+
handlerFunctions: [lambdaFunction],
|
|
982
|
+
options: {
|
|
983
|
+
gatewayOptions: {
|
|
984
|
+
apiName: props.stackName,
|
|
985
|
+
corsPreflight: {
|
|
986
|
+
allowOrigins: ["*"]
|
|
987
|
+
}
|
|
988
|
+
},
|
|
989
|
+
routeOptions: [
|
|
990
|
+
{
|
|
991
|
+
path: "/{proxy+}",
|
|
992
|
+
methods: [HttpMethod.ANY]
|
|
993
|
+
}
|
|
994
|
+
]
|
|
995
|
+
}
|
|
996
|
+
});
|
|
997
|
+
}
|
|
998
|
+
};
|
|
999
|
+
var BaseLambdaSqsStack = class extends Stack {
|
|
1000
|
+
static {
|
|
1001
|
+
__name(this, "BaseLambdaSqsStack");
|
|
1002
|
+
}
|
|
1003
|
+
constructor(scope, id, props) {
|
|
1004
|
+
super(scope, id, props);
|
|
1005
|
+
let layers = [];
|
|
1006
|
+
if (props?.stackOptions?.layerOptions) {
|
|
1007
|
+
if (!props.stackOptions?.layerOptions?.name || !props.stackOptions?.layerOptions?.version) {
|
|
1008
|
+
throw new CustomException("Invalid layer options provided");
|
|
1009
|
+
}
|
|
1010
|
+
const { existingLayer } = new BaseLambdaLayerConstruct(
|
|
1011
|
+
this,
|
|
1012
|
+
"layer",
|
|
1013
|
+
{
|
|
1014
|
+
options: {
|
|
1015
|
+
fromExistingLayerArn: `arn:aws:lambda:${props.env?.region}:${props.env?.account}:layer:${props.stackOptions?.layerOptions?.name}:${props.stackOptions?.layerOptions?.version}`
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
);
|
|
1019
|
+
layers.push(existingLayer);
|
|
1020
|
+
}
|
|
1021
|
+
const { function: lambdaFunction } = new BaseLambdaConstruct(this, "lambda", {
|
|
1022
|
+
stage: props.stackOptions?.stage,
|
|
1023
|
+
stackName: props.stackName,
|
|
1024
|
+
options: {
|
|
1025
|
+
lambdaOptions: { layers }
|
|
1026
|
+
}
|
|
1027
|
+
});
|
|
1028
|
+
new BaseSqsConstruct(this, "sqs", {
|
|
1029
|
+
targetFunctions: [lambdaFunction],
|
|
1030
|
+
options: {
|
|
1031
|
+
eventSourceMappingOptions: {},
|
|
1032
|
+
queueOptions: {}
|
|
1033
|
+
}
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
};
|
|
1037
|
+
var BaseLambdaSnsStack = class extends Stack {
|
|
1038
|
+
static {
|
|
1039
|
+
__name(this, "BaseLambdaSnsStack");
|
|
1040
|
+
}
|
|
1041
|
+
constructor(scope, id, props) {
|
|
1042
|
+
super(scope, id, props);
|
|
1043
|
+
let layers = [];
|
|
1044
|
+
if (props?.stackOptions?.layerOptions) {
|
|
1045
|
+
if (!props.stackOptions?.layerOptions?.name || !props.stackOptions?.layerOptions?.version) {
|
|
1046
|
+
throw new CustomException("Invalid layer options provided");
|
|
1047
|
+
}
|
|
1048
|
+
const { existingLayer } = new BaseLambdaLayerConstruct(
|
|
1049
|
+
this,
|
|
1050
|
+
"layer",
|
|
1051
|
+
{
|
|
1052
|
+
options: {
|
|
1053
|
+
fromExistingLayerArn: `arn:aws:lambda:${props.env?.region}:${props.env?.account}:layer:${props.stackOptions?.layerOptions?.name}:${props.stackOptions?.layerOptions?.version}`
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
);
|
|
1057
|
+
layers.push(existingLayer);
|
|
1058
|
+
}
|
|
1059
|
+
const { function: lambdaFunction } = new BaseLambdaConstruct(this, "lambda", {
|
|
1060
|
+
stage: props.stackOptions?.stage,
|
|
1061
|
+
stackName: props.stackName,
|
|
1062
|
+
options: {
|
|
1063
|
+
lambdaOptions: { layers }
|
|
1064
|
+
}
|
|
1065
|
+
});
|
|
1066
|
+
new BaseSnsConstruct(this, "sns", {
|
|
1067
|
+
options: {
|
|
1068
|
+
targetFunctions: [lambdaFunction],
|
|
1069
|
+
topicOptions: {
|
|
1070
|
+
...props?.stackOptions?.topicOptions,
|
|
1071
|
+
topicName: props?.stackOptions?.topicOptions?.topicName || props.stackName
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
};
|
|
860
1077
|
|
|
861
|
-
export { BaseApiGatewayConstruct, BaseApiGatewayV2Construct, BaseApiGatewayWebSocketConstruct, BaseCloudfrontConstruct, BaseCloudwatchLogGroupConstruct, BaseDynamoDBConstruct, BaseEventBridgeConstruct, BaseLambdaAuthoriserConstruct, BaseLambdaAuthoriserV2Construct, BaseLambdaConstruct, BaseLambdaLayerConstruct, BaseRolePolicyConstruct, BaseS3Construct, BaseS3DeploymentConstruct, BaseSnsConstruct, BaseSqsConstruct, BaseVpcConstruct };
|
|
1078
|
+
export { BaseApiGatewayConstruct, BaseApiGatewayV2Construct, BaseApiGatewayWebSocketConstruct, BaseCloudfrontConstruct, BaseCloudwatchLogGroupConstruct, BaseDynamoDBConstruct, BaseEventBridgeConstruct, BaseLambdaApiStack, BaseLambdaAuthoriserConstruct, BaseLambdaAuthoriserV2Construct, BaseLambdaConstruct, BaseLambdaLayerConstruct, BaseLambdaSnsStack, BaseLambdaSqsStack, BaseRolePolicyConstruct, BaseRoute53Construct, BaseS3Construct, BaseS3DeploymentConstruct, BaseSnsConstruct, BaseSqsConstruct, BaseVpcConstruct };
|
|
862
1079
|
//# sourceMappingURL=index.js.map
|
|
863
1080
|
//# sourceMappingURL=index.js.map
|