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