@gradientedge/cdk-utils 8.91.0 → 8.92.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 +0 -18
- 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 +0 -18
- 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 +1 -19
- 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 +1 -19
- 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 { LambdaRestApiProps } from './types'
|
|
|
7
7
|
import { CommonConstruct } from '../../../common'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* @stability stable
|
|
11
|
-
* @category cdk-utils.api-manager
|
|
12
|
-
* @subcategory Construct
|
|
13
10
|
* @classdesc Provides operations on AWS API Gateway.
|
|
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.
|
|
@@ -24,15 +21,14 @@ import { CommonConstruct } from '../../../common'
|
|
|
24
21
|
* this.apiManager.createLambdaRestApi('MyCertificate', this, props, lambdaFunction)
|
|
25
22
|
* }
|
|
26
23
|
* }
|
|
27
|
-
*
|
|
28
24
|
* @see [CDK API Gateway Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway-readme.html}
|
|
29
25
|
*/
|
|
30
26
|
export class ApiManager {
|
|
31
27
|
/**
|
|
32
28
|
* @summary Method to create a Rest API with Lambda backend/target
|
|
33
|
-
* @param
|
|
34
|
-
* @param
|
|
35
|
-
* @param
|
|
29
|
+
* @param id scoped id of the resource
|
|
30
|
+
* @param scope scope in which this resource is defined
|
|
31
|
+
* @param props lambda rest restApi props
|
|
36
32
|
* @param lambdaFunction
|
|
37
33
|
*/
|
|
38
34
|
public createLambdaRestApi(
|
|
@@ -44,41 +40,41 @@ export class ApiManager {
|
|
|
44
40
|
if (!props) throw `Api props undefined for ${id}`
|
|
45
41
|
const api = new apig.LambdaRestApi(scope, `${id}`, {
|
|
46
42
|
binaryMediaTypes: props.binaryMediaTypes,
|
|
47
|
-
|
|
43
|
+
cloudWatchRole: props.cloudWatchRole || false,
|
|
44
|
+
defaultCorsPreflightOptions: props.defaultCorsPreflightOptions,
|
|
48
45
|
defaultMethodOptions: props.defaultMethodOptions,
|
|
49
46
|
deploy: props.deploy || true,
|
|
50
47
|
deployOptions: {
|
|
51
|
-
stageName: scope.props.stage,
|
|
52
48
|
accessLogDestination: props.deployOptions?.accessLogDestination,
|
|
53
49
|
accessLogFormat: props.deployOptions?.accessLogFormat,
|
|
54
|
-
tracingEnabled: props.deployOptions?.tracingEnabled,
|
|
55
50
|
cacheClusterEnabled: props.deployOptions?.cacheClusterEnabled,
|
|
56
51
|
cacheClusterSize: props.deployOptions?.cacheClusterSize,
|
|
52
|
+
cachingEnabled: props.deployOptions?.cachingEnabled,
|
|
57
53
|
clientCertificateId: props.deployOptions?.clientCertificateId,
|
|
54
|
+
dataTraceEnabled: props.deployOptions?.dataTraceEnabled,
|
|
58
55
|
description: `${id} - ${scope.props.stage} stage`,
|
|
59
56
|
documentationVersion: props.deployOptions?.documentationVersion,
|
|
60
|
-
variables: props.deployOptions?.variables,
|
|
61
|
-
methodOptions: props.deployOptions?.methodOptions,
|
|
62
57
|
loggingLevel: props.deployOptions?.loggingLevel,
|
|
63
|
-
|
|
64
|
-
cachingEnabled: props.deployOptions?.cachingEnabled,
|
|
58
|
+
methodOptions: props.deployOptions?.methodOptions,
|
|
65
59
|
metricsEnabled: props.deployOptions?.metricsEnabled,
|
|
60
|
+
stageName: scope.props.stage,
|
|
61
|
+
tracingEnabled: props.deployOptions?.tracingEnabled,
|
|
62
|
+
variables: props.deployOptions?.variables,
|
|
66
63
|
},
|
|
67
|
-
retainDeployments: props.retainDeployments,
|
|
68
|
-
parameters: props.parameters,
|
|
69
|
-
policy: props.policy,
|
|
70
|
-
failOnWarnings: props.failOnWarnings || false,
|
|
71
64
|
domainName: props.domainName,
|
|
72
|
-
cloudWatchRole: props.cloudWatchRole || false,
|
|
73
|
-
endpointTypes: props.endpointTypes,
|
|
74
65
|
endpointConfiguration: {
|
|
75
66
|
types: props.endpointConfiguration?.types || [apig.EndpointType.REGIONAL],
|
|
76
67
|
vpcEndpoints: props.endpointConfiguration?.vpcEndpoints,
|
|
77
68
|
},
|
|
78
|
-
|
|
69
|
+
endpointTypes: props.endpointTypes,
|
|
70
|
+
failOnWarnings: props.failOnWarnings || false,
|
|
79
71
|
handler: lambdaFunction,
|
|
80
|
-
|
|
72
|
+
minCompressionSize: props.minCompressionSize,
|
|
73
|
+
parameters: props.parameters,
|
|
74
|
+
policy: props.policy,
|
|
81
75
|
proxy: props.proxy ?? true,
|
|
76
|
+
restApiName: `${props.restApiName}-${scope.props.stage}`,
|
|
77
|
+
retainDeployments: props.retainDeployments,
|
|
82
78
|
})
|
|
83
79
|
|
|
84
80
|
if (props.tags && props.tags.length > 0) {
|
|
@@ -95,15 +91,15 @@ export class ApiManager {
|
|
|
95
91
|
|
|
96
92
|
/**
|
|
97
93
|
* @summary Method to create custom restApi domain
|
|
98
|
-
* @param
|
|
99
|
-
* @param
|
|
94
|
+
* @param id scoped id of the resource
|
|
95
|
+
* @param scope scope in which this resource is defined
|
|
100
96
|
* @param domainName the domain name to use
|
|
101
97
|
* @param certificate the certificate used for custom restApi domain
|
|
102
98
|
*/
|
|
103
99
|
public createApiDomain(id: string, scope: CommonConstruct, domainName: string, certificate: acm.ICertificate) {
|
|
104
100
|
const apiDomain = new apig.DomainName(scope, `${id}`, {
|
|
105
|
-
domainName: domainName,
|
|
106
101
|
certificate: certificate,
|
|
102
|
+
domainName: domainName,
|
|
107
103
|
endpointType: scope.isProductionStage() ? apig.EndpointType.EDGE : apig.EndpointType.REGIONAL,
|
|
108
104
|
securityPolicy: apig.SecurityPolicy.TLS_1_2,
|
|
109
105
|
})
|
|
@@ -115,18 +111,18 @@ export class ApiManager {
|
|
|
115
111
|
|
|
116
112
|
/**
|
|
117
113
|
* @summary Method to create an API gateway resource
|
|
118
|
-
* @param
|
|
119
|
-
* @param
|
|
120
|
-
* @param
|
|
121
|
-
* @param
|
|
122
|
-
* @param
|
|
123
|
-
* @param
|
|
124
|
-
* @param
|
|
125
|
-
* @param
|
|
126
|
-
* @param
|
|
127
|
-
* @param
|
|
128
|
-
* @param
|
|
129
|
-
* @param
|
|
114
|
+
* @param id
|
|
115
|
+
* @param scope
|
|
116
|
+
* @param parent
|
|
117
|
+
* @param path
|
|
118
|
+
* @param integration
|
|
119
|
+
* @param addProxy
|
|
120
|
+
* @param authorizer
|
|
121
|
+
* @param allowedOrigins
|
|
122
|
+
* @param allowedMethods
|
|
123
|
+
* @param allowedHeaders
|
|
124
|
+
* @param methodRequestParameters
|
|
125
|
+
* @param proxyIntegration
|
|
130
126
|
*/
|
|
131
127
|
public createApiResource(
|
|
132
128
|
id: string,
|
|
@@ -139,16 +135,16 @@ export class ApiManager {
|
|
|
139
135
|
allowedOrigins?: string[],
|
|
140
136
|
allowedMethods?: string[],
|
|
141
137
|
allowedHeaders?: string[],
|
|
142
|
-
methodRequestParameters?:
|
|
138
|
+
methodRequestParameters?: any,
|
|
143
139
|
proxyIntegration?: apig.Integration
|
|
144
140
|
) {
|
|
145
141
|
const methods = allowedMethods ?? apig.Cors.ALL_METHODS
|
|
146
142
|
const resource = parent.addResource(path, {
|
|
147
143
|
defaultCorsPreflightOptions: {
|
|
148
|
-
allowOrigins: allowedOrigins ?? apig.Cors.ALL_ORIGINS,
|
|
149
|
-
allowMethods: [...methods, 'OPTIONS'],
|
|
150
|
-
allowHeaders: allowedHeaders ?? apig.Cors.DEFAULT_HEADERS,
|
|
151
144
|
allowCredentials: true,
|
|
145
|
+
allowHeaders: allowedHeaders ?? apig.Cors.DEFAULT_HEADERS,
|
|
146
|
+
allowMethods: [...methods, 'OPTIONS'],
|
|
147
|
+
allowOrigins: allowedOrigins ?? apig.Cors.ALL_ORIGINS,
|
|
152
148
|
},
|
|
153
149
|
})
|
|
154
150
|
methods.forEach(method =>
|
|
@@ -162,10 +158,10 @@ export class ApiManager {
|
|
|
162
158
|
if (addProxy) {
|
|
163
159
|
const resourceProxy = resource.addResource(`{${path}+}`, {
|
|
164
160
|
defaultCorsPreflightOptions: {
|
|
165
|
-
allowOrigins: allowedOrigins ?? apig.Cors.ALL_ORIGINS,
|
|
166
|
-
allowMethods: [...methods, 'OPTIONS'],
|
|
167
|
-
allowHeaders: allowedHeaders ?? apig.Cors.DEFAULT_HEADERS,
|
|
168
161
|
allowCredentials: true,
|
|
162
|
+
allowHeaders: allowedHeaders ?? apig.Cors.DEFAULT_HEADERS,
|
|
163
|
+
allowMethods: [...methods, 'OPTIONS'],
|
|
164
|
+
allowOrigins: allowedOrigins ?? apig.Cors.ALL_ORIGINS,
|
|
169
165
|
},
|
|
170
166
|
})
|
|
171
167
|
methods.forEach(method =>
|
|
@@ -182,9 +178,9 @@ export class ApiManager {
|
|
|
182
178
|
|
|
183
179
|
/**
|
|
184
180
|
* @summary Method to create an api deployment
|
|
185
|
-
* @param
|
|
186
|
-
* @param
|
|
187
|
-
* @param
|
|
181
|
+
* @param id
|
|
182
|
+
* @param scope
|
|
183
|
+
* @param restApi
|
|
188
184
|
*/
|
|
189
185
|
public createApiDeployment(id: string, scope: CommonConstruct, restApi: apig.IRestApi) {
|
|
190
186
|
new apig.Deployment(scope, `${id}`, {
|
|
@@ -1,58 +1,52 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @stability stable
|
|
3
|
-
* @category cdk-utils.app-config-manager
|
|
4
|
-
* @subcategory Construct
|
|
5
2
|
* @returns { Map<string, string> } AppConfig extension ARN by region for x84
|
|
6
3
|
*/
|
|
7
4
|
export const ArnsByRegionForX86_64: { [region: string]: string } = {
|
|
8
|
-
'
|
|
9
|
-
'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension:79',
|
|
10
|
-
'us-west-1': 'arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension:121',
|
|
11
|
-
'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension:143',
|
|
12
|
-
'ca-central-1': 'arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension:79',
|
|
13
|
-
'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension:91',
|
|
14
|
-
'eu-central-2': 'arn:aws:lambda:eu-central-2:758369105281:layer:AWS-AppConfig-Extension:29',
|
|
15
|
-
'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension:108',
|
|
16
|
-
'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension:79',
|
|
17
|
-
'eu-west-3': 'arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension:80',
|
|
18
|
-
'eu-north-1': 'arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension:139',
|
|
19
|
-
'eu-south-1': 'arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension:71',
|
|
20
|
-
'eu-south-2': 'arn:aws:lambda:eu-south-2:586093569114:layer:AWS-AppConfig-Extension:26',
|
|
21
|
-
'cn-north-1': 'arn:aws-cn:lambda:cn-north-1:615057806174:layer:AWS-AppConfig-Extension:66',
|
|
22
|
-
'cn-northwest-1': 'arn:aws-cn:lambda:cn-northwest-1:615084187847:layer:AWS-AppConfig-Extension:66',
|
|
5
|
+
'af-south-1': 'arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension:71',
|
|
23
6
|
'ap-east-1': 'arn:aws:lambda:ap-east-1:630222743974:layer:AWS-AppConfig-Extension:71',
|
|
24
7
|
'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension:82',
|
|
25
8
|
'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:826293736237:layer:AWS-AppConfig-Extension:91',
|
|
26
9
|
'ap-northeast-3': 'arn:aws:lambda:ap-northeast-3:706869817123:layer:AWS-AppConfig-Extension:84',
|
|
10
|
+
'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension:92',
|
|
11
|
+
'ap-south-2': 'arn:aws:lambda:ap-south-2:489524808438:layer:AWS-AppConfig-Extension:29',
|
|
27
12
|
'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension:89',
|
|
28
13
|
'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension:91',
|
|
29
14
|
'ap-southeast-3': 'arn:aws:lambda:ap-southeast-3:418787028745:layer:AWS-AppConfig-Extension:60',
|
|
30
15
|
'ap-southeast-4': 'arn:aws:lambda:ap-southeast-4:307021474294:layer:AWS-AppConfig-Extension:2',
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
16
|
+
'ca-central-1': 'arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension:79',
|
|
17
|
+
'cn-north-1': 'arn:aws-cn:lambda:cn-north-1:615057806174:layer:AWS-AppConfig-Extension:66',
|
|
18
|
+
'cn-northwest-1': 'arn:aws-cn:lambda:cn-northwest-1:615084187847:layer:AWS-AppConfig-Extension:66',
|
|
19
|
+
'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension:91',
|
|
20
|
+
'eu-central-2': 'arn:aws:lambda:eu-central-2:758369105281:layer:AWS-AppConfig-Extension:29',
|
|
21
|
+
'eu-north-1': 'arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension:139',
|
|
22
|
+
'eu-south-1': 'arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension:71',
|
|
23
|
+
'eu-south-2': 'arn:aws:lambda:eu-south-2:586093569114:layer:AWS-AppConfig-Extension:26',
|
|
24
|
+
'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension:108',
|
|
25
|
+
'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension:79',
|
|
26
|
+
'eu-west-3': 'arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension:80',
|
|
35
27
|
'me-central-1': 'arn:aws:lambda:me-central-1:662846165436:layer:AWS-AppConfig-Extension:31',
|
|
36
28
|
'me-south-1': 'arn:aws:lambda:me-south-1:559955524753:layer:AWS-AppConfig-Extension:71',
|
|
29
|
+
'sa-east-1': 'arn:aws:lambda:sa-east-1:000010852771:layer:AWS-AppConfig-Extension:110',
|
|
30
|
+
'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension:110',
|
|
31
|
+
'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension:79',
|
|
37
32
|
'us-gov-east-1': 'arn:aws-us-gov:lambda:us-gov-east-1:946561847325:layer:AWS-AppConfig-Extension:44',
|
|
38
33
|
'us-gov-west-1': 'arn:aws-us-gov:lambda:us-gov-west-1:946746059096:layer:AWS-AppConfig-Extension:44',
|
|
34
|
+
'us-west-1': 'arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension:121',
|
|
35
|
+
'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension:143',
|
|
39
36
|
}
|
|
40
37
|
|
|
41
38
|
/**
|
|
42
|
-
* @stability stable
|
|
43
|
-
* @category cdk-utils.app-config-manager
|
|
44
|
-
* @subcategory Construct
|
|
45
39
|
* @returns { Map<string, string> } AppConfig extension ARN by region for arm64
|
|
46
40
|
*/
|
|
47
41
|
export const ArnsByRegionForArm64: { [region: string]: string } = {
|
|
48
|
-
'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension-Arm64:43',
|
|
49
|
-
'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension-Arm64:31',
|
|
50
|
-
'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension-Arm64:45',
|
|
51
|
-
'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension-Arm64:34',
|
|
52
|
-
'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension-Arm64:46',
|
|
53
|
-
'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension-Arm64:31',
|
|
54
42
|
'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension-Arm64:35',
|
|
43
|
+
'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension-Arm64:34',
|
|
55
44
|
'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension-Arm64:41',
|
|
56
45
|
'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension-Arm64:34',
|
|
57
|
-
'
|
|
46
|
+
'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension-Arm64:34',
|
|
47
|
+
'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension-Arm64:46',
|
|
48
|
+
'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension-Arm64:31',
|
|
49
|
+
'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension-Arm64:43',
|
|
50
|
+
'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension-Arm64:31',
|
|
51
|
+
'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension-Arm64:45',
|
|
58
52
|
}
|
|
@@ -7,8 +7,6 @@ import { ArnsByRegionForArm64, ArnsByRegionForX86_64 } from './constants'
|
|
|
7
7
|
import { CommonConstruct } from '../../../common'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* @category cdk-utils.app-config-manager
|
|
11
|
-
* @subcategory Construct
|
|
12
10
|
* @classdesc Provides operations on AWS AppConfig.
|
|
13
11
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
14
12
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -22,14 +20,13 @@ import { CommonConstruct } from '../../../common'
|
|
|
22
20
|
* this.appConfigManager.createApplication('MyApplication', this)
|
|
23
21
|
* }
|
|
24
22
|
* }
|
|
25
|
-
*
|
|
26
23
|
* @see [CDK AppConfig Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig-readme.html}
|
|
27
24
|
*/
|
|
28
25
|
export class AppConfigManager {
|
|
29
26
|
/**
|
|
30
27
|
* Method to get static ARNs for AppConfig extensions
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
28
|
+
* @param scope scope in which this resource is defined
|
|
29
|
+
* @param type type of the architecture
|
|
33
30
|
*/
|
|
34
31
|
public getArnForAppConfigExtension(scope: CommonConstruct, type: Architecture) {
|
|
35
32
|
switch (type) {
|
|
@@ -44,17 +41,17 @@ export class AppConfigManager {
|
|
|
44
41
|
|
|
45
42
|
/**
|
|
46
43
|
* @summary Method to create an AppConfig Application
|
|
47
|
-
* @param
|
|
48
|
-
* @param
|
|
49
|
-
* @param
|
|
50
|
-
* @returns
|
|
44
|
+
* @param id scoped id of the resource
|
|
45
|
+
* @param scope scope in which this resource is defined
|
|
46
|
+
* @param props
|
|
47
|
+
* @returns the appconfig application
|
|
51
48
|
*/
|
|
52
49
|
public createApplication(id: string, scope: CommonConstruct, props: AppConfigProps): appconfig.CfnApplication {
|
|
53
50
|
if (!props) throw `AppConfig props undefined for ${id}`
|
|
54
51
|
|
|
55
52
|
const application = new appconfig.CfnApplication(scope, `${id}`, {
|
|
56
|
-
name: `${props.application.name}-${scope.props.stage}`,
|
|
57
53
|
description: props.application.description,
|
|
54
|
+
name: `${props.application.name}-${scope.props.stage}`,
|
|
58
55
|
tags: props.application.tags,
|
|
59
56
|
})
|
|
60
57
|
|
|
@@ -66,11 +63,11 @@ export class AppConfigManager {
|
|
|
66
63
|
|
|
67
64
|
/**
|
|
68
65
|
* @summary Method to create an AppConfig Environment for a given application
|
|
69
|
-
* @param
|
|
70
|
-
* @param
|
|
71
|
-
* @param
|
|
72
|
-
* @param
|
|
73
|
-
* @returns
|
|
66
|
+
* @param id scoped id of the resource
|
|
67
|
+
* @param scope scope in which this resource is defined
|
|
68
|
+
* @param applicationId id of the application
|
|
69
|
+
* @param props
|
|
70
|
+
* @returns the appconfig environment
|
|
74
71
|
*/
|
|
75
72
|
public createEnvironment(
|
|
76
73
|
id: string,
|
|
@@ -82,9 +79,9 @@ export class AppConfigManager {
|
|
|
82
79
|
|
|
83
80
|
const environment = new appconfig.CfnEnvironment(scope, `${id}`, {
|
|
84
81
|
applicationId: applicationId,
|
|
85
|
-
name: props.environment.name ?? scope.props.stage,
|
|
86
82
|
description: props.environment.description,
|
|
87
83
|
monitors: props.environment.monitors,
|
|
84
|
+
name: props.environment.name ?? scope.props.stage,
|
|
88
85
|
tags: props.environment.tags,
|
|
89
86
|
})
|
|
90
87
|
|
|
@@ -97,11 +94,11 @@ export class AppConfigManager {
|
|
|
97
94
|
/**
|
|
98
95
|
* @summary Method to create an AppConfig Configuration Profile for a given application
|
|
99
96
|
* - <p>⚠ The <b>locationUri</b> is defaulted to <i>hosted</i> if undefined</p>
|
|
100
|
-
* @param
|
|
101
|
-
* @param
|
|
102
|
-
* @param
|
|
103
|
-
* @param
|
|
104
|
-
* @returns
|
|
97
|
+
* @param id scoped id of the resource
|
|
98
|
+
* @param scope scope in which this resource is defined
|
|
99
|
+
* @param applicationId id of the application
|
|
100
|
+
* @param props
|
|
101
|
+
* @returns the appconfig configuration profile
|
|
105
102
|
*/
|
|
106
103
|
public createConfigurationProfile(
|
|
107
104
|
id: string,
|
|
@@ -113,9 +110,9 @@ export class AppConfigManager {
|
|
|
113
110
|
|
|
114
111
|
const profile = new appconfig.CfnConfigurationProfile(scope, `${id}`, {
|
|
115
112
|
applicationId: applicationId,
|
|
113
|
+
description: props.configurationProfile.description,
|
|
116
114
|
locationUri: props.configurationProfile.locationUri || 'hosted',
|
|
117
115
|
name: `${props.configurationProfile.name}-${scope.props.stage}`,
|
|
118
|
-
description: props.configurationProfile.description,
|
|
119
116
|
retrievalRoleArn: props.configurationProfile.retrievalRoleArn,
|
|
120
117
|
tags: props.configurationProfile.tags,
|
|
121
118
|
type: props.configurationProfile.type,
|
|
@@ -7,14 +7,12 @@ import {
|
|
|
7
7
|
} from 'aws-cdk-lib/aws-appconfig'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* @category cdk-utils.app-config-manager
|
|
11
|
-
* @subcategory Properties
|
|
12
10
|
*/
|
|
13
11
|
export interface AppConfigProps {
|
|
14
|
-
id: string
|
|
15
12
|
application: CfnApplicationProps
|
|
16
13
|
configurationProfile: CfnConfigurationProfileProps
|
|
17
14
|
deployment: CfnDeploymentProps
|
|
18
15
|
deploymentStrategy: CfnDeploymentStrategyProps
|
|
19
16
|
environment: CfnEnvironmentProps
|
|
17
|
+
id: string
|
|
20
18
|
}
|
|
@@ -6,9 +6,6 @@ import { AcmProps } from './types'
|
|
|
6
6
|
import { CommonConstruct } from '../../../common'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* @stability stable
|
|
10
|
-
* @category cdk-utils.acm-manager
|
|
11
|
-
* @subcategory Construct
|
|
12
9
|
* @classdesc Provides operations on AWS Certificates.
|
|
13
10
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
14
11
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -22,18 +19,16 @@ import { CommonConstruct } from '../../../common'
|
|
|
22
19
|
* this.acmManager.createCertificate('MyCertificate', this)
|
|
23
20
|
* }
|
|
24
21
|
* }
|
|
25
|
-
*
|
|
26
22
|
* @see [CDK Certificate Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_certificatemanager-readme.html}
|
|
27
23
|
*/
|
|
28
24
|
export class AcmManager {
|
|
29
25
|
/**
|
|
30
26
|
* @summary Method to create/import a certificate
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
34
|
-
* @param
|
|
35
|
-
* @returns
|
|
36
|
-
*
|
|
27
|
+
* @param id scoped id of the resource
|
|
28
|
+
* @param scope scope in which this resource is defined
|
|
29
|
+
* @param props certificate props
|
|
30
|
+
* @param hostedZone optional hosted zone to perform DNS validation
|
|
31
|
+
* @returns the resolved certificate
|
|
37
32
|
* @mermaid
|
|
38
33
|
* graph LR;
|
|
39
34
|
* A((Start)) --> B{Valid Properties?};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import * as acm from 'aws-cdk-lib/aws-certificatemanager'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @category cdk-utils.acm-manager
|
|
5
|
-
* @subcategory Properties
|
|
6
4
|
*/
|
|
7
5
|
export interface AcmProps extends acm.CertificateProps {
|
|
8
|
-
certificateSsmName?: string
|
|
9
6
|
certificateAccount?: string
|
|
10
|
-
certificateRegion?: string
|
|
11
|
-
certificateId?: string
|
|
12
7
|
certificateArn?: string
|
|
8
|
+
certificateId?: string
|
|
9
|
+
certificateRegion?: string
|
|
10
|
+
certificateSsmName?: string
|
|
13
11
|
useExistingCertificate: boolean
|
|
14
12
|
}
|