@gradientedge/cdk-utils 8.117.0 → 8.119.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/app/api-destined-function/package.json +1 -1
- package/dist/src/lib/common/construct.d.ts +32 -32
- package/dist/src/lib/common/construct.js +36 -59
- package/dist/src/lib/common/stack.d.ts +8 -7
- package/dist/src/lib/common/stack.js +17 -37
- package/dist/src/lib/common/types.d.ts +2 -2
- package/dist/src/lib/construct/api-to-eventbridge-target/api.d.ts +22 -22
- package/dist/src/lib/construct/api-to-eventbridge-target/event.d.ts +9 -9
- package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +3 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/main.js +37 -60
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +9 -9
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.d.ts +3 -3
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.js +40 -63
- package/dist/src/lib/construct/api-to-lambda-target/api.d.ts +23 -23
- package/dist/src/lib/construct/api-to-lambda-target/main.d.ts +2 -2
- package/dist/src/lib/construct/api-to-lambda-target/main.js +15 -38
- package/dist/src/lib/construct/application-configuration/main.d.ts +7 -7
- package/dist/src/lib/construct/application-configuration/main.js +17 -41
- package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +17 -17
- package/dist/src/lib/construct/graphql-api-lambda/main.js +6 -29
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.d.ts +5 -5
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.js +7 -7
- package/dist/src/lib/construct/lambda-with-iam-access/main.d.ts +16 -16
- package/dist/src/lib/construct/lambda-with-iam-access/main.js +8 -31
- package/dist/src/lib/construct/lambda-with-iam-access/types.d.ts +4 -4
- package/dist/src/lib/construct/rest-api-lambda/main.d.ts +16 -16
- package/dist/src/lib/construct/rest-api-lambda/main.js +5 -28
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.d.ts +5 -5
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.js +9 -32
- package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +38 -39
- package/dist/src/lib/construct/site-with-ecs-backend/main.js +33 -54
- package/dist/src/lib/construct/static-asset-deployment/main.d.ts +4 -4
- package/dist/src/lib/construct/static-asset-deployment/main.js +3 -26
- package/dist/src/lib/construct/static-site/main.d.ts +15 -15
- package/dist/src/lib/construct/static-site/main.js +4 -27
- package/dist/src/lib/services/aws/api-gateway/main.d.ts +10 -10
- package/dist/src/lib/services/aws/api-gateway/main.js +21 -44
- package/dist/src/lib/services/aws/api-gateway/types.d.ts +2 -2
- package/dist/src/lib/services/aws/appconfig/main.d.ts +7 -7
- package/dist/src/lib/services/aws/appconfig/main.js +14 -37
- package/dist/src/lib/services/aws/certificate-manager/main.d.ts +5 -5
- package/dist/src/lib/services/aws/certificate-manager/main.js +10 -33
- package/dist/src/lib/services/aws/certificate-manager/types.d.ts +2 -2
- package/dist/src/lib/services/aws/cloudfront/main.d.ts +18 -18
- package/dist/src/lib/services/aws/cloudfront/main.js +46 -45
- package/dist/src/lib/services/aws/cloudfront/types.d.ts +2 -3
- package/dist/src/lib/services/aws/cloudtrail/main.d.ts +5 -5
- package/dist/src/lib/services/aws/cloudtrail/main.js +5 -28
- package/dist/src/lib/services/aws/codebuild/main.d.ts +3 -3
- package/dist/src/lib/services/aws/codebuild/main.js +7 -30
- package/dist/src/lib/services/aws/dynamodb/main.d.ts +3 -3
- package/dist/src/lib/services/aws/dynamodb/main.js +8 -31
- package/dist/src/lib/services/aws/elastic-container-registry/main.d.ts +2 -2
- package/dist/src/lib/services/aws/elastic-container-registry/main.js +4 -27
- package/dist/src/lib/services/aws/elastic-container-service/main.d.ts +10 -10
- package/dist/src/lib/services/aws/elastic-container-service/main.js +27 -50
- package/dist/src/lib/services/aws/elastic-container-service/types.d.ts +4 -4
- package/dist/src/lib/services/aws/elastic-file-system/main.d.ts +3 -3
- package/dist/src/lib/services/aws/elastic-file-system/main.js +12 -35
- package/dist/src/lib/services/aws/elastic-kubernetes-service/main.d.ts +4 -4
- package/dist/src/lib/services/aws/elastic-kubernetes-service/main.js +8 -31
- package/dist/src/lib/services/aws/elasticache/main.d.ts +4 -4
- package/dist/src/lib/services/aws/elasticache/main.js +10 -33
- package/dist/src/lib/services/aws/eventbridge/main.d.ts +13 -13
- package/dist/src/lib/services/aws/eventbridge/main.js +26 -49
- package/dist/src/lib/services/aws/eventbridge/target.d.ts +10 -10
- package/dist/src/lib/services/aws/eventbridge/target.js +6 -29
- package/dist/src/lib/services/aws/evidently/main.d.ts +7 -7
- package/dist/src/lib/services/aws/evidently/main.js +18 -41
- package/dist/src/lib/services/aws/identity-access-management/main.d.ts +48 -49
- package/dist/src/lib/services/aws/identity-access-management/main.js +110 -133
- package/dist/src/lib/services/aws/key-management-service/main.d.ts +2 -2
- package/dist/src/lib/services/aws/key-management-service/main.js +5 -28
- package/dist/src/lib/services/aws/lambda/main.d.ts +11 -13
- package/dist/src/lib/services/aws/lambda/main.js +31 -58
- package/dist/src/lib/services/aws/route53/main.d.ts +9 -9
- package/dist/src/lib/services/aws/route53/main.js +21 -44
- package/dist/src/lib/services/aws/secrets-manager/main.d.ts +5 -6
- package/dist/src/lib/services/aws/secrets-manager/main.js +10 -33
- package/dist/src/lib/services/aws/simple-notification-service/main.d.ts +4 -4
- package/dist/src/lib/services/aws/simple-notification-service/main.js +11 -34
- package/dist/src/lib/services/aws/simple-queue-service/main.d.ts +6 -7
- package/dist/src/lib/services/aws/simple-queue-service/main.js +15 -38
- package/dist/src/lib/services/aws/simple-storage-service/main.d.ts +10 -11
- package/dist/src/lib/services/aws/simple-storage-service/main.js +31 -54
- package/dist/src/lib/services/aws/step-function/main.d.ts +31 -32
- package/dist/src/lib/services/aws/step-function/main.js +33 -57
- package/dist/src/lib/services/aws/systems-manager/main.d.ts +4 -4
- package/dist/src/lib/services/aws/systems-manager/main.js +10 -33
- package/dist/src/lib/services/aws/virtual-private-cloud/main.d.ts +5 -6
- package/dist/src/lib/services/aws/virtual-private-cloud/main.js +14 -37
- package/dist/src/lib/services/aws/web-application-firewall/main.d.ts +3 -3
- package/dist/src/lib/services/aws/web-application-firewall/main.js +8 -31
- package/dist/src/lib/utils/aws/index.d.ts +6 -3
- package/dist/src/lib/utils/aws/index.js +9 -26
- package/package.json +21 -21
- package/src/lib/common/construct.ts +97 -67
- package/src/lib/common/stack.ts +12 -12
- package/src/lib/common/types.ts +2 -2
- package/src/lib/construct/api-to-eventbridge-target/api.ts +31 -22
- package/src/lib/construct/api-to-eventbridge-target/event.ts +9 -9
- package/src/lib/construct/api-to-eventbridge-target/main.ts +56 -41
- package/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +9 -9
- package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +62 -47
- package/src/lib/construct/api-to-lambda-target/api.ts +33 -23
- package/src/lib/construct/api-to-lambda-target/main.ts +24 -18
- package/src/lib/construct/application-configuration/main.ts +31 -24
- package/src/lib/construct/graphql-api-lambda/main.ts +22 -22
- package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +13 -13
- package/src/lib/construct/lambda-with-iam-access/main.ts +25 -25
- package/src/lib/construct/lambda-with-iam-access/types.ts +4 -4
- package/src/lib/construct/rest-api-lambda/main.ts +21 -21
- package/src/lib/construct/rest-api-lambda-with-cache/main.ts +14 -14
- package/src/lib/construct/site-with-ecs-backend/main.ts +79 -60
- package/src/lib/construct/static-asset-deployment/main.ts +6 -6
- package/src/lib/construct/static-site/main.ts +23 -17
- package/src/lib/services/aws/api-gateway/main.ts +42 -36
- package/src/lib/services/aws/api-gateway/types.ts +2 -2
- package/src/lib/services/aws/appconfig/main.ts +19 -19
- package/src/lib/services/aws/certificate-manager/main.ts +14 -14
- package/src/lib/services/aws/certificate-manager/types.ts +2 -2
- package/src/lib/services/aws/cloudfront/main.ts +88 -74
- package/src/lib/services/aws/cloudfront/types.ts +6 -3
- package/src/lib/services/aws/cloudtrail/main.ts +11 -11
- package/src/lib/services/aws/codebuild/main.ts +7 -7
- package/src/lib/services/aws/dynamodb/main.ts +8 -8
- package/src/lib/services/aws/elastic-container-registry/main.ts +4 -4
- package/src/lib/services/aws/elastic-container-service/main.ts +48 -37
- package/src/lib/services/aws/elastic-container-service/types.ts +4 -4
- package/src/lib/services/aws/elastic-file-system/main.ts +16 -16
- package/src/lib/services/aws/elastic-kubernetes-service/main.ts +11 -11
- package/src/lib/services/aws/elasticache/main.ts +10 -10
- package/src/lib/services/aws/eventbridge/main.ts +37 -37
- package/src/lib/services/aws/eventbridge/target.ts +14 -14
- package/src/lib/services/aws/evidently/main.ts +18 -18
- package/src/lib/services/aws/identity-access-management/main.ts +142 -134
- package/src/lib/services/aws/key-management-service/main.ts +5 -5
- package/src/lib/services/aws/lambda/main.ts +65 -59
- package/src/lib/services/aws/route53/main.ts +31 -31
- package/src/lib/services/aws/secrets-manager/main.ts +11 -15
- package/src/lib/services/aws/simple-notification-service/main.ts +13 -13
- package/src/lib/services/aws/simple-queue-service/main.ts +18 -18
- package/src/lib/services/aws/simple-storage-service/main.ts +40 -40
- package/src/lib/services/aws/step-function/main.ts +77 -65
- package/src/lib/services/aws/systems-manager/main.ts +17 -12
- package/src/lib/services/aws/virtual-private-cloud/main.ts +16 -16
- package/src/lib/services/aws/web-application-firewall/main.ts +8 -8
- package/src/lib/utils/aws/index.ts +8 -5
|
@@ -24,21 +24,22 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.CloudFrontManager = void 0;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
27
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
28
|
+
const cf = __importStar(require("aws-cdk-lib/aws-cloudfront"));
|
|
29
|
+
const aws_cloudfront_1 = require("aws-cdk-lib/aws-cloudfront");
|
|
30
|
+
const aws_lambda_1 = require("aws-cdk-lib/aws-lambda");
|
|
31
|
+
const custom_resources_1 = require("aws-cdk-lib/custom-resources");
|
|
31
32
|
const common_1 = require("../../../common");
|
|
32
|
-
const
|
|
33
|
+
const utils_1 = require("../../../utils");
|
|
33
34
|
/**
|
|
34
|
-
* @classdesc Provides operations on AWS
|
|
35
|
+
* @classdesc Provides operations on AWS
|
|
35
36
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
36
37
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
37
38
|
* @example
|
|
38
39
|
* import { CommonConstruct } from '@gradientedge/cdk-utils'
|
|
39
40
|
*
|
|
40
41
|
* class CustomConstruct extends CommonConstruct {
|
|
41
|
-
* constructor(parent:
|
|
42
|
+
* constructor(parent: Construct, id: string, props: common.CommonStackProps) {
|
|
42
43
|
* super(parent, id, props)
|
|
43
44
|
* this.props = props
|
|
44
45
|
* this.cloudFrontManager.createCloudFrontDistribution(
|
|
@@ -55,7 +56,7 @@ const utils = __importStar(require("../../../utils"));
|
|
|
55
56
|
*/
|
|
56
57
|
class CloudFrontManager {
|
|
57
58
|
createOriginAccessIdentity(id, scope, accessBucket) {
|
|
58
|
-
const oai = new
|
|
59
|
+
const oai = new aws_cloudfront_1.OriginAccessIdentity(scope, `${id}`, {
|
|
59
60
|
comment: `${id} - ${scope.props.stage} stage`,
|
|
60
61
|
});
|
|
61
62
|
if (accessBucket)
|
|
@@ -80,14 +81,14 @@ class CloudFrontManager {
|
|
|
80
81
|
throw `Certificate not defined for ${id}`;
|
|
81
82
|
if (!props)
|
|
82
83
|
throw `CloudFront props undefined for ${id}`;
|
|
83
|
-
const distribution = new
|
|
84
|
+
const distribution = new aws_cloudfront_1.CloudFrontWebDistribution(scope, `${id}`, {
|
|
84
85
|
comment: `${id} - ${scope.props.stage} stage`,
|
|
85
86
|
defaultRootObject: props.defaultRootObject,
|
|
86
87
|
enableIpV6: props.enableIpV6,
|
|
87
88
|
enabled: props.enabled ?? true,
|
|
88
89
|
errorConfigurations: props.errorConfigurations,
|
|
89
90
|
geoRestriction: props.geoRestriction,
|
|
90
|
-
httpVersion: props.httpVersion ??
|
|
91
|
+
httpVersion: props.httpVersion ?? aws_cloudfront_1.HttpVersion.HTTP2,
|
|
91
92
|
loggingConfig: {
|
|
92
93
|
bucket: logBucket,
|
|
93
94
|
prefix: 'cloudfront/',
|
|
@@ -101,21 +102,21 @@ class CloudFrontManager {
|
|
|
101
102
|
},
|
|
102
103
|
},
|
|
103
104
|
],
|
|
104
|
-
priceClass: props.priceClass ??
|
|
105
|
-
viewerCertificate:
|
|
105
|
+
priceClass: props.priceClass ?? aws_cloudfront_1.PriceClass.PRICE_CLASS_ALL,
|
|
106
|
+
viewerCertificate: aws_cloudfront_1.ViewerCertificate.fromAcmCertificate(certificate, {
|
|
106
107
|
aliases: aliases,
|
|
107
|
-
securityPolicy:
|
|
108
|
-
sslMethod:
|
|
108
|
+
securityPolicy: aws_cloudfront_1.SecurityPolicyProtocol.TLS_V1_1_2016,
|
|
109
|
+
sslMethod: aws_cloudfront_1.SSLMethod.SNI,
|
|
109
110
|
}),
|
|
110
111
|
webACLId: props.webACLId,
|
|
111
112
|
});
|
|
112
113
|
if (props.tags && props.tags.length > 0) {
|
|
113
114
|
props.tags.forEach(tag => {
|
|
114
|
-
|
|
115
|
+
aws_cdk_lib_1.Tags.of(distribution).add(tag.key, tag.value);
|
|
115
116
|
});
|
|
116
117
|
}
|
|
117
|
-
|
|
118
|
-
|
|
118
|
+
(0, utils_1.createCfnOutput)(`${id}-distributionId`, scope, distribution.distributionId);
|
|
119
|
+
(0, utils_1.createCfnOutput)(`${id}-distributionDomainName`, scope, distribution.distributionDomainName);
|
|
119
120
|
return distribution;
|
|
120
121
|
}
|
|
121
122
|
/**
|
|
@@ -132,7 +133,7 @@ class CloudFrontManager {
|
|
|
132
133
|
* @param defaultFunctionAssociations
|
|
133
134
|
*/
|
|
134
135
|
createDistributionWithS3Origin(id, scope, props, origin, siteBucket, logBucket, oai, certificate, aliases, defaultFunctionAssociations) {
|
|
135
|
-
const distribution = new
|
|
136
|
+
const distribution = new aws_cloudfront_1.Distribution(scope, `${id}`, {
|
|
136
137
|
additionalBehaviors: props.additionalBehaviors,
|
|
137
138
|
certificate: certificate,
|
|
138
139
|
comment: `${id} - ${scope.props.stage} stage`,
|
|
@@ -151,21 +152,21 @@ class CloudFrontManager {
|
|
|
151
152
|
enabled: props.enabled ?? true,
|
|
152
153
|
errorResponses: props.errorResponses,
|
|
153
154
|
geoRestriction: props.geoRestriction,
|
|
154
|
-
httpVersion: props.httpVersion ??
|
|
155
|
+
httpVersion: props.httpVersion ?? aws_cloudfront_1.HttpVersion.HTTP2,
|
|
155
156
|
logBucket: logBucket,
|
|
156
157
|
logFilePrefix: props.logFilePrefix ?? `edge/`,
|
|
157
158
|
logIncludesCookies: props.logIncludesCookies ?? true,
|
|
158
|
-
minimumProtocolVersion: props.minimumProtocolVersion ??
|
|
159
|
-
priceClass: props.priceClass ??
|
|
159
|
+
minimumProtocolVersion: props.minimumProtocolVersion ?? aws_cloudfront_1.SecurityPolicyProtocol.TLS_V1_2_2021,
|
|
160
|
+
priceClass: props.priceClass ?? aws_cloudfront_1.PriceClass.PRICE_CLASS_ALL,
|
|
160
161
|
webAclId: props.webAclId,
|
|
161
162
|
});
|
|
162
163
|
if (props.tags && props.tags.length > 0) {
|
|
163
164
|
props.tags.forEach(tag => {
|
|
164
|
-
|
|
165
|
+
aws_cdk_lib_1.Tags.of(distribution).add(tag.key, tag.value);
|
|
165
166
|
});
|
|
166
167
|
}
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
(0, utils_1.createCfnOutput)(`${id}-distributionId`, scope, distribution.distributionId);
|
|
169
|
+
(0, utils_1.createCfnOutput)(`${id}-distributionDomainName`, scope, distribution.distributionDomainName);
|
|
169
170
|
return distribution;
|
|
170
171
|
}
|
|
171
172
|
/**
|
|
@@ -181,7 +182,7 @@ class CloudFrontManager {
|
|
|
181
182
|
* @param responseHeadersPolicy
|
|
182
183
|
*/
|
|
183
184
|
createDistributionWithHttpOrigin(id, scope, props, origin, domainNames, logBucket, certificate, defaultFunctionAssociations, responseHeadersPolicy) {
|
|
184
|
-
const distribution = new
|
|
185
|
+
const distribution = new aws_cloudfront_1.Distribution(scope, `${id}`, {
|
|
185
186
|
additionalBehaviors: props.additionalBehaviors,
|
|
186
187
|
certificate: certificate,
|
|
187
188
|
comment: `${id} - ${scope.props.stage} stage`,
|
|
@@ -201,21 +202,21 @@ class CloudFrontManager {
|
|
|
201
202
|
enabled: props.enabled ?? true,
|
|
202
203
|
errorResponses: props.errorResponses,
|
|
203
204
|
geoRestriction: props.geoRestriction,
|
|
204
|
-
httpVersion: props.httpVersion ??
|
|
205
|
+
httpVersion: props.httpVersion ?? aws_cloudfront_1.HttpVersion.HTTP2,
|
|
205
206
|
logBucket: logBucket,
|
|
206
207
|
logFilePrefix: props.logFilePrefix ?? `edge/`,
|
|
207
208
|
logIncludesCookies: props.logIncludesCookies ?? true,
|
|
208
|
-
minimumProtocolVersion: props.minimumProtocolVersion ??
|
|
209
|
-
priceClass: props.priceClass ??
|
|
209
|
+
minimumProtocolVersion: props.minimumProtocolVersion ?? aws_cloudfront_1.SecurityPolicyProtocol.TLS_V1_2_2021,
|
|
210
|
+
priceClass: props.priceClass ?? aws_cloudfront_1.PriceClass.PRICE_CLASS_ALL,
|
|
210
211
|
webAclId: props.webAclId,
|
|
211
212
|
});
|
|
212
213
|
if (props.tags && props.tags.length > 0) {
|
|
213
214
|
props.tags.forEach(tag => {
|
|
214
|
-
|
|
215
|
+
aws_cdk_lib_1.Tags.of(distribution).add(tag.key, tag.value);
|
|
215
216
|
});
|
|
216
217
|
}
|
|
217
|
-
|
|
218
|
-
|
|
218
|
+
(0, utils_1.createCfnOutput)(`${id}-distributionId`, scope, distribution.distributionId);
|
|
219
|
+
(0, utils_1.createCfnOutput)(`${id}-distributionDomainName`, scope, distribution.distributionDomainName);
|
|
219
220
|
return distribution;
|
|
220
221
|
}
|
|
221
222
|
/**
|
|
@@ -235,13 +236,13 @@ class CloudFrontManager {
|
|
|
235
236
|
createEdgeFunction(id, scope, props, layers, code, role, environment, vpc, securityGroups, accessPoint, mountPath) {
|
|
236
237
|
if (!props)
|
|
237
238
|
throw `EdgeFunction props undefined for ${id}`;
|
|
238
|
-
const edgeFunction = new
|
|
239
|
+
const edgeFunction = new cf.experimental.EdgeFunction(scope, `${id}`, {
|
|
239
240
|
code: code,
|
|
240
241
|
description: props.description,
|
|
241
242
|
environment: {
|
|
242
243
|
...environment,
|
|
243
244
|
},
|
|
244
|
-
filesystem: accessPoint ?
|
|
245
|
+
filesystem: accessPoint ? aws_lambda_1.FileSystem.fromEfsAccessPoint(accessPoint, mountPath ?? '/mnt/msg') : undefined,
|
|
245
246
|
functionName: `${props.functionName}-${scope.props.stage}`,
|
|
246
247
|
handler: props.handler ?? 'index.handler',
|
|
247
248
|
layers: layers,
|
|
@@ -252,17 +253,17 @@ class CloudFrontManager {
|
|
|
252
253
|
runtime: props.runtime ?? scope.props.nodejsRuntime ?? common_1.CommonStack.NODEJS_RUNTIME,
|
|
253
254
|
securityGroups: securityGroups,
|
|
254
255
|
stackId: `${id}-stack-id-${scope.props.stage}`,
|
|
255
|
-
timeout: props.timeoutInSecs ?
|
|
256
|
+
timeout: props.timeoutInSecs ? aws_cdk_lib_1.Duration.seconds(props.timeoutInSecs) : aws_cdk_lib_1.Duration.minutes(1),
|
|
256
257
|
vpc: vpc,
|
|
257
258
|
});
|
|
258
259
|
if (props.tags && props.tags.length > 0) {
|
|
259
260
|
props.tags.forEach(tag => {
|
|
260
|
-
|
|
261
|
+
aws_cdk_lib_1.Tags.of(edgeFunction).add(tag.key, tag.value);
|
|
261
262
|
});
|
|
262
263
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
(0, utils_1.createCfnOutput)(`${id}-edgeArn`, scope, edgeFunction.edgeArn);
|
|
265
|
+
(0, utils_1.createCfnOutput)(`${id}-edgeFunctionArn`, scope, edgeFunction.functionArn);
|
|
266
|
+
(0, utils_1.createCfnOutput)(`${id}-edgeFunctionName`, scope, edgeFunction.functionName);
|
|
266
267
|
return edgeFunction;
|
|
267
268
|
}
|
|
268
269
|
/**
|
|
@@ -274,16 +275,16 @@ class CloudFrontManager {
|
|
|
274
275
|
* @param paths
|
|
275
276
|
*/
|
|
276
277
|
invalidateCache(id, scope, dockerFilePath, distributionId, paths) {
|
|
277
|
-
new
|
|
278
|
+
new custom_resources_1.AwsCustomResource(scope, `${id}-trigger-codebuild-${new Date().getTime()}`, {
|
|
278
279
|
onCreate: {
|
|
279
280
|
action: 'startBuild',
|
|
280
281
|
parameters: {
|
|
281
282
|
projectName: scope.codeBuildManager.createProjectForCloudfrontInvalidation(id, scope, dockerFilePath, distributionId, paths).projectName,
|
|
282
283
|
},
|
|
283
|
-
physicalResourceId:
|
|
284
|
+
physicalResourceId: custom_resources_1.PhysicalResourceId.fromResponse('build.id'),
|
|
284
285
|
service: 'CodeBuild',
|
|
285
286
|
},
|
|
286
|
-
policy:
|
|
287
|
+
policy: custom_resources_1.AwsCustomResourcePolicy.fromSdkCalls({ resources: custom_resources_1.AwsCustomResourcePolicy.ANY_RESOURCE }),
|
|
287
288
|
});
|
|
288
289
|
}
|
|
289
290
|
/**
|
|
@@ -293,15 +294,15 @@ class CloudFrontManager {
|
|
|
293
294
|
* @param props
|
|
294
295
|
*/
|
|
295
296
|
createCloudfrontFunction(id, scope, props) {
|
|
296
|
-
const cloudfrontFunction = new
|
|
297
|
-
code:
|
|
297
|
+
const cloudfrontFunction = new aws_cloudfront_1.Function(scope, `${id}`, {
|
|
298
|
+
code: aws_cloudfront_1.FunctionCode.fromFile({
|
|
298
299
|
filePath: props.functionFilePath,
|
|
299
300
|
}),
|
|
300
301
|
comment: props.comment,
|
|
301
302
|
functionName: `${props.functionName}-${scope.props.stage}`,
|
|
302
303
|
});
|
|
303
|
-
|
|
304
|
-
|
|
304
|
+
(0, utils_1.createCfnOutput)(`${id}-functionArn`, scope, cloudfrontFunction.functionArn);
|
|
305
|
+
(0, utils_1.createCfnOutput)(`${id}-functionName`, scope, cloudfrontFunction.functionName);
|
|
305
306
|
return cloudfrontFunction;
|
|
306
307
|
}
|
|
307
308
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import { DistributionProps as CfDistributionProps, CloudFrontWebDistributionProps, FunctionProps } from 'aws-cdk-lib/aws-cloudfront';
|
|
1
2
|
import { TagProps } from '../../../types';
|
|
2
|
-
import * as cf from 'aws-cdk-lib/aws-cloudfront';
|
|
3
|
-
import { CloudFrontWebDistributionProps, FunctionProps } from 'aws-cdk-lib/aws-cloudfront';
|
|
4
3
|
/**
|
|
5
4
|
*/
|
|
6
5
|
export interface CloudFrontProps extends CloudFrontWebDistributionProps {
|
|
@@ -8,7 +7,7 @@ export interface CloudFrontProps extends CloudFrontWebDistributionProps {
|
|
|
8
7
|
}
|
|
9
8
|
/**
|
|
10
9
|
*/
|
|
11
|
-
export interface DistributionProps extends
|
|
10
|
+
export interface DistributionProps extends CfDistributionProps {
|
|
12
11
|
tags?: TagProps[];
|
|
13
12
|
}
|
|
14
13
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { CfnTrail } from 'aws-cdk-lib/aws-cloudtrail';
|
|
2
|
+
import { CfnLogGroup } from 'aws-cdk-lib/aws-logs';
|
|
3
|
+
import { CfnBucketPolicy, IBucket } from 'aws-cdk-lib/aws-s3';
|
|
4
4
|
import { CommonConstruct } from '../../../common';
|
|
5
5
|
import { CloudTrailProps } from './types';
|
|
6
6
|
/**
|
|
@@ -37,8 +37,8 @@ export declare class CloudTrailManager {
|
|
|
37
37
|
* @param logBucket
|
|
38
38
|
* @param logBucketPolicy
|
|
39
39
|
*/
|
|
40
|
-
createCloudTrail(id: string, scope: CommonConstruct, props: CloudTrailProps, logGroup:
|
|
41
|
-
cloudTrail:
|
|
40
|
+
createCloudTrail(id: string, scope: CommonConstruct, props: CloudTrailProps, logGroup: CfnLogGroup, dataBucket: IBucket, logBucket: IBucket, logBucketPolicy: CfnBucketPolicy): {
|
|
41
|
+
cloudTrail: CfnTrail;
|
|
42
42
|
cloudTrailRole: import("aws-cdk-lib/aws-iam").CfnRole;
|
|
43
43
|
};
|
|
44
44
|
}
|
|
@@ -1,31 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.CloudTrailManager = void 0;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
4
|
+
const aws_cloudtrail_1 = require("aws-cdk-lib/aws-cloudtrail");
|
|
5
|
+
const utils_1 = require("../../../utils");
|
|
29
6
|
/**
|
|
30
7
|
* @classdesc Provides operations on AWS CloudTrail.
|
|
31
8
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
@@ -64,7 +41,7 @@ class CloudTrailManager {
|
|
|
64
41
|
if (!props)
|
|
65
42
|
throw `CloudTrail props undefined for ${id}`;
|
|
66
43
|
const role = scope.iamManager.createRoleForCloudTrail(`${id}Role`, scope, logGroup);
|
|
67
|
-
const cloudTrail = new
|
|
44
|
+
const cloudTrail = new aws_cloudtrail_1.CfnTrail(scope, `${id}`, {
|
|
68
45
|
cloudWatchLogsLogGroupArn: logGroup.attrArn,
|
|
69
46
|
cloudWatchLogsRoleArn: role.attrArn,
|
|
70
47
|
enableLogFileValidation: props.enableLogFileValidation,
|
|
@@ -91,8 +68,8 @@ class CloudTrailManager {
|
|
|
91
68
|
cloudTrail.addDependency(logBucketPolicy);
|
|
92
69
|
cloudTrail.addDependency(logGroup);
|
|
93
70
|
cloudTrail.addDependency(role);
|
|
94
|
-
|
|
95
|
-
|
|
71
|
+
(0, utils_1.createCfnOutput)(`${id}-trailName`, scope, cloudTrail.trailName);
|
|
72
|
+
(0, utils_1.createCfnOutput)(`${id}-trailArn`, scope, cloudTrail.attrArn);
|
|
96
73
|
return { cloudTrail, cloudTrailRole: role };
|
|
97
74
|
}
|
|
98
75
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Project } from 'aws-cdk-lib/aws-codebuild';
|
|
2
2
|
import { CommonConstruct } from '../../../common';
|
|
3
3
|
/**
|
|
4
4
|
* @classdesc Provides operations on AWS Code Build.
|
|
@@ -23,7 +23,7 @@ export declare class CodeBuildManager {
|
|
|
23
23
|
* @param scope
|
|
24
24
|
* @param dockerfilePath
|
|
25
25
|
*/
|
|
26
|
-
createImageForCloudfrontInvalidation(id: string, scope: CommonConstruct, dockerfilePath: string): cdk.
|
|
26
|
+
createImageForCloudfrontInvalidation(id: string, scope: CommonConstruct, dockerfilePath: string): import("aws-cdk-lib/aws-ecr-assets").DockerImageAsset;
|
|
27
27
|
/**
|
|
28
28
|
*
|
|
29
29
|
* @param id
|
|
@@ -32,5 +32,5 @@ export declare class CodeBuildManager {
|
|
|
32
32
|
* @param distributionId
|
|
33
33
|
* @param paths
|
|
34
34
|
*/
|
|
35
|
-
createProjectForCloudfrontInvalidation(id: string, scope: CommonConstruct, dockerFilepath: string, distributionId: string, paths?: string):
|
|
35
|
+
createProjectForCloudfrontInvalidation(id: string, scope: CommonConstruct, dockerFilepath: string, distributionId: string, paths?: string): Project;
|
|
36
36
|
}
|
|
@@ -1,31 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.CodeBuildManager = void 0;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
4
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
5
|
+
const aws_codebuild_1 = require("aws-cdk-lib/aws-codebuild");
|
|
29
6
|
/**
|
|
30
7
|
* @classdesc Provides operations on AWS Code Build.
|
|
31
8
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
@@ -62,8 +39,8 @@ class CodeBuildManager {
|
|
|
62
39
|
*/
|
|
63
40
|
createProjectForCloudfrontInvalidation(id, scope, dockerFilepath, distributionId, paths) {
|
|
64
41
|
const invalidationPaths = paths ?? '/*';
|
|
65
|
-
return new
|
|
66
|
-
buildSpec:
|
|
42
|
+
return new aws_codebuild_1.Project(scope, `${id}-install-deps-project`, {
|
|
43
|
+
buildSpec: aws_codebuild_1.BuildSpec.fromObject({
|
|
67
44
|
phases: {
|
|
68
45
|
build: {
|
|
69
46
|
commands: [
|
|
@@ -74,8 +51,8 @@ class CodeBuildManager {
|
|
|
74
51
|
version: '0.1',
|
|
75
52
|
}),
|
|
76
53
|
environment: {
|
|
77
|
-
buildImage:
|
|
78
|
-
computeType:
|
|
54
|
+
buildImage: aws_codebuild_1.LinuxBuildImage.fromDockerRegistry(this.createImageForCloudfrontInvalidation(id, scope, dockerFilepath).imageUri),
|
|
55
|
+
computeType: aws_codebuild_1.ComputeType.SMALL,
|
|
79
56
|
privileged: true,
|
|
80
57
|
},
|
|
81
58
|
logging: {
|
|
@@ -87,7 +64,7 @@ class CodeBuildManager {
|
|
|
87
64
|
},
|
|
88
65
|
},
|
|
89
66
|
role: scope.iamManager.roleForCloudfrontInvalidation(id, scope),
|
|
90
|
-
timeout:
|
|
67
|
+
timeout: aws_cdk_lib_1.Duration.minutes(5),
|
|
91
68
|
});
|
|
92
69
|
}
|
|
93
70
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Table } from 'aws-cdk-lib/aws-dynamodb';
|
|
2
2
|
import { CommonConstruct } from '../../../common';
|
|
3
3
|
import { TableProps } from './types';
|
|
4
4
|
/**
|
|
5
|
-
* @classdesc Provides operations on AWS DynamoDB
|
|
5
|
+
* @classdesc Provides operations on AWS DynamoDB
|
|
6
6
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
7
7
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
8
8
|
* @example
|
|
@@ -24,5 +24,5 @@ export declare class DynamodbManager {
|
|
|
24
24
|
* @param scope scope in which this resource is defined
|
|
25
25
|
* @param props table props
|
|
26
26
|
*/
|
|
27
|
-
createTable(id: string, scope: CommonConstruct, props: TableProps):
|
|
27
|
+
createTable(id: string, scope: CommonConstruct, props: TableProps): Table;
|
|
28
28
|
}
|
|
@@ -1,34 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.DynamodbManager = void 0;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
4
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
5
|
+
const aws_dynamodb_1 = require("aws-cdk-lib/aws-dynamodb");
|
|
6
|
+
const utils_1 = require("../../../utils");
|
|
30
7
|
/**
|
|
31
|
-
* @classdesc Provides operations on AWS DynamoDB
|
|
8
|
+
* @classdesc Provides operations on AWS DynamoDB
|
|
32
9
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
33
10
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
34
11
|
* @example
|
|
@@ -53,7 +30,7 @@ class DynamodbManager {
|
|
|
53
30
|
createTable(id, scope, props) {
|
|
54
31
|
if (!props)
|
|
55
32
|
throw `Table props undefined for ${id}`;
|
|
56
|
-
const table = new
|
|
33
|
+
const table = new aws_dynamodb_1.Table(scope, `${id}`, {
|
|
57
34
|
billingMode: props.billingMode,
|
|
58
35
|
contributorInsightsEnabled: props.contributorInsightsEnabled,
|
|
59
36
|
encryption: props.encryption,
|
|
@@ -74,11 +51,11 @@ class DynamodbManager {
|
|
|
74
51
|
});
|
|
75
52
|
if (props.tags && props.tags.length > 0) {
|
|
76
53
|
props.tags.forEach(tag => {
|
|
77
|
-
|
|
54
|
+
aws_cdk_lib_1.Tags.of(table).add(tag.key, tag.value);
|
|
78
55
|
});
|
|
79
56
|
}
|
|
80
|
-
|
|
81
|
-
|
|
57
|
+
(0, utils_1.createCfnOutput)(`${id}-tableName`, scope, table.tableName);
|
|
58
|
+
(0, utils_1.createCfnOutput)(`${id}-tableArn`, scope, table.tableArn);
|
|
82
59
|
return table;
|
|
83
60
|
}
|
|
84
61
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';
|
|
2
2
|
import { CommonConstruct } from '../../../common';
|
|
3
3
|
/**
|
|
4
4
|
* @classdesc Provides operations on AWS Elastic Container Registry.
|
|
@@ -23,5 +23,5 @@ export declare class EcrManager {
|
|
|
23
23
|
* @param scope scope in which this resource is defined
|
|
24
24
|
* @param dockerfilePath
|
|
25
25
|
*/
|
|
26
|
-
createDockerImage(id: string, scope: CommonConstruct, dockerfilePath: string):
|
|
26
|
+
createDockerImage(id: string, scope: CommonConstruct, dockerfilePath: string): DockerImageAsset;
|
|
27
27
|
}
|
|
@@ -1,31 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.EcrManager = void 0;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
4
|
+
const aws_ecr_assets_1 = require("aws-cdk-lib/aws-ecr-assets");
|
|
5
|
+
const utils_1 = require("../../../utils");
|
|
29
6
|
/**
|
|
30
7
|
* @classdesc Provides operations on AWS Elastic Container Registry.
|
|
31
8
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
@@ -50,10 +27,10 @@ class EcrManager {
|
|
|
50
27
|
* @param dockerfilePath
|
|
51
28
|
*/
|
|
52
29
|
createDockerImage(id, scope, dockerfilePath) {
|
|
53
|
-
const asset = new
|
|
30
|
+
const asset = new aws_ecr_assets_1.DockerImageAsset(scope, `${id}`, {
|
|
54
31
|
directory: dockerfilePath,
|
|
55
32
|
});
|
|
56
|
-
|
|
33
|
+
(0, utils_1.createCfnOutput)(`${id}-dockerImageArn`, scope, asset.imageUri);
|
|
57
34
|
return asset;
|
|
58
35
|
}
|
|
59
36
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { IVpc } from 'aws-cdk-lib/aws-ec2';
|
|
2
|
+
import { Cluster, ContainerImage, ICluster, TaskDefinition } from 'aws-cdk-lib/aws-ecs';
|
|
3
|
+
import { ApplicationLoadBalancedFargateService } from 'aws-cdk-lib/aws-ecs-patterns';
|
|
4
|
+
import { Role } from 'aws-cdk-lib/aws-iam';
|
|
5
|
+
import { ILogGroup } from 'aws-cdk-lib/aws-logs';
|
|
6
6
|
import { CommonConstruct } from '../../../common';
|
|
7
7
|
import { EcsApplicationLoadBalancedFargateServiceProps, EcsClusterProps, EcsTaskProps } from './types';
|
|
8
8
|
/**
|
|
@@ -13,7 +13,7 @@ import { EcsApplicationLoadBalancedFargateServiceProps, EcsClusterProps, EcsTask
|
|
|
13
13
|
* import { CommonConstruct } from '@gradientedge/cdk-utils'
|
|
14
14
|
*
|
|
15
15
|
* class CustomConstruct extends CommonConstruct {
|
|
16
|
-
* constructor(parent:
|
|
16
|
+
* constructor(parent: Construct, id: string, props: common.CommonStackProps) {
|
|
17
17
|
* super(parent, id, props)
|
|
18
18
|
* this.props = props
|
|
19
19
|
* this.ecsManager.createEcsCluster('MyCluster', this, vpc)
|
|
@@ -29,7 +29,7 @@ export declare class EcsManager {
|
|
|
29
29
|
* @param props
|
|
30
30
|
* @param vpc
|
|
31
31
|
*/
|
|
32
|
-
createEcsCluster(id: string, scope: CommonConstruct, props: EcsClusterProps, vpc:
|
|
32
|
+
createEcsCluster(id: string, scope: CommonConstruct, props: EcsClusterProps, vpc: IVpc): Cluster;
|
|
33
33
|
/**
|
|
34
34
|
* @summary Method to create an ecs fargate task
|
|
35
35
|
* @param id scoped id of the resource
|
|
@@ -43,14 +43,14 @@ export declare class EcsManager {
|
|
|
43
43
|
* @param secrets
|
|
44
44
|
* @param command
|
|
45
45
|
*/
|
|
46
|
-
createEcsFargateTask(id: string, scope: CommonConstruct, props: EcsTaskProps, cluster:
|
|
46
|
+
createEcsFargateTask(id: string, scope: CommonConstruct, props: EcsTaskProps, cluster: ICluster, role: Role, logGroup: ILogGroup, containerImage: ContainerImage, environment?: any, secrets?: any, command?: string[]): TaskDefinition;
|
|
47
47
|
/**
|
|
48
|
-
* @summary Method to create an application
|
|
48
|
+
* @summary Method to create an application load balanced ecs fargate task
|
|
49
49
|
* @param id scoped id of the resource
|
|
50
50
|
* @param scope scope in which this resource is defined
|
|
51
51
|
* @param props
|
|
52
52
|
* @param cluster
|
|
53
53
|
* @param logGroup
|
|
54
54
|
*/
|
|
55
|
-
createLoadBalancedFargateService(id: string, scope: CommonConstruct, props: EcsApplicationLoadBalancedFargateServiceProps, cluster:
|
|
55
|
+
createLoadBalancedFargateService(id: string, scope: CommonConstruct, props: EcsApplicationLoadBalancedFargateServiceProps, cluster: ICluster, logGroup: ILogGroup): ApplicationLoadBalancedFargateService;
|
|
56
56
|
}
|