@gradientedge/cdk-utils 8.91.0 → 8.93.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/.eslintrc.json +40 -0
- package/app/api-destined-function/src/lib/lambda.ts +6 -6
- package/dist/app/api-destined-function/src/lib/lambda.d.ts +6 -6
- package/dist/app/api-destined-function/src/lib/lambda.js +6 -6
- package/dist/lib/lambda.d.ts +6 -6
- package/dist/lib/lambda.js +6 -6
- package/dist/lib/lambda.js.map +1 -1
- package/dist/src/lib/common/construct.d.ts +4 -7
- package/dist/src/lib/common/construct.js +4 -7
- package/dist/src/lib/common/stack.d.ts +9 -13
- package/dist/src/lib/common/stack.js +9 -13
- package/dist/src/lib/common/types.d.ts +0 -2
- package/dist/src/lib/construct/api-to-eventbridge-target/api.d.ts +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/api.js +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/event.d.ts +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/event.js +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +0 -27
- package/dist/src/lib/construct/api-to-eventbridge-target/main.js +41 -68
- package/dist/src/lib/construct/api-to-eventbridge-target/types.d.ts +13 -25
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.js +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.d.ts +0 -37
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.js +44 -81
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/types.d.ts +1 -5
- package/dist/src/lib/construct/api-to-lambda-target/api.d.ts +0 -3
- package/dist/src/lib/construct/api-to-lambda-target/api.js +0 -3
- package/dist/src/lib/construct/api-to-lambda-target/main.d.ts +0 -14
- package/dist/src/lib/construct/api-to-lambda-target/main.js +7 -21
- package/dist/src/lib/construct/api-to-lambda-target/types.d.ts +7 -13
- package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +1 -19
- package/dist/src/lib/construct/graphql-api-lambda/main.js +1 -19
- package/dist/src/lib/construct/graphql-api-lambda/types.d.ts +4 -8
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.d.ts +0 -11
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.js +1 -12
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/types.d.ts +1 -3
- package/dist/src/lib/construct/lambda-with-iam-access/main.d.ts +0 -12
- package/dist/src/lib/construct/lambda-with-iam-access/main.js +2 -14
- package/dist/src/lib/construct/rest-api-lambda/main.d.ts +1 -19
- package/dist/src/lib/construct/rest-api-lambda/main.js +1 -19
- package/dist/src/lib/construct/rest-api-lambda/types.d.ts +6 -10
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.d.ts +0 -11
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.js +3 -14
- package/dist/src/lib/construct/rest-api-lambda-with-cache/types.d.ts +1 -3
- package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +0 -25
- package/dist/src/lib/construct/site-with-ecs-backend/main.js +32 -52
- package/dist/src/lib/construct/site-with-ecs-backend/types.d.ts +10 -11
- package/dist/src/lib/construct/static-asset-deployment/main.d.ts +0 -8
- package/dist/src/lib/construct/static-asset-deployment/main.js +0 -8
- package/dist/src/lib/construct/static-asset-deployment/types.d.ts +1 -1
- package/dist/src/lib/construct/static-site/main.d.ts +0 -17
- package/dist/src/lib/construct/static-site/main.js +1 -18
- package/dist/src/lib/construct/static-site/types.d.ts +9 -11
- package/dist/src/lib/services/aws/api-gateway/main.d.ts +21 -25
- package/dist/src/lib/services/aws/api-gateway/main.js +42 -46
- package/dist/src/lib/services/aws/api-gateway/types.d.ts +0 -2
- package/dist/src/lib/services/aws/appconfig/constants.d.ts +0 -6
- package/dist/src/lib/services/aws/appconfig/constants.js +26 -32
- package/dist/src/lib/services/aws/appconfig/main.d.ts +16 -19
- package/dist/src/lib/services/aws/appconfig/main.js +19 -22
- package/dist/src/lib/services/aws/appconfig/types.d.ts +1 -3
- package/dist/src/lib/services/aws/certificate-manager/main.d.ts +5 -10
- package/dist/src/lib/services/aws/certificate-manager/main.js +5 -10
- package/dist/src/lib/services/aws/certificate-manager/types.d.ts +3 -5
- package/dist/src/lib/services/aws/cloudfront/main.d.ts +41 -47
- package/dist/src/lib/services/aws/cloudfront/main.js +56 -62
- package/dist/src/lib/services/aws/cloudfront/types.d.ts +1 -7
- package/dist/src/lib/services/aws/cloudtrail/main.d.ts +8 -12
- package/dist/src/lib/services/aws/cloudtrail/main.js +8 -12
- package/dist/src/lib/services/aws/cloudtrail/types.d.ts +0 -2
- package/dist/src/lib/services/aws/cloudwatch/logs.d.ts +11 -15
- package/dist/src/lib/services/aws/cloudwatch/logs.js +15 -19
- package/dist/src/lib/services/aws/cloudwatch/main.d.ts +80 -84
- package/dist/src/lib/services/aws/cloudwatch/main.js +116 -122
- package/dist/src/lib/services/aws/cloudwatch/types.d.ts +20 -42
- package/dist/src/lib/services/aws/codebuild/main.d.ts +0 -4
- package/dist/src/lib/services/aws/codebuild/main.js +3 -7
- package/dist/src/lib/services/aws/dynamodb/main.d.ts +3 -7
- package/dist/src/lib/services/aws/dynamodb/main.js +13 -17
- package/dist/src/lib/services/aws/dynamodb/types.d.ts +0 -2
- package/dist/src/lib/services/aws/elastic-container-registry/main.d.ts +3 -7
- package/dist/src/lib/services/aws/elastic-container-registry/main.js +3 -7
- package/dist/src/lib/services/aws/elastic-container-service/main.d.ts +19 -23
- package/dist/src/lib/services/aws/elastic-container-service/main.js +35 -39
- package/dist/src/lib/services/aws/elastic-container-service/types.d.ts +1 -9
- package/dist/src/lib/services/aws/elastic-file-system/main.d.ts +9 -13
- package/dist/src/lib/services/aws/elastic-file-system/main.js +14 -18
- package/dist/src/lib/services/aws/elastic-file-system/types.d.ts +1 -5
- package/dist/src/lib/services/aws/elastic-kubernetes-service/main.d.ts +5 -9
- package/dist/src/lib/services/aws/elastic-kubernetes-service/main.js +8 -12
- package/dist/src/lib/services/aws/elastic-kubernetes-service/types.d.ts +1 -3
- package/dist/src/lib/services/aws/elasticache/main.d.ts +14 -18
- package/dist/src/lib/services/aws/elasticache/main.js +35 -39
- package/dist/src/lib/services/aws/elasticache/types.d.ts +0 -4
- package/dist/src/lib/services/aws/eventbridge/main.d.ts +25 -29
- package/dist/src/lib/services/aws/eventbridge/main.js +34 -38
- package/dist/src/lib/services/aws/eventbridge/target.d.ts +6 -9
- package/dist/src/lib/services/aws/eventbridge/target.js +8 -10
- package/dist/src/lib/services/aws/eventbridge/types.d.ts +2 -10
- package/dist/src/lib/services/aws/evidently/main.d.ts +15 -19
- package/dist/src/lib/services/aws/evidently/main.js +19 -23
- package/dist/src/lib/services/aws/evidently/types.d.ts +0 -10
- package/dist/src/lib/services/aws/identity-access-management/main.d.ts +66 -70
- package/dist/src/lib/services/aws/identity-access-management/main.js +97 -101
- package/dist/src/lib/services/aws/key-management-service/main.d.ts +3 -7
- package/dist/src/lib/services/aws/key-management-service/main.js +6 -10
- package/dist/src/lib/services/aws/key-management-service/types.d.ts +0 -2
- package/dist/src/lib/services/aws/lambda/main.d.ts +42 -47
- package/dist/src/lib/services/aws/lambda/main.js +64 -69
- package/dist/src/lib/services/aws/lambda/types.d.ts +6 -16
- package/dist/src/lib/services/aws/route53/main.d.ts +17 -21
- package/dist/src/lib/services/aws/route53/main.js +19 -23
- package/dist/src/lib/services/aws/route53/types.d.ts +0 -2
- package/dist/src/lib/services/aws/secrets-manager/main.d.ts +6 -19
- package/dist/src/lib/services/aws/secrets-manager/main.js +6 -25
- package/dist/src/lib/services/aws/simple-notification-service/main.d.ts +8 -12
- package/dist/src/lib/services/aws/simple-notification-service/main.js +10 -14
- package/dist/src/lib/services/aws/simple-notification-service/types.d.ts +0 -2
- package/dist/src/lib/services/aws/simple-queue-service/main.d.ts +11 -15
- package/dist/src/lib/services/aws/simple-queue-service/main.js +19 -23
- package/dist/src/lib/services/aws/simple-queue-service/types.d.ts +4 -6
- package/dist/src/lib/services/aws/simple-storage-service/main.d.ts +24 -32
- package/dist/src/lib/services/aws/simple-storage-service/main.js +32 -40
- package/dist/src/lib/services/aws/simple-storage-service/types.d.ts +2 -8
- package/dist/src/lib/services/aws/step-function/main.d.ts +55 -59
- package/dist/src/lib/services/aws/step-function/main.js +91 -95
- package/dist/src/lib/services/aws/step-function/types.d.ts +0 -32
- package/dist/src/lib/services/aws/systems-manager/main.d.ts +10 -16
- package/dist/src/lib/services/aws/systems-manager/main.js +13 -19
- package/dist/src/lib/services/aws/systems-manager/types.d.ts +0 -2
- package/dist/src/lib/services/aws/virtual-private-cloud/main.d.ts +9 -12
- package/dist/src/lib/services/aws/virtual-private-cloud/main.js +10 -16
- package/dist/src/lib/services/aws/web-application-firewall/main.d.ts +6 -10
- package/dist/src/lib/services/aws/web-application-firewall/main.js +12 -16
- package/dist/src/lib/services/aws/web-application-firewall/types.d.ts +0 -4
- package/dist/src/lib/types/aws/index.d.ts +0 -2
- package/dist/src/lib/utils/aws/index.d.ts +6 -9
- package/dist/src/lib/utils/aws/index.js +7 -10
- package/dist/src/lib/utils/index.d.ts +6 -13
- package/dist/src/lib/utils/index.js +4 -12
- package/package.json +1 -1
- package/src/lib/common/construct.ts +4 -7
- package/src/lib/common/stack.ts +9 -13
- package/src/lib/common/types.ts +0 -2
- package/src/lib/construct/api-to-eventbridge-target/api.ts +0 -3
- package/src/lib/construct/api-to-eventbridge-target/event.ts +0 -3
- package/src/lib/construct/api-to-eventbridge-target/main.ts +41 -68
- package/src/lib/construct/api-to-eventbridge-target/types.ts +13 -25
- package/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +0 -3
- package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +44 -81
- package/src/lib/construct/api-to-eventbridge-target-with-sns/types.ts +1 -5
- package/src/lib/construct/api-to-lambda-target/api.ts +0 -3
- package/src/lib/construct/api-to-lambda-target/main.ts +7 -21
- package/src/lib/construct/api-to-lambda-target/types.ts +7 -13
- package/src/lib/construct/graphql-api-lambda/main.ts +2 -20
- package/src/lib/construct/graphql-api-lambda/types.ts +4 -8
- package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +1 -12
- package/src/lib/construct/graphql-api-lambda-with-cache/types.ts +1 -3
- package/src/lib/construct/lambda-with-iam-access/main.ts +2 -14
- package/src/lib/construct/rest-api-lambda/main.ts +2 -20
- package/src/lib/construct/rest-api-lambda/types.ts +6 -10
- package/src/lib/construct/rest-api-lambda-with-cache/main.ts +3 -14
- package/src/lib/construct/rest-api-lambda-with-cache/types.ts +1 -3
- package/src/lib/construct/site-with-ecs-backend/main.ts +31 -52
- package/src/lib/construct/site-with-ecs-backend/types.ts +10 -11
- package/src/lib/construct/static-asset-deployment/main.ts +0 -8
- package/src/lib/construct/static-asset-deployment/types.ts +1 -1
- package/src/lib/construct/static-site/main.ts +1 -18
- package/src/lib/construct/static-site/types.ts +9 -11
- package/src/lib/services/aws/api-gateway/main.ts +43 -47
- package/src/lib/services/aws/api-gateway/types.ts +0 -2
- package/src/lib/services/aws/appconfig/constants.ts +26 -32
- package/src/lib/services/aws/appconfig/main.ts +19 -22
- package/src/lib/services/aws/appconfig/types.ts +1 -3
- package/src/lib/services/aws/certificate-manager/main.ts +5 -10
- package/src/lib/services/aws/certificate-manager/types.ts +3 -5
- package/src/lib/services/aws/cloudfront/main.ts +56 -62
- package/src/lib/services/aws/cloudfront/types.ts +1 -7
- package/src/lib/services/aws/cloudtrail/main.ts +8 -12
- package/src/lib/services/aws/cloudtrail/types.ts +0 -2
- package/src/lib/services/aws/cloudwatch/logs.ts +15 -19
- package/src/lib/services/aws/cloudwatch/main.ts +116 -122
- package/src/lib/services/aws/cloudwatch/types.ts +20 -42
- package/src/lib/services/aws/codebuild/main.ts +3 -7
- package/src/lib/services/aws/dynamodb/main.ts +13 -17
- package/src/lib/services/aws/dynamodb/types.ts +0 -2
- package/src/lib/services/aws/elastic-container-registry/main.ts +3 -7
- package/src/lib/services/aws/elastic-container-service/main.ts +35 -39
- package/src/lib/services/aws/elastic-container-service/types.ts +1 -9
- package/src/lib/services/aws/elastic-file-system/main.ts +14 -18
- package/src/lib/services/aws/elastic-file-system/types.ts +1 -5
- package/src/lib/services/aws/elastic-kubernetes-service/main.ts +8 -12
- package/src/lib/services/aws/elastic-kubernetes-service/types.ts +1 -3
- package/src/lib/services/aws/elasticache/main.ts +35 -39
- package/src/lib/services/aws/elasticache/types.ts +0 -4
- package/src/lib/services/aws/eventbridge/main.ts +34 -38
- package/src/lib/services/aws/eventbridge/target.ts +8 -11
- package/src/lib/services/aws/eventbridge/types.ts +2 -10
- package/src/lib/services/aws/evidently/main.ts +19 -23
- package/src/lib/services/aws/evidently/types.ts +0 -10
- package/src/lib/services/aws/identity-access-management/main.ts +97 -101
- package/src/lib/services/aws/key-management-service/main.ts +6 -10
- package/src/lib/services/aws/key-management-service/types.ts +0 -2
- package/src/lib/services/aws/lambda/main.ts +64 -69
- package/src/lib/services/aws/lambda/types.ts +6 -16
- package/src/lib/services/aws/route53/main.ts +19 -23
- package/src/lib/services/aws/route53/types.ts +0 -2
- package/src/lib/services/aws/secrets-manager/main.ts +6 -28
- package/src/lib/services/aws/simple-notification-service/main.ts +10 -14
- package/src/lib/services/aws/simple-notification-service/types.ts +0 -2
- package/src/lib/services/aws/simple-queue-service/main.ts +19 -23
- package/src/lib/services/aws/simple-queue-service/types.ts +4 -6
- package/src/lib/services/aws/simple-storage-service/main.ts +32 -40
- package/src/lib/services/aws/simple-storage-service/types.ts +2 -8
- package/src/lib/services/aws/step-function/main.ts +91 -95
- package/src/lib/services/aws/step-function/types.ts +0 -32
- package/src/lib/services/aws/systems-manager/main.ts +13 -19
- package/src/lib/services/aws/systems-manager/types.ts +0 -2
- package/src/lib/services/aws/virtual-private-cloud/main.ts +10 -16
- package/src/lib/services/aws/web-application-firewall/main.ts +12 -16
- package/src/lib/services/aws/web-application-firewall/types.ts +0 -4
- package/src/lib/types/aws/index.ts +0 -2
- package/src/lib/utils/aws/index.ts +7 -10
- package/src/lib/utils/index.ts +4 -12
|
@@ -7,9 +7,6 @@ import { IVersion } from 'aws-cdk-lib/aws-lambda';
|
|
|
7
7
|
import { CommonConstruct } from '../../../common';
|
|
8
8
|
import { LambdaAliasProps, LambdaEdgeProps, LambdaProps } from './types';
|
|
9
9
|
/**
|
|
10
|
-
* @stability stable
|
|
11
|
-
* @category cdk-utils.lambda-manager
|
|
12
|
-
* @subcategory Construct
|
|
13
10
|
* @classdesc Provides operations on AWS Lambda.
|
|
14
11
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
15
12
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -23,71 +20,69 @@ import { LambdaAliasProps, LambdaEdgeProps, LambdaProps } from './types';
|
|
|
23
20
|
* this.lambdaManager.createLambdaFunction('MyFunction', this, role, layers, code)
|
|
24
21
|
* }
|
|
25
22
|
* }
|
|
26
|
-
*
|
|
27
23
|
* @see [CDK Lambda Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda-readme.html}
|
|
28
24
|
*/
|
|
29
25
|
export declare class LambdaManager {
|
|
30
26
|
/**
|
|
31
27
|
* @summary Method to create a lambda layer (nodejs)
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
34
|
-
* @param
|
|
28
|
+
* @param id scoped id of the resource
|
|
29
|
+
* @param scope scope in which this resource is defined
|
|
30
|
+
* @param code
|
|
35
31
|
*/
|
|
36
32
|
createLambdaLayer(id: string, scope: CommonConstruct, code: lambda.AssetCode): cdk.aws_lambda.LayerVersion;
|
|
37
33
|
/**
|
|
38
34
|
* @summary Method to create a lambda function (nodejs)
|
|
39
|
-
* @param
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
42
|
-
* @param
|
|
43
|
-
* @param
|
|
44
|
-
* @param
|
|
45
|
-
* @param
|
|
46
|
-
* @param
|
|
47
|
-
* @param
|
|
48
|
-
* @param
|
|
49
|
-
* @param
|
|
50
|
-
* @param
|
|
51
|
-
* @param
|
|
35
|
+
* @param id scoped id of the resource
|
|
36
|
+
* @param scope scope in which this resource is defined
|
|
37
|
+
* @param props
|
|
38
|
+
* @param role
|
|
39
|
+
* @param layers
|
|
40
|
+
* @param code
|
|
41
|
+
* @param handler
|
|
42
|
+
* @param environment
|
|
43
|
+
* @param vpc
|
|
44
|
+
* @param securityGroups
|
|
45
|
+
* @param accessPoint
|
|
46
|
+
* @param mountPath
|
|
47
|
+
* @param vpcSubnets
|
|
52
48
|
*/
|
|
53
49
|
createLambdaFunction(id: string, scope: CommonConstruct, props: LambdaProps, role: iam.Role | iam.CfnRole, layers: lambda.ILayerVersion[], code: lambda.AssetCode, handler?: string, environment?: any, vpc?: ec2.IVpc, securityGroups?: ec2.ISecurityGroup[], accessPoint?: efs.IAccessPoint, mountPath?: string, vpcSubnets?: ec2.SubnetSelection): cdk.aws_lambda.Function;
|
|
54
50
|
/**
|
|
55
51
|
* @summary Method to provision a Lambda@Edge function
|
|
56
|
-
*
|
|
57
|
-
* @param
|
|
58
|
-
* @param
|
|
59
|
-
* @param
|
|
60
|
-
* @param
|
|
61
|
-
* @param
|
|
62
|
-
* @param
|
|
63
|
-
* @param
|
|
64
|
-
* @param
|
|
65
|
-
* @param
|
|
66
|
-
* @param
|
|
67
|
-
* @param {string?} mountPath
|
|
52
|
+
* @param id scoped id of the resource
|
|
53
|
+
* @param scope scope in which this resource is defined
|
|
54
|
+
* @param props lambda@edge properties
|
|
55
|
+
* @param layers
|
|
56
|
+
* @param code
|
|
57
|
+
* @param role
|
|
58
|
+
* @param environment
|
|
59
|
+
* @param vpc
|
|
60
|
+
* @param securityGroups
|
|
61
|
+
* @param accessPoint
|
|
62
|
+
* @param mountPath
|
|
68
63
|
*/
|
|
69
64
|
createEdgeFunction(id: string, scope: CommonConstruct, props: LambdaEdgeProps, layers: lambda.ILayerVersion[], code: lambda.AssetCode, role: iam.Role, environment?: any, vpc?: ec2.IVpc, securityGroups?: ec2.ISecurityGroup[], accessPoint?: efs.IAccessPoint, mountPath?: string): cdk.aws_cloudfront.experimental.EdgeFunction;
|
|
70
65
|
/**
|
|
71
66
|
* @summary Method to create a lambda function (nodejs) with docker image
|
|
72
|
-
* @param
|
|
73
|
-
* @param
|
|
74
|
-
* @param
|
|
75
|
-
* @param
|
|
76
|
-
* @param
|
|
77
|
-
* @param
|
|
78
|
-
* @param
|
|
79
|
-
* @param
|
|
80
|
-
* @param
|
|
81
|
-
* @param
|
|
82
|
-
* @param
|
|
67
|
+
* @param id scoped id of the resource
|
|
68
|
+
* @param scope scope in which this resource is defined
|
|
69
|
+
* @param props
|
|
70
|
+
* @param role
|
|
71
|
+
* @param code
|
|
72
|
+
* @param environment
|
|
73
|
+
* @param vpc
|
|
74
|
+
* @param securityGroups
|
|
75
|
+
* @param accessPoint
|
|
76
|
+
* @param mountPath
|
|
77
|
+
* @param vpcSubnets
|
|
83
78
|
*/
|
|
84
79
|
createLambdaDockerFunction(id: string, scope: CommonConstruct, props: LambdaProps, role: iam.Role | iam.CfnRole, code: lambda.DockerImageCode, environment?: any, vpc?: ec2.IVpc, securityGroups?: ec2.ISecurityGroup[], accessPoint?: efs.IAccessPoint, mountPath?: string, vpcSubnets?: ec2.SubnetSelection): cdk.aws_lambda.DockerImageFunction;
|
|
85
80
|
/**
|
|
86
81
|
* @summary Method to create a lambda function Alias
|
|
87
|
-
* @param
|
|
88
|
-
* @param
|
|
89
|
-
* @param
|
|
90
|
-
* @param
|
|
82
|
+
* @param id scoped id of the resource
|
|
83
|
+
* @param scope scope in which this resource is defined
|
|
84
|
+
* @param props
|
|
85
|
+
* @param lambdaVersion
|
|
91
86
|
*/
|
|
92
87
|
createLambdaFunctionAlias(id: string, scope: CommonConstruct, props: LambdaAliasProps, lambdaVersion: IVersion): cdk.aws_lambda.Alias;
|
|
93
88
|
}
|
|
@@ -33,9 +33,6 @@ const common_1 = require("../../../common");
|
|
|
33
33
|
const cloudfront_1 = require("../cloudfront");
|
|
34
34
|
const systems_manager_1 = require("../systems-manager");
|
|
35
35
|
/**
|
|
36
|
-
* @stability stable
|
|
37
|
-
* @category cdk-utils.lambda-manager
|
|
38
|
-
* @subcategory Construct
|
|
39
36
|
* @classdesc Provides operations on AWS Lambda.
|
|
40
37
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
41
38
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -49,20 +46,19 @@ const systems_manager_1 = require("../systems-manager");
|
|
|
49
46
|
* this.lambdaManager.createLambdaFunction('MyFunction', this, role, layers, code)
|
|
50
47
|
* }
|
|
51
48
|
* }
|
|
52
|
-
*
|
|
53
49
|
* @see [CDK Lambda Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda-readme.html}
|
|
54
50
|
*/
|
|
55
51
|
class LambdaManager {
|
|
56
52
|
/**
|
|
57
53
|
* @summary Method to create a lambda layer (nodejs)
|
|
58
|
-
* @param
|
|
59
|
-
* @param
|
|
60
|
-
* @param
|
|
54
|
+
* @param id scoped id of the resource
|
|
55
|
+
* @param scope scope in which this resource is defined
|
|
56
|
+
* @param code
|
|
61
57
|
*/
|
|
62
58
|
createLambdaLayer(id, scope, code) {
|
|
63
59
|
const lambdaLayer = new lambda.LayerVersion(scope, `${id}`, {
|
|
64
|
-
compatibleRuntimes: [scope.props.nodejsRuntime ?? common_1.CommonStack.NODEJS_RUNTIME],
|
|
65
60
|
code: code,
|
|
61
|
+
compatibleRuntimes: [scope.props.nodejsRuntime ?? common_1.CommonStack.NODEJS_RUNTIME],
|
|
66
62
|
description: `${id}`,
|
|
67
63
|
layerVersionName: `${id}-${scope.props.stage}`,
|
|
68
64
|
});
|
|
@@ -71,19 +67,19 @@ class LambdaManager {
|
|
|
71
67
|
}
|
|
72
68
|
/**
|
|
73
69
|
* @summary Method to create a lambda function (nodejs)
|
|
74
|
-
* @param
|
|
75
|
-
* @param
|
|
76
|
-
* @param
|
|
77
|
-
* @param
|
|
78
|
-
* @param
|
|
79
|
-
* @param
|
|
80
|
-
* @param
|
|
81
|
-
* @param
|
|
82
|
-
* @param
|
|
83
|
-
* @param
|
|
84
|
-
* @param
|
|
85
|
-
* @param
|
|
86
|
-
* @param
|
|
70
|
+
* @param id scoped id of the resource
|
|
71
|
+
* @param scope scope in which this resource is defined
|
|
72
|
+
* @param props
|
|
73
|
+
* @param role
|
|
74
|
+
* @param layers
|
|
75
|
+
* @param code
|
|
76
|
+
* @param handler
|
|
77
|
+
* @param environment
|
|
78
|
+
* @param vpc
|
|
79
|
+
* @param securityGroups
|
|
80
|
+
* @param accessPoint
|
|
81
|
+
* @param mountPath
|
|
82
|
+
* @param vpcSubnets
|
|
87
83
|
*/
|
|
88
84
|
createLambdaFunction(id, scope, props, role, layers, code, handler, environment, vpc, securityGroups, accessPoint, mountPath, vpcSubnets) {
|
|
89
85
|
if (!props)
|
|
@@ -98,39 +94,39 @@ class LambdaManager {
|
|
|
98
94
|
...props,
|
|
99
95
|
...{
|
|
100
96
|
allowPublicSubnet: !!vpc,
|
|
101
|
-
|
|
102
|
-
handler: handler || 'index.lambda_handler',
|
|
103
|
-
runtime: props.runtime ?? scope.props.nodejsRuntime ?? common_1.CommonStack.NODEJS_RUNTIME,
|
|
97
|
+
architecture: props.architecture ?? lambda.Architecture.ARM_64,
|
|
104
98
|
code: code,
|
|
105
99
|
deadLetterQueue: deadLetterQueue,
|
|
106
|
-
architecture: props.architecture ?? lambda.Architecture.ARM_64,
|
|
107
100
|
environment: {
|
|
108
|
-
REGION: scope.props.region,
|
|
109
|
-
STAGE: scope.props.stage,
|
|
110
101
|
LAST_MODIFIED_TS: props.excludeLastModifiedTimestamp
|
|
111
102
|
? ''
|
|
112
103
|
: scope.ssmManager.readStringParameter(`${id}-sm-ts`, scope, `${systems_manager_1.SsmManager.SECRETS_MODIFIED_TIMESTAMP_PARAM}-${scope.props.stage}`),
|
|
104
|
+
REGION: scope.props.region,
|
|
105
|
+
STAGE: scope.props.stage,
|
|
113
106
|
...environment,
|
|
114
107
|
},
|
|
115
108
|
filesystem: accessPoint
|
|
116
109
|
? lambda.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg')
|
|
117
110
|
: undefined,
|
|
111
|
+
functionName: functionName,
|
|
112
|
+
handler: handler || 'index.lambda_handler',
|
|
113
|
+
insightsVersion: props.insightsVersion,
|
|
118
114
|
layers: layers,
|
|
119
115
|
logRetention: scope.props.logRetention ?? props.logRetention,
|
|
120
116
|
reservedConcurrentExecutions: props.reservedConcurrentExecutions ?? scope.props.defaultReservedLambdaConcurrentExecutions,
|
|
121
117
|
role: role instanceof iam.Role ? role : undefined,
|
|
118
|
+
runtime: props.runtime ?? scope.props.nodejsRuntime ?? common_1.CommonStack.NODEJS_RUNTIME,
|
|
122
119
|
securityGroups: securityGroups,
|
|
123
120
|
timeout: props.timeoutInSecs ? cdk.Duration.seconds(props.timeoutInSecs) : cdk.Duration.minutes(15),
|
|
124
|
-
vpc: vpc,
|
|
125
|
-
vpcSubnets: vpcSubnets,
|
|
126
121
|
tracing: scope.props.defaultTracing ?? props.tracing,
|
|
127
|
-
|
|
122
|
+
vpc,
|
|
123
|
+
vpcSubnets,
|
|
128
124
|
},
|
|
129
125
|
});
|
|
130
126
|
if (lambdaFunction.deadLetterQueue && props.dlq?.retriesEnabled) {
|
|
131
127
|
lambdaFunction.addEventSource(new eventSources.SqsEventSource(lambdaFunction.deadLetterQueue, {
|
|
132
|
-
reportBatchItemFailures: true,
|
|
133
128
|
batchSize: props.dlq.retryBatchSize ?? 1,
|
|
129
|
+
reportBatchItemFailures: true,
|
|
134
130
|
}));
|
|
135
131
|
}
|
|
136
132
|
if (props.lambdaAliases && props.lambdaAliases.length > 0) {
|
|
@@ -158,35 +154,34 @@ class LambdaManager {
|
|
|
158
154
|
}
|
|
159
155
|
/**
|
|
160
156
|
* @summary Method to provision a Lambda@Edge function
|
|
161
|
-
*
|
|
162
|
-
* @param
|
|
163
|
-
* @param
|
|
164
|
-
* @param
|
|
165
|
-
* @param
|
|
166
|
-
* @param
|
|
167
|
-
* @param
|
|
168
|
-
* @param
|
|
169
|
-
* @param
|
|
170
|
-
* @param
|
|
171
|
-
* @param
|
|
172
|
-
* @param {string?} mountPath
|
|
157
|
+
* @param id scoped id of the resource
|
|
158
|
+
* @param scope scope in which this resource is defined
|
|
159
|
+
* @param props lambda@edge properties
|
|
160
|
+
* @param layers
|
|
161
|
+
* @param code
|
|
162
|
+
* @param role
|
|
163
|
+
* @param environment
|
|
164
|
+
* @param vpc
|
|
165
|
+
* @param securityGroups
|
|
166
|
+
* @param accessPoint
|
|
167
|
+
* @param mountPath
|
|
173
168
|
*/
|
|
174
169
|
createEdgeFunction(id, scope, props, layers, code, role, environment, vpc, securityGroups, accessPoint, mountPath) {
|
|
175
170
|
return new cloudfront_1.CloudFrontManager().createEdgeFunction(id, scope, props, layers, code, role, environment, vpc, securityGroups, accessPoint, mountPath);
|
|
176
171
|
}
|
|
177
172
|
/**
|
|
178
173
|
* @summary Method to create a lambda function (nodejs) with docker image
|
|
179
|
-
* @param
|
|
180
|
-
* @param
|
|
181
|
-
* @param
|
|
182
|
-
* @param
|
|
183
|
-
* @param
|
|
184
|
-
* @param
|
|
185
|
-
* @param
|
|
186
|
-
* @param
|
|
187
|
-
* @param
|
|
188
|
-
* @param
|
|
189
|
-
* @param
|
|
174
|
+
* @param id scoped id of the resource
|
|
175
|
+
* @param scope scope in which this resource is defined
|
|
176
|
+
* @param props
|
|
177
|
+
* @param role
|
|
178
|
+
* @param code
|
|
179
|
+
* @param environment
|
|
180
|
+
* @param vpc
|
|
181
|
+
* @param securityGroups
|
|
182
|
+
* @param accessPoint
|
|
183
|
+
* @param mountPath
|
|
184
|
+
* @param vpcSubnets
|
|
190
185
|
*/
|
|
191
186
|
createLambdaDockerFunction(id, scope, props, role, code, environment, vpc, securityGroups, accessPoint, mountPath, vpcSubnets) {
|
|
192
187
|
if (!props)
|
|
@@ -201,37 +196,37 @@ class LambdaManager {
|
|
|
201
196
|
...props,
|
|
202
197
|
...{
|
|
203
198
|
allowPublicSubnet: !!vpc,
|
|
204
|
-
|
|
205
|
-
runtime: props.runtime ?? scope.props.nodejsRuntime ?? common_1.CommonStack.NODEJS_RUNTIME,
|
|
199
|
+
architecture: props.architecture ?? lambda.Architecture.ARM_64,
|
|
206
200
|
code: code,
|
|
207
201
|
deadLetterQueue: deadLetterQueue,
|
|
208
|
-
architecture: props.architecture ?? lambda.Architecture.ARM_64,
|
|
209
202
|
environment: {
|
|
210
|
-
REGION: scope.props.region,
|
|
211
|
-
STAGE: scope.props.stage,
|
|
212
203
|
LAST_MODIFIED_TS: props.excludeLastModifiedTimestamp
|
|
213
204
|
? ''
|
|
214
205
|
: scope.ssmManager.readStringParameter(`${id}-sm-ts`, scope, `${systems_manager_1.SsmManager.SECRETS_MODIFIED_TIMESTAMP_PARAM}-${scope.props.stage}`),
|
|
206
|
+
REGION: scope.props.region,
|
|
207
|
+
STAGE: scope.props.stage,
|
|
215
208
|
...environment,
|
|
216
209
|
},
|
|
217
210
|
filesystem: accessPoint
|
|
218
211
|
? lambda.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg')
|
|
219
212
|
: undefined,
|
|
213
|
+
functionName: functionName,
|
|
214
|
+
insightsVersion: props.insightsVersion,
|
|
220
215
|
logRetention: scope.props.logRetention ?? props.logRetention,
|
|
221
216
|
reservedConcurrentExecutions: props.reservedConcurrentExecutions,
|
|
222
217
|
role: role instanceof iam.Role ? role : undefined,
|
|
218
|
+
runtime: props.runtime ?? scope.props.nodejsRuntime ?? common_1.CommonStack.NODEJS_RUNTIME,
|
|
223
219
|
securityGroups: securityGroups,
|
|
224
220
|
timeout: props.timeoutInSecs ? cdk.Duration.seconds(props.timeoutInSecs) : cdk.Duration.minutes(1),
|
|
225
|
-
vpc: vpc,
|
|
226
|
-
vpcSubnets: vpcSubnets,
|
|
227
221
|
tracing: props.tracing,
|
|
228
|
-
|
|
222
|
+
vpc,
|
|
223
|
+
vpcSubnets,
|
|
229
224
|
},
|
|
230
225
|
});
|
|
231
226
|
if (lambdaFunction.deadLetterQueue && props.dlq?.retriesEnabled) {
|
|
232
227
|
lambdaFunction.addEventSource(new eventSources.SqsEventSource(lambdaFunction.deadLetterQueue, {
|
|
233
|
-
reportBatchItemFailures: true,
|
|
234
228
|
batchSize: props.dlq.retryBatchSize ?? 1,
|
|
229
|
+
reportBatchItemFailures: true,
|
|
235
230
|
}));
|
|
236
231
|
}
|
|
237
232
|
utils.createCfnOutput(`${id}-lambdaArn`, scope, lambdaFunction.functionArn);
|
|
@@ -240,10 +235,10 @@ class LambdaManager {
|
|
|
240
235
|
}
|
|
241
236
|
/**
|
|
242
237
|
* @summary Method to create a lambda function Alias
|
|
243
|
-
* @param
|
|
244
|
-
* @param
|
|
245
|
-
* @param
|
|
246
|
-
* @param
|
|
238
|
+
* @param id scoped id of the resource
|
|
239
|
+
* @param scope scope in which this resource is defined
|
|
240
|
+
* @param props
|
|
241
|
+
* @param lambdaVersion
|
|
247
242
|
*/
|
|
248
243
|
createLambdaFunctionAlias(id, scope, props, lambdaVersion) {
|
|
249
244
|
if (!props)
|
|
@@ -251,15 +246,15 @@ class LambdaManager {
|
|
|
251
246
|
const lambdaFunctionAlias = new lambda.Alias(scope, `${id}`, {
|
|
252
247
|
...props,
|
|
253
248
|
...{
|
|
254
|
-
aliasName: props.aliasName,
|
|
255
|
-
version: lambdaVersion,
|
|
256
249
|
additionalVersions: props.additionalVersions,
|
|
250
|
+
aliasName: props.aliasName,
|
|
257
251
|
description: props.description,
|
|
258
252
|
maxEventAge: props.maxEventAge,
|
|
259
253
|
onFailure: props.onFailure,
|
|
260
254
|
onSuccess: props.onSuccess,
|
|
261
255
|
provisionedConcurrentExecutions: props.provisionedConcurrentExecutions,
|
|
262
256
|
retryAttempts: props.retryAttempts,
|
|
257
|
+
version: lambdaVersion,
|
|
263
258
|
},
|
|
264
259
|
});
|
|
265
260
|
utils.createCfnOutput(`${id}-lambdaAliasName`, scope, lambdaFunctionAlias.functionArn);
|
|
@@ -3,49 +3,39 @@ import { TagProps } from '../../../types';
|
|
|
3
3
|
import { EdgeFunctionProps } from 'aws-cdk-lib/aws-cloudfront/lib/experimental';
|
|
4
4
|
import { QueueProps } from '../simple-queue-service';
|
|
5
5
|
/**
|
|
6
|
-
* @category cdk-utils.lambda-manager
|
|
7
|
-
* @subcategory Properties
|
|
8
6
|
*/
|
|
9
7
|
export interface ProvisionedConcurrencyProps {
|
|
10
|
-
minCapacity: number;
|
|
11
8
|
maxCapacity: number;
|
|
9
|
+
minCapacity: number;
|
|
12
10
|
utilizationTarget: number;
|
|
13
11
|
}
|
|
14
12
|
/**
|
|
15
|
-
* @category cdk-utils.lambda-manager
|
|
16
|
-
* @subcategory Properties
|
|
17
13
|
*/
|
|
18
14
|
export interface LambdaProps extends FunctionProps {
|
|
19
15
|
dlq?: QueueProps;
|
|
20
|
-
redriveq?: QueueProps;
|
|
21
|
-
timeoutInSecs?: number;
|
|
22
16
|
excludeLastModifiedTimestamp?: boolean;
|
|
23
|
-
tags?: TagProps[];
|
|
24
17
|
lambdaAliases?: LambdaAliasProps[];
|
|
18
|
+
redriveq?: QueueProps;
|
|
19
|
+
tags?: TagProps[];
|
|
20
|
+
timeoutInSecs?: number;
|
|
25
21
|
}
|
|
26
22
|
/**
|
|
27
|
-
* @category cdk-utils.lambda-manager
|
|
28
|
-
* @subcategory Properties
|
|
29
23
|
*/
|
|
30
24
|
export interface LambdaAliasProps extends AliasProps {
|
|
31
25
|
id?: string;
|
|
32
26
|
provisionedConcurrency?: ProvisionedConcurrencyProps;
|
|
33
27
|
}
|
|
34
28
|
/**
|
|
35
|
-
* @category cdk-utils.lambda-manager
|
|
36
|
-
* @subcategory Properties
|
|
37
29
|
*/
|
|
38
30
|
export interface LambdaEdgeProps extends EdgeFunctionProps {
|
|
39
|
-
timeoutInSecs?: number;
|
|
40
31
|
tags?: TagProps[];
|
|
32
|
+
timeoutInSecs?: number;
|
|
41
33
|
}
|
|
42
34
|
/**
|
|
43
|
-
* @category cdk-utils.lambda-manager
|
|
44
|
-
* @subcategory Types
|
|
45
35
|
*/
|
|
46
36
|
export interface LambdaEnvironment {
|
|
47
|
-
NODE_ENV: string;
|
|
48
37
|
LOG_LEVEL: string;
|
|
38
|
+
NODE_ENV: string;
|
|
49
39
|
REGION?: string;
|
|
50
40
|
STAGE?: string;
|
|
51
41
|
TZ: string;
|
|
@@ -4,9 +4,6 @@ import * as route53 from 'aws-cdk-lib/aws-route53';
|
|
|
4
4
|
import { CommonConstruct } from '../../../common';
|
|
5
5
|
import { Route53Props } from './types';
|
|
6
6
|
/**
|
|
7
|
-
* @stability stable
|
|
8
|
-
* @category cdk-utils.route53-manager
|
|
9
|
-
* @subcategory Construct
|
|
10
7
|
* @classdesc Provides operations on AWS Route53.
|
|
11
8
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
12
9
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -20,47 +17,46 @@ import { Route53Props } from './types';
|
|
|
20
17
|
* this.route53Manager.createHostedZone('MyHostedZone', this)
|
|
21
18
|
* }
|
|
22
19
|
* }
|
|
23
|
-
*
|
|
24
20
|
* @see [CDK Route53 Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_route53-readme.html}
|
|
25
21
|
*/
|
|
26
22
|
export declare class Route53Manager {
|
|
27
23
|
/**
|
|
28
24
|
* @summary Method to create a hosted zone
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
25
|
+
* @param id scoped id of the resource
|
|
26
|
+
* @param scope scope in which this resource is defined
|
|
27
|
+
* @param props
|
|
32
28
|
*/
|
|
33
29
|
createHostedZone(id: string, scope: CommonConstruct, props: Route53Props): route53.IHostedZone;
|
|
34
30
|
/**
|
|
35
31
|
* @summary Method to create/lookup a hosted zone
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
32
|
+
* @param id scoped id of the resource
|
|
33
|
+
* @param scope scope in which this resource is defined
|
|
38
34
|
* @param useExistingHostedZone Flag to indicate whether to lookup vs create new hosted zone
|
|
39
35
|
*/
|
|
40
36
|
withHostedZoneFromFullyQualifiedDomainName(id: string, scope: CommonConstruct, useExistingHostedZone: boolean): route53.IHostedZone;
|
|
41
37
|
/**
|
|
42
38
|
* @summary Method to create a-record for cloudfront target
|
|
43
|
-
* @param
|
|
44
|
-
* @param
|
|
45
|
-
* @param
|
|
46
|
-
* @param
|
|
47
|
-
* @param
|
|
39
|
+
* @param id scoped id of the resource
|
|
40
|
+
* @param scope scope in which this resource is defined
|
|
41
|
+
* @param distribution
|
|
42
|
+
* @param hostedZone
|
|
43
|
+
* @param recordName
|
|
48
44
|
* @param skipStageFromRecord
|
|
49
45
|
*/
|
|
50
46
|
createCloudFrontTargetARecord(id: string, scope: CommonConstruct, distribution?: cloudfront.IDistribution, hostedZone?: route53.IHostedZone, recordName?: string, skipStageFromRecord?: boolean): route53.ARecord;
|
|
51
47
|
/**
|
|
52
48
|
* @summary Method to create a-record for cloudfront target
|
|
53
|
-
* @param
|
|
54
|
-
* @param
|
|
55
|
-
* @param
|
|
56
|
-
* @param
|
|
57
|
-
* @param
|
|
49
|
+
* @param id scoped id of the resource
|
|
50
|
+
* @param scope scope in which this resource is defined
|
|
51
|
+
* @param distribution
|
|
52
|
+
* @param hostedZone
|
|
53
|
+
* @param recordName
|
|
58
54
|
*/
|
|
59
55
|
createCloudFrontTargetARecordV2(id: string, scope: CommonConstruct, distribution?: cloudfront.IDistribution, hostedZone?: route53.IHostedZone, recordName?: string): route53.ARecord;
|
|
60
56
|
/**
|
|
61
57
|
* @summary Method to create a-record for restApi gateway target
|
|
62
|
-
* @param
|
|
63
|
-
* @param
|
|
58
|
+
* @param id scoped id of the resource
|
|
59
|
+
* @param scope scope in which this resource is defined
|
|
64
60
|
* @param recordName
|
|
65
61
|
* @param apiDomain
|
|
66
62
|
* @param hostedZone
|
|
@@ -28,9 +28,6 @@ const route53 = __importStar(require("aws-cdk-lib/aws-route53"));
|
|
|
28
28
|
const route53Targets = __importStar(require("aws-cdk-lib/aws-route53-targets"));
|
|
29
29
|
const utils = __importStar(require("../../../utils"));
|
|
30
30
|
/**
|
|
31
|
-
* @stability stable
|
|
32
|
-
* @category cdk-utils.route53-manager
|
|
33
|
-
* @subcategory Construct
|
|
34
31
|
* @classdesc Provides operations on AWS Route53.
|
|
35
32
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
36
33
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -44,15 +41,14 @@ const utils = __importStar(require("../../../utils"));
|
|
|
44
41
|
* this.route53Manager.createHostedZone('MyHostedZone', this)
|
|
45
42
|
* }
|
|
46
43
|
* }
|
|
47
|
-
*
|
|
48
44
|
* @see [CDK Route53 Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_route53-readme.html}
|
|
49
45
|
*/
|
|
50
46
|
class Route53Manager {
|
|
51
47
|
/**
|
|
52
48
|
* @summary Method to create a hosted zone
|
|
53
|
-
* @param
|
|
54
|
-
* @param
|
|
55
|
-
* @param
|
|
49
|
+
* @param id scoped id of the resource
|
|
50
|
+
* @param scope scope in which this resource is defined
|
|
51
|
+
* @param props
|
|
56
52
|
*/
|
|
57
53
|
createHostedZone(id, scope, props) {
|
|
58
54
|
let hostedZone;
|
|
@@ -65,8 +61,8 @@ class Route53Manager {
|
|
|
65
61
|
}
|
|
66
62
|
else {
|
|
67
63
|
hostedZone = new route53.HostedZone(scope, `${id}`, {
|
|
68
|
-
zoneName: scope.props.domainName,
|
|
69
64
|
comment: `Hosted zone for ${scope.props.domainName}`,
|
|
65
|
+
zoneName: scope.props.domainName,
|
|
70
66
|
});
|
|
71
67
|
}
|
|
72
68
|
utils.createCfnOutput(`${id}-hostedZoneId`, scope, hostedZone.hostedZoneId);
|
|
@@ -75,8 +71,8 @@ class Route53Manager {
|
|
|
75
71
|
}
|
|
76
72
|
/**
|
|
77
73
|
* @summary Method to create/lookup a hosted zone
|
|
78
|
-
* @param
|
|
79
|
-
* @param
|
|
74
|
+
* @param id scoped id of the resource
|
|
75
|
+
* @param scope scope in which this resource is defined
|
|
80
76
|
* @param useExistingHostedZone Flag to indicate whether to lookup vs create new hosted zone
|
|
81
77
|
*/
|
|
82
78
|
withHostedZoneFromFullyQualifiedDomainName(id, scope, useExistingHostedZone) {
|
|
@@ -88,8 +84,8 @@ class Route53Manager {
|
|
|
88
84
|
}
|
|
89
85
|
else {
|
|
90
86
|
hostedZone = new route53.HostedZone(scope, `${id}`, {
|
|
91
|
-
zoneName: scope.fullyQualifiedDomainName,
|
|
92
87
|
comment: `Hosted zone for ${scope.fullyQualifiedDomainName}`,
|
|
88
|
+
zoneName: scope.fullyQualifiedDomainName,
|
|
93
89
|
});
|
|
94
90
|
}
|
|
95
91
|
utils.createCfnOutput(`${id}-hostedZoneId`, scope, hostedZone.hostedZoneId);
|
|
@@ -98,11 +94,11 @@ class Route53Manager {
|
|
|
98
94
|
}
|
|
99
95
|
/**
|
|
100
96
|
* @summary Method to create a-record for cloudfront target
|
|
101
|
-
* @param
|
|
102
|
-
* @param
|
|
103
|
-
* @param
|
|
104
|
-
* @param
|
|
105
|
-
* @param
|
|
97
|
+
* @param id scoped id of the resource
|
|
98
|
+
* @param scope scope in which this resource is defined
|
|
99
|
+
* @param distribution
|
|
100
|
+
* @param hostedZone
|
|
101
|
+
* @param recordName
|
|
106
102
|
* @param skipStageFromRecord
|
|
107
103
|
*/
|
|
108
104
|
createCloudFrontTargetARecord(id, scope, distribution, hostedZone, recordName, skipStageFromRecord) {
|
|
@@ -122,11 +118,11 @@ class Route53Manager {
|
|
|
122
118
|
}
|
|
123
119
|
/**
|
|
124
120
|
* @summary Method to create a-record for cloudfront target
|
|
125
|
-
* @param
|
|
126
|
-
* @param
|
|
127
|
-
* @param
|
|
128
|
-
* @param
|
|
129
|
-
* @param
|
|
121
|
+
* @param id scoped id of the resource
|
|
122
|
+
* @param scope scope in which this resource is defined
|
|
123
|
+
* @param distribution
|
|
124
|
+
* @param hostedZone
|
|
125
|
+
* @param recordName
|
|
130
126
|
*/
|
|
131
127
|
createCloudFrontTargetARecordV2(id, scope, distribution, hostedZone, recordName) {
|
|
132
128
|
if (!distribution)
|
|
@@ -143,8 +139,8 @@ class Route53Manager {
|
|
|
143
139
|
}
|
|
144
140
|
/**
|
|
145
141
|
* @summary Method to create a-record for restApi gateway target
|
|
146
|
-
* @param
|
|
147
|
-
* @param
|
|
142
|
+
* @param id scoped id of the resource
|
|
143
|
+
* @param scope scope in which this resource is defined
|
|
148
144
|
* @param recordName
|
|
149
145
|
* @param apiDomain
|
|
150
146
|
* @param hostedZone
|