@gradientedge/cdk-utils 8.124.0 → 8.125.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/aws/services/api-gateway/main.d.ts +2 -2
- package/dist/src/lib/aws/services/api-gateway/main.js +8 -28
- package/dist/src/lib/aws/services/appconfig/main.d.ts +1 -1
- package/dist/src/lib/aws/services/appconfig/main.js +6 -13
- package/dist/src/lib/aws/services/cloudfront/main.js +6 -18
- package/dist/src/lib/aws/services/cloudtrail/main.js +1 -4
- package/dist/src/lib/aws/services/cloudwatch/main.js +15 -56
- package/dist/src/lib/aws/services/dynamodb/main.js +1 -16
- package/dist/src/lib/aws/services/elastic-container-service/main.js +11 -38
- package/dist/src/lib/aws/services/elasticache/main.js +4 -34
- package/dist/src/lib/aws/services/eventbridge/main.js +9 -14
- package/dist/src/lib/aws/services/key-management-service/main.js +1 -9
- package/dist/src/lib/aws/services/lambda/main.js +45 -63
- package/dist/src/lib/aws/services/secrets-manager/main.js +1 -1
- package/dist/src/lib/aws/services/simple-notification-service/main.js +2 -2
- package/dist/src/lib/aws/services/simple-queue-service/main.js +1 -8
- package/dist/src/lib/aws/services/simple-storage-service/main.js +3 -22
- package/dist/src/lib/aws/services/step-function/main.js +33 -110
- package/dist/src/lib/aws/services/systems-manager/main.js +3 -3
- package/dist/src/lib/aws/services/virtual-private-cloud/main.js +1 -2
- package/dist/src/lib/aws/services/web-application-firewall/main.js +2 -7
- package/package.json +13 -13
- package/src/lib/aws/services/api-gateway/main.ts +8 -28
- package/src/lib/aws/services/appconfig/main.ts +6 -13
- package/src/lib/aws/services/cloudfront/main.ts +6 -18
- package/src/lib/aws/services/cloudtrail/main.ts +1 -4
- package/src/lib/aws/services/cloudwatch/main.ts +15 -56
- package/src/lib/aws/services/dynamodb/main.ts +1 -16
- package/src/lib/aws/services/elastic-container-service/main.ts +11 -38
- package/src/lib/aws/services/elasticache/main.ts +4 -34
- package/src/lib/aws/services/eventbridge/main.ts +9 -14
- package/src/lib/aws/services/key-management-service/main.ts +1 -9
- package/src/lib/aws/services/lambda/main.ts +54 -72
- package/src/lib/aws/services/secrets-manager/main.ts +1 -1
- package/src/lib/aws/services/simple-notification-service/main.ts +2 -2
- package/src/lib/aws/services/simple-queue-service/main.ts +1 -8
- package/src/lib/aws/services/simple-storage-service/main.ts +3 -22
- package/src/lib/aws/services/step-function/main.ts +33 -110
- package/src/lib/aws/services/systems-manager/main.ts +3 -3
- package/src/lib/aws/services/virtual-private-cloud/main.ts +1 -2
- package/src/lib/aws/services/web-application-firewall/main.ts +2 -7
|
@@ -46,42 +46,22 @@ export class ApiManager {
|
|
|
46
46
|
public createLambdaRestApi(id: string, scope: CommonConstruct, props: LambdaRestApiProps, lambdaFunction: IFunction) {
|
|
47
47
|
if (!props) throw `Api props undefined for ${id}`
|
|
48
48
|
const api = new LambdaRestApi(scope, `${id}`, {
|
|
49
|
-
|
|
49
|
+
...props,
|
|
50
50
|
cloudWatchRole: props.cloudWatchRole || false,
|
|
51
|
-
defaultCorsPreflightOptions: props.defaultCorsPreflightOptions,
|
|
52
|
-
defaultMethodOptions: props.defaultMethodOptions,
|
|
53
51
|
deploy: props.deploy || true,
|
|
54
52
|
deployOptions: {
|
|
55
|
-
|
|
56
|
-
accessLogFormat: props.deployOptions?.accessLogFormat,
|
|
57
|
-
cacheClusterEnabled: props.deployOptions?.cacheClusterEnabled,
|
|
58
|
-
cacheClusterSize: props.deployOptions?.cacheClusterSize,
|
|
59
|
-
cachingEnabled: props.deployOptions?.cachingEnabled,
|
|
60
|
-
clientCertificateId: props.deployOptions?.clientCertificateId,
|
|
61
|
-
dataTraceEnabled: props.deployOptions?.dataTraceEnabled,
|
|
53
|
+
...props.deployOptions,
|
|
62
54
|
description: `${id} - ${scope.props.stage} stage`,
|
|
63
|
-
documentationVersion: props.deployOptions?.documentationVersion,
|
|
64
|
-
loggingLevel: props.deployOptions?.loggingLevel,
|
|
65
|
-
methodOptions: props.deployOptions?.methodOptions,
|
|
66
|
-
metricsEnabled: props.deployOptions?.metricsEnabled,
|
|
67
55
|
stageName: scope.props.stage,
|
|
68
|
-
tracingEnabled: props.deployOptions?.tracingEnabled,
|
|
69
|
-
variables: props.deployOptions?.variables,
|
|
70
56
|
},
|
|
71
|
-
domainName: props.domainName,
|
|
72
57
|
endpointConfiguration: {
|
|
58
|
+
...props.endpointConfiguration,
|
|
73
59
|
types: props.endpointConfiguration?.types || [EndpointType.REGIONAL],
|
|
74
|
-
vpcEndpoints: props.endpointConfiguration?.vpcEndpoints,
|
|
75
60
|
},
|
|
76
|
-
endpointTypes: props.endpointTypes,
|
|
77
61
|
failOnWarnings: props.failOnWarnings || false,
|
|
78
62
|
handler: lambdaFunction,
|
|
79
|
-
minCompressionSize: props.minCompressionSize,
|
|
80
|
-
parameters: props.parameters,
|
|
81
|
-
policy: props.policy,
|
|
82
63
|
proxy: props.proxy ?? true,
|
|
83
64
|
restApiName: `${props.restApiName}-${scope.props.stage}`,
|
|
84
|
-
retainDeployments: props.retainDeployments,
|
|
85
65
|
})
|
|
86
66
|
|
|
87
67
|
if (props.tags && !_.isEmpty(props.tags)) {
|
|
@@ -105,8 +85,8 @@ export class ApiManager {
|
|
|
105
85
|
*/
|
|
106
86
|
public createApiDomain(id: string, scope: CommonConstruct, domainName: string, certificate: ICertificate) {
|
|
107
87
|
const apiDomain = new DomainName(scope, `${id}`, {
|
|
108
|
-
certificate
|
|
109
|
-
domainName
|
|
88
|
+
certificate,
|
|
89
|
+
domainName,
|
|
110
90
|
endpointType: scope.isProductionStage() ? EndpointType.EDGE : EndpointType.REGIONAL,
|
|
111
91
|
securityPolicy: SecurityPolicy.TLS_1_2,
|
|
112
92
|
})
|
|
@@ -189,11 +169,11 @@ export class ApiManager {
|
|
|
189
169
|
* @summary Method to create an api deployment
|
|
190
170
|
* @param id
|
|
191
171
|
* @param scope
|
|
192
|
-
* @param
|
|
172
|
+
* @param api
|
|
193
173
|
*/
|
|
194
|
-
public createApiDeployment(id: string, scope: CommonConstruct,
|
|
174
|
+
public createApiDeployment(id: string, scope: CommonConstruct, api: IRestApi) {
|
|
195
175
|
new Deployment(scope, `${id}`, {
|
|
196
|
-
api
|
|
176
|
+
api,
|
|
197
177
|
retainDeployments: false,
|
|
198
178
|
})
|
|
199
179
|
}
|
|
@@ -50,9 +50,8 @@ export class AppConfigManager {
|
|
|
50
50
|
if (!props) throw `AppConfig props undefined for ${id}`
|
|
51
51
|
|
|
52
52
|
const application = new CfnApplication(scope, `${id}`, {
|
|
53
|
-
|
|
53
|
+
...props.application,
|
|
54
54
|
name: `${props.application.name}-${scope.props.stage}`,
|
|
55
|
-
tags: props.application.tags,
|
|
56
55
|
})
|
|
57
56
|
|
|
58
57
|
createCfnOutput(`${id}-ApplicationId`, scope, Fn.ref(application.logicalId))
|
|
@@ -78,11 +77,9 @@ export class AppConfigManager {
|
|
|
78
77
|
if (!props) throw `AppConfig props undefined for ${id}`
|
|
79
78
|
|
|
80
79
|
const environment = new CfnEnvironment(scope, `${id}`, {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
monitors: props.environment.monitors,
|
|
80
|
+
...props.environment,
|
|
81
|
+
applicationId,
|
|
84
82
|
name: props.environment.name ?? scope.props.stage,
|
|
85
|
-
tags: props.environment.tags,
|
|
86
83
|
})
|
|
87
84
|
|
|
88
85
|
createCfnOutput(`${id}-configurationEnvironmentId`, scope, Fn.ref(environment.logicalId))
|
|
@@ -93,7 +90,7 @@ export class AppConfigManager {
|
|
|
93
90
|
|
|
94
91
|
/**
|
|
95
92
|
* @summary Method to create an AppConfig Configuration Profile for a given application
|
|
96
|
-
* -
|
|
93
|
+
* - The <b>locationUri</b> is defaulted to <i>hosted</i> if undefined</p>
|
|
97
94
|
* @param id scoped id of the resource
|
|
98
95
|
* @param scope scope in which this resource is defined
|
|
99
96
|
* @param applicationId id of the application
|
|
@@ -109,14 +106,10 @@ export class AppConfigManager {
|
|
|
109
106
|
if (!props) throw `AppConfig props undefined for ${id}`
|
|
110
107
|
|
|
111
108
|
const profile = new CfnConfigurationProfile(scope, `${id}`, {
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
...props.configurationProfile,
|
|
110
|
+
applicationId,
|
|
114
111
|
locationUri: props.configurationProfile.locationUri || 'hosted',
|
|
115
112
|
name: `${props.configurationProfile.name}-${scope.props.stage}`,
|
|
116
|
-
retrievalRoleArn: props.configurationProfile.retrievalRoleArn,
|
|
117
|
-
tags: props.configurationProfile.tags,
|
|
118
|
-
type: props.configurationProfile.type,
|
|
119
|
-
validators: props.configurationProfile.validators,
|
|
120
113
|
})
|
|
121
114
|
|
|
122
115
|
createCfnOutput(`${id}-configurationProfileId`, scope, Fn.ref(profile.logicalId))
|
|
@@ -87,12 +87,9 @@ export class CloudFrontManager {
|
|
|
87
87
|
if (!props) throw `CloudFront props undefined for ${id}`
|
|
88
88
|
|
|
89
89
|
const distribution = new CloudFrontWebDistribution(scope, `${id}`, {
|
|
90
|
+
...props,
|
|
90
91
|
comment: `${id} - ${scope.props.stage} stage`,
|
|
91
|
-
defaultRootObject: props.defaultRootObject,
|
|
92
|
-
enableIpV6: props.enableIpV6,
|
|
93
92
|
enabled: props.enabled ?? true,
|
|
94
|
-
errorConfigurations: props.errorConfigurations,
|
|
95
|
-
geoRestriction: props.geoRestriction,
|
|
96
93
|
httpVersion: props.httpVersion ?? HttpVersion.HTTP2,
|
|
97
94
|
loggingConfig: {
|
|
98
95
|
bucket: logBucket,
|
|
@@ -113,7 +110,6 @@ export class CloudFrontManager {
|
|
|
113
110
|
securityPolicy: SecurityPolicyProtocol.TLS_V1_1_2016,
|
|
114
111
|
sslMethod: SSLMethod.SNI,
|
|
115
112
|
}),
|
|
116
|
-
webACLId: props.webACLId,
|
|
117
113
|
})
|
|
118
114
|
|
|
119
115
|
if (props.tags && !_.isEmpty(props.tags)) {
|
|
@@ -154,31 +150,23 @@ export class CloudFrontManager {
|
|
|
154
150
|
defaultFunctionAssociations?: FunctionAssociation[]
|
|
155
151
|
) {
|
|
156
152
|
const distribution = new Distribution(scope, `${id}`, {
|
|
157
|
-
|
|
158
|
-
certificate
|
|
153
|
+
...props,
|
|
154
|
+
certificate,
|
|
159
155
|
comment: `${id} - ${scope.props.stage} stage`,
|
|
160
156
|
defaultBehavior: {
|
|
161
|
-
|
|
162
|
-
edgeLambdas: props.defaultBehavior ? props.defaultBehavior.edgeLambdas : undefined,
|
|
157
|
+
...props.defaultBehavior,
|
|
163
158
|
functionAssociations: defaultFunctionAssociations ?? undefined,
|
|
164
|
-
origin
|
|
165
|
-
originRequestPolicy: props.defaultBehavior ? props.defaultBehavior.originRequestPolicy : undefined,
|
|
166
|
-
viewerProtocolPolicy: props.defaultBehavior ? props.defaultBehavior.viewerProtocolPolicy : undefined,
|
|
159
|
+
origin,
|
|
167
160
|
},
|
|
168
|
-
defaultRootObject: props.defaultRootObject,
|
|
169
161
|
domainNames: aliases,
|
|
170
|
-
enableIpv6: props.enableIpv6,
|
|
171
162
|
enableLogging: props.enableLogging ?? true,
|
|
172
163
|
enabled: props.enabled ?? true,
|
|
173
|
-
errorResponses: props.errorResponses,
|
|
174
|
-
geoRestriction: props.geoRestriction,
|
|
175
164
|
httpVersion: props.httpVersion ?? HttpVersion.HTTP2,
|
|
176
|
-
logBucket
|
|
165
|
+
logBucket,
|
|
177
166
|
logFilePrefix: props.logFilePrefix ?? `edge/`,
|
|
178
167
|
logIncludesCookies: props.logIncludesCookies ?? true,
|
|
179
168
|
minimumProtocolVersion: props.minimumProtocolVersion ?? SecurityPolicyProtocol.TLS_V1_2_2021,
|
|
180
169
|
priceClass: props.priceClass ?? PriceClass.PRICE_CLASS_ALL,
|
|
181
|
-
webAclId: props.webAclId,
|
|
182
170
|
})
|
|
183
171
|
|
|
184
172
|
if (props.tags && !_.isEmpty(props.tags)) {
|
|
@@ -53,9 +53,9 @@ export class CloudTrailManager {
|
|
|
53
53
|
const role = scope.iamManager.createRoleForCloudTrail(`${id}Role`, scope, logGroup)
|
|
54
54
|
|
|
55
55
|
const cloudTrail = new CfnTrail(scope, `${id}`, {
|
|
56
|
+
...props,
|
|
56
57
|
cloudWatchLogsLogGroupArn: logGroup.attrArn,
|
|
57
58
|
cloudWatchLogsRoleArn: role.attrArn,
|
|
58
|
-
enableLogFileValidation: props.enableLogFileValidation,
|
|
59
59
|
eventSelectors: [
|
|
60
60
|
{
|
|
61
61
|
dataResources: [
|
|
@@ -68,9 +68,6 @@ export class CloudTrailManager {
|
|
|
68
68
|
readWriteType: 'WriteOnly',
|
|
69
69
|
},
|
|
70
70
|
],
|
|
71
|
-
includeGlobalServiceEvents: props.includeGlobalServiceEvents,
|
|
72
|
-
isLogging: props.isLogging,
|
|
73
|
-
isMultiRegionTrail: props.isMultiRegionTrail,
|
|
74
71
|
s3BucketName: logBucket.bucketName,
|
|
75
72
|
s3KeyPrefix: `logs-${props.trailName}`,
|
|
76
73
|
tags: [{ key: 'service', value: scope.props.name }],
|
|
@@ -62,19 +62,14 @@ export class CloudWatchManager {
|
|
|
62
62
|
})
|
|
63
63
|
|
|
64
64
|
const expression = new watch.MathExpression({
|
|
65
|
+
...props,
|
|
65
66
|
expression: props.expression,
|
|
66
67
|
period: props.periodInSecs ? cdk.Duration.seconds(props.periodInSecs) : cdk.Duration.minutes(5),
|
|
67
68
|
usingMetrics: metrics,
|
|
68
69
|
})
|
|
69
70
|
|
|
70
71
|
const alarm = expression.createAlarm(scope, `${id}`, {
|
|
71
|
-
|
|
72
|
-
alarmName: props.alarmName,
|
|
73
|
-
comparisonOperator: props.comparisonOperator,
|
|
74
|
-
datapointsToAlarm: props.datapointsToAlarm,
|
|
75
|
-
evaluationPeriods: props.evaluationPeriods,
|
|
76
|
-
threshold: props.threshold,
|
|
77
|
-
treatMissingData: props.treatMissingData,
|
|
72
|
+
...props,
|
|
78
73
|
})
|
|
79
74
|
|
|
80
75
|
utils.createCfnOutput(`${id}-alarmArn`, scope, alarm.alarmArn)
|
|
@@ -94,13 +89,7 @@ export class CloudWatchManager {
|
|
|
94
89
|
if (!props) throw `Alarm props undefined for ${id}`
|
|
95
90
|
|
|
96
91
|
const alarm = metric.createAlarm(scope, `${id}`, {
|
|
97
|
-
|
|
98
|
-
alarmName: props.alarmName,
|
|
99
|
-
comparisonOperator: props.comparisonOperator,
|
|
100
|
-
datapointsToAlarm: props.datapointsToAlarm,
|
|
101
|
-
evaluationPeriods: props.evaluationPeriods,
|
|
102
|
-
threshold: props.threshold,
|
|
103
|
-
treatMissingData: props.treatMissingData,
|
|
92
|
+
...props,
|
|
104
93
|
})
|
|
105
94
|
|
|
106
95
|
utils.createCfnOutput(`${id}-alarmArn`, scope, alarm.alarmArn)
|
|
@@ -120,11 +109,10 @@ export class CloudWatchManager {
|
|
|
120
109
|
if (!props) throw `Dashboard props undefined for ${id}`
|
|
121
110
|
|
|
122
111
|
const dashboard = new watch.Dashboard(scope, `${id}`, {
|
|
123
|
-
|
|
112
|
+
...props,
|
|
124
113
|
end: CloudWatchManager.determineTimeRange(props.end),
|
|
125
|
-
periodOverride: props.periodOverride,
|
|
126
114
|
start: CloudWatchManager.determineTimeRange(props.start),
|
|
127
|
-
widgets
|
|
115
|
+
widgets,
|
|
128
116
|
})
|
|
129
117
|
|
|
130
118
|
utils.createCfnOutput(`${id}-dashboardName`, scope, props.dashboardName)
|
|
@@ -357,9 +345,7 @@ export class CloudWatchManager {
|
|
|
357
345
|
public createTextWidget(id: string, scope: CommonConstruct, props: TextWidgetProps) {
|
|
358
346
|
if (!props) throw `Widget props undefined for ${id}`
|
|
359
347
|
const widget = new watch.TextWidget({
|
|
360
|
-
|
|
361
|
-
markdown: props.markdown,
|
|
362
|
-
width: props.width,
|
|
348
|
+
...props,
|
|
363
349
|
})
|
|
364
350
|
|
|
365
351
|
if (props.positionX && props.positionY) widget.position(props.positionX, props.positionY)
|
|
@@ -377,14 +363,9 @@ export class CloudWatchManager {
|
|
|
377
363
|
public createSingleValueWidget(id: string, scope: CommonConstruct, props: NumericWidgetProps, metrics: IMetric[]) {
|
|
378
364
|
if (!props) throw `Widget props undefined for ${id}`
|
|
379
365
|
const widget = new watch.SingleValueWidget({
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
metrics: metrics,
|
|
366
|
+
...props,
|
|
367
|
+
metrics,
|
|
383
368
|
region: props.region ?? scope.props.region,
|
|
384
|
-
setPeriodToTimeRange: props.setPeriodToTimeRange,
|
|
385
|
-
sparkline: props.sparkline,
|
|
386
|
-
title: props.title,
|
|
387
|
-
width: props.width,
|
|
388
369
|
})
|
|
389
370
|
|
|
390
371
|
if (props.positionX && props.positionY) widget.position(props.positionX, props.positionY)
|
|
@@ -402,14 +383,9 @@ export class CloudWatchManager {
|
|
|
402
383
|
public createGuageWidget(id: string, scope: CommonConstruct, props: GuageWidgetProps, metrics: IMetric[]) {
|
|
403
384
|
if (!props) throw `Widget props undefined for ${id}`
|
|
404
385
|
const widget = new watch.GaugeWidget({
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
metrics: metrics,
|
|
386
|
+
...props,
|
|
387
|
+
metrics,
|
|
408
388
|
region: props.region ?? scope.props.region,
|
|
409
|
-
setPeriodToTimeRange: props.setPeriodToTimeRange,
|
|
410
|
-
statistic: props.statistic,
|
|
411
|
-
title: props.title,
|
|
412
|
-
width: props.width,
|
|
413
389
|
})
|
|
414
390
|
|
|
415
391
|
if (props.positionX && props.positionY) widget.position(props.positionX, props.positionY)
|
|
@@ -434,20 +410,10 @@ export class CloudWatchManager {
|
|
|
434
410
|
) {
|
|
435
411
|
if (!props) throw `Widget props undefined for ${id}`
|
|
436
412
|
const widget = new watch.GraphWidget({
|
|
437
|
-
|
|
413
|
+
...props,
|
|
438
414
|
left: leftYMetrics,
|
|
439
|
-
leftAnnotations: props.leftAnnotations,
|
|
440
|
-
leftYAxis: props.leftYAxis,
|
|
441
|
-
legendPosition: props.legendPosition,
|
|
442
|
-
liveData: props.liveData,
|
|
443
415
|
region: props.region ?? scope.props.region,
|
|
444
416
|
right: rightYMetrics,
|
|
445
|
-
rightAnnotations: props.rightAnnotations,
|
|
446
|
-
rightYAxis: props.rightYAxis,
|
|
447
|
-
stacked: props.stacked,
|
|
448
|
-
title: props.title,
|
|
449
|
-
view: props.view,
|
|
450
|
-
width: props.width,
|
|
451
417
|
})
|
|
452
418
|
|
|
453
419
|
if (props.positionX && props.positionY) widget.position(props.positionX, props.positionY)
|
|
@@ -470,10 +436,8 @@ export class CloudWatchManager {
|
|
|
470
436
|
) {
|
|
471
437
|
if (!props) throw `Widget props undefined for ${id}`
|
|
472
438
|
const widget = new watch.AlarmStatusWidget({
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
title: props.title,
|
|
476
|
-
width: props.width,
|
|
439
|
+
...props,
|
|
440
|
+
alarms,
|
|
477
441
|
})
|
|
478
442
|
|
|
479
443
|
if (props.positionX && props.positionY) widget.position(props.positionX, props.positionY)
|
|
@@ -491,14 +455,9 @@ export class CloudWatchManager {
|
|
|
491
455
|
public createLogQueryWidget(id: string, scope: CommonConstruct, props: LogQueryWidgetProps, logGroupNames: string[]) {
|
|
492
456
|
if (!props) throw `Widget props undefined for ${id}`
|
|
493
457
|
const widget = new watch.LogQueryWidget({
|
|
494
|
-
|
|
495
|
-
logGroupNames
|
|
496
|
-
queryLines: props.queryLines,
|
|
497
|
-
queryString: props.queryString,
|
|
458
|
+
...props,
|
|
459
|
+
logGroupNames,
|
|
498
460
|
region: props.region ?? scope.props.region,
|
|
499
|
-
title: props.title,
|
|
500
|
-
view: props.view,
|
|
501
|
-
width: props.width,
|
|
502
461
|
})
|
|
503
462
|
|
|
504
463
|
if (props.positionX && props.positionY) widget.position(props.positionX, props.positionY)
|
|
@@ -32,23 +32,8 @@ export class DynamodbManager {
|
|
|
32
32
|
if (!props) throw `Table props undefined for ${id}`
|
|
33
33
|
|
|
34
34
|
const table = new Table(scope, `${id}`, {
|
|
35
|
-
|
|
36
|
-
contributorInsightsEnabled: props.contributorInsightsEnabled,
|
|
37
|
-
encryption: props.encryption,
|
|
38
|
-
encryptionKey: props.encryptionKey,
|
|
39
|
-
kinesisStream: props.kinesisStream,
|
|
40
|
-
partitionKey: props.partitionKey,
|
|
41
|
-
pointInTimeRecovery: props.pointInTimeRecovery,
|
|
42
|
-
readCapacity: props.readCapacity,
|
|
43
|
-
removalPolicy: props.removalPolicy,
|
|
44
|
-
replicationRegions: props.replicationRegions,
|
|
45
|
-
replicationTimeout: props.replicationTimeout,
|
|
46
|
-
sortKey: props.sortKey,
|
|
47
|
-
stream: props.stream,
|
|
35
|
+
...props,
|
|
48
36
|
tableName: `${props.tableName}-${scope.props.stage}`,
|
|
49
|
-
timeToLiveAttribute: props.timeToLiveAttribute,
|
|
50
|
-
waitForReplicationToFinish: props.waitForReplicationToFinish,
|
|
51
|
-
writeCapacity: props.writeCapacity,
|
|
52
37
|
})
|
|
53
38
|
|
|
54
39
|
if (props.tags && !_.isEmpty(props.tags)) {
|
|
@@ -47,13 +47,9 @@ export class EcsManager {
|
|
|
47
47
|
if (!props) throw `Ecs Cluster props undefined for ${id}`
|
|
48
48
|
|
|
49
49
|
const ecsCluster = new Cluster(scope, `${id}`, {
|
|
50
|
-
|
|
50
|
+
...props,
|
|
51
51
|
clusterName: `${props.clusterName}-${scope.props.stage}`,
|
|
52
|
-
|
|
53
|
-
defaultCloudMapNamespace: props.defaultCloudMapNamespace,
|
|
54
|
-
enableFargateCapacityProviders: props.enableFargateCapacityProviders,
|
|
55
|
-
executeCommandConfiguration: props.executeCommandConfiguration,
|
|
56
|
-
vpc: vpc,
|
|
52
|
+
vpc,
|
|
57
53
|
})
|
|
58
54
|
|
|
59
55
|
if (props.tags && !_.isEmpty(props.tags)) {
|
|
@@ -96,41 +92,33 @@ export class EcsManager {
|
|
|
96
92
|
if (!props) throw `EcsTask props undefined for ${id}`
|
|
97
93
|
|
|
98
94
|
const ecsTask = new TaskDefinition(scope, `${id}`, {
|
|
95
|
+
...props,
|
|
99
96
|
compatibility: Compatibility.FARGATE,
|
|
100
|
-
cpu: props.cpu,
|
|
101
|
-
ephemeralStorageGiB: props.ephemeralStorageGiB,
|
|
102
97
|
executionRole: role,
|
|
103
98
|
family: `${props.family}-${scope.props.stage}`,
|
|
104
|
-
inferenceAccelerators: props.inferenceAccelerators,
|
|
105
|
-
ipcMode: props.ipcMode,
|
|
106
|
-
memoryMiB: props.memoryMiB,
|
|
107
99
|
networkMode: NetworkMode.AWS_VPC,
|
|
108
|
-
pidMode: props.pidMode,
|
|
109
|
-
placementConstraints: props.placementConstraints,
|
|
110
|
-
proxyConfiguration: props.proxyConfiguration,
|
|
111
100
|
runtimePlatform: {
|
|
112
101
|
cpuArchitecture: props.runtimePlatform?.cpuArchitecture ?? CpuArchitecture.X86_64,
|
|
113
102
|
operatingSystemFamily: props.runtimePlatform?.operatingSystemFamily ?? OperatingSystemFamily.LINUX,
|
|
114
103
|
},
|
|
115
104
|
taskRole: role,
|
|
116
|
-
volumes: props.volumes,
|
|
117
105
|
})
|
|
118
106
|
|
|
119
107
|
ecsTask.addContainer('EcsContainer', {
|
|
120
|
-
command
|
|
108
|
+
command,
|
|
121
109
|
cpu: props.cpu ? parseInt(props.cpu) : undefined,
|
|
122
110
|
disableNetworking: false,
|
|
123
|
-
environment
|
|
111
|
+
environment,
|
|
124
112
|
image: containerImage,
|
|
125
113
|
logging: LogDriver.awsLogs({
|
|
126
|
-
logGroup
|
|
114
|
+
logGroup,
|
|
127
115
|
logRetention: props.logging?.logRetention,
|
|
128
116
|
multilinePattern: props.logging?.multilinePattern,
|
|
129
117
|
streamPrefix: `${id}`,
|
|
130
118
|
}),
|
|
131
119
|
memoryLimitMiB: props.memoryMiB ? parseInt(props.memoryMiB) : undefined,
|
|
132
120
|
privileged: false,
|
|
133
|
-
secrets
|
|
121
|
+
secrets,
|
|
134
122
|
})
|
|
135
123
|
|
|
136
124
|
if (props.tags && !_.isEmpty(props.tags)) {
|
|
@@ -164,29 +152,20 @@ export class EcsManager {
|
|
|
164
152
|
throw `TaskImageOptions for Ecs Load balanced Fargate Service props undefined for ${id}`
|
|
165
153
|
|
|
166
154
|
const fargateService = new ApplicationLoadBalancedFargateService(scope, `${id}-ecs-service`, {
|
|
155
|
+
...props,
|
|
167
156
|
assignPublicIp: props.assignPublicIp ?? true,
|
|
168
|
-
|
|
169
|
-
cluster: cluster,
|
|
170
|
-
cpu: props.cpu,
|
|
171
|
-
desiredCount: props.desiredCount,
|
|
172
|
-
domainName: props.domainName,
|
|
173
|
-
domainZone: props.domainZone,
|
|
157
|
+
cluster,
|
|
174
158
|
enableECSManagedTags: true,
|
|
175
159
|
healthCheckGracePeriod: props.healthCheckGracePeriod ?? Duration.seconds(60),
|
|
176
|
-
listenerPort: props.listenerPort,
|
|
177
160
|
loadBalancerName: `${id}-${scope.props.stage}`,
|
|
178
|
-
memoryLimitMiB: props.memoryLimitMiB,
|
|
179
161
|
runtimePlatform: {
|
|
180
162
|
cpuArchitecture: props.runtimePlatform?.cpuArchitecture ?? CpuArchitecture.X86_64,
|
|
181
163
|
operatingSystemFamily: props.runtimePlatform?.operatingSystemFamily ?? OperatingSystemFamily.LINUX,
|
|
182
164
|
},
|
|
183
165
|
serviceName: `${id}-${scope.props.stage}`,
|
|
184
166
|
taskImageOptions: {
|
|
185
|
-
|
|
167
|
+
...props.taskImageOptions,
|
|
186
168
|
enableLogging: props.taskImageOptions?.enableLogging ?? true,
|
|
187
|
-
environment: props.taskImageOptions?.environment,
|
|
188
|
-
executionRole: props.taskImageOptions?.executionRole,
|
|
189
|
-
image: props.taskImageOptions.image,
|
|
190
169
|
logDriver:
|
|
191
170
|
props.taskImageOptions?.logDriver ??
|
|
192
171
|
LogDriver.awsLogs({
|
|
@@ -195,21 +174,15 @@ export class EcsManager {
|
|
|
195
174
|
multilinePattern: props.logging?.multilinePattern,
|
|
196
175
|
streamPrefix: `${id}-${scope.props.stage}/ecs`,
|
|
197
176
|
}),
|
|
198
|
-
secrets: props.taskImageOptions?.secrets,
|
|
199
|
-
taskRole: props.taskImageOptions?.taskRole,
|
|
200
177
|
},
|
|
201
178
|
})
|
|
202
179
|
|
|
203
180
|
if (props.healthCheck) {
|
|
204
181
|
fargateService.targetGroup.configureHealthCheck({
|
|
182
|
+
...props.healthCheck,
|
|
205
183
|
enabled: props.healthCheck.enabled ?? true,
|
|
206
|
-
healthyGrpcCodes: props.healthCheck.healthyGrpcCodes,
|
|
207
|
-
healthyHttpCodes: props.healthCheck.healthyHttpCodes,
|
|
208
|
-
healthyThresholdCount: props.healthCheck.healthyThresholdCount,
|
|
209
184
|
interval: props.healthCheck.interval ?? Duration.seconds(props.healthCheck.intervalInSecs),
|
|
210
185
|
path: props.healthCheck.path ?? '/',
|
|
211
|
-
port: props.healthCheck.port,
|
|
212
|
-
protocol: props.healthCheck.protocol,
|
|
213
186
|
timeout: props.healthCheck.timeout ?? Duration.seconds(props.healthCheck.timeoutInSecs),
|
|
214
187
|
unhealthyThresholdCount: props.healthCheck.unhealthyThresholdCount,
|
|
215
188
|
})
|
|
@@ -58,24 +58,10 @@ export class ElastiCacheManager {
|
|
|
58
58
|
const subnetGroup = this.createElastiCacheSubnetGroup(`${id}-subnetGroup`, scope, subnetIds)
|
|
59
59
|
|
|
60
60
|
const elasticacheCluster = new CfnCacheCluster(scope, `${id}`, {
|
|
61
|
-
|
|
62
|
-
azMode: props.azMode,
|
|
63
|
-
cacheNodeType: props.cacheNodeType,
|
|
64
|
-
cacheParameterGroupName: props.cacheParameterGroupName,
|
|
65
|
-
cacheSecurityGroupNames: props.cacheSecurityGroupNames,
|
|
61
|
+
...props,
|
|
66
62
|
cacheSubnetGroupName: subnetGroup.cacheSubnetGroupName,
|
|
67
63
|
clusterName: `${id}-${scope.props.stage}`,
|
|
68
|
-
|
|
69
|
-
engineVersion: props.engineVersion,
|
|
70
|
-
logDeliveryConfigurations: logDeliveryConfigurations,
|
|
71
|
-
numCacheNodes: props.numCacheNodes,
|
|
72
|
-
port: props.port,
|
|
73
|
-
preferredAvailabilityZones: props.preferredAvailabilityZones,
|
|
74
|
-
preferredMaintenanceWindow: props.preferredMaintenanceWindow,
|
|
75
|
-
snapshotArns: props.snapshotArns,
|
|
76
|
-
snapshotName: props.snapshotName,
|
|
77
|
-
snapshotRetentionLimit: props.snapshotRetentionLimit,
|
|
78
|
-
snapshotWindow: props.snapshotWindow,
|
|
64
|
+
logDeliveryConfigurations,
|
|
79
65
|
vpcSecurityGroupIds: securityGroupIds,
|
|
80
66
|
})
|
|
81
67
|
|
|
@@ -114,27 +100,11 @@ export class ElastiCacheManager {
|
|
|
114
100
|
const subnetGroup = this.createElastiCacheSubnetGroup(`${id}-subnetGroup`, scope, subnetIds)
|
|
115
101
|
|
|
116
102
|
const elasticacheCluster = new CfnReplicationGroup(scope, `${id}`, {
|
|
117
|
-
|
|
118
|
-
automaticFailoverEnabled: props.automaticFailoverEnabled,
|
|
119
|
-
cacheNodeType: props.cacheNodeType,
|
|
120
|
-
cacheParameterGroupName: props.cacheParameterGroupName,
|
|
121
|
-
cacheSecurityGroupNames: props.cacheSecurityGroupNames,
|
|
103
|
+
...props,
|
|
122
104
|
cacheSubnetGroupName: subnetGroup.cacheSubnetGroupName,
|
|
123
|
-
engine: props.engine,
|
|
124
|
-
engineVersion: props.engineVersion,
|
|
125
|
-
globalReplicationGroupId: props.globalReplicationGroupId,
|
|
126
|
-
logDeliveryConfigurations: props.logDeliveryConfigurations,
|
|
127
|
-
multiAzEnabled: props.multiAzEnabled,
|
|
128
|
-
numCacheClusters: props.numCacheClusters,
|
|
129
|
-
numNodeGroups: props.numNodeGroups,
|
|
130
|
-
port: props.port,
|
|
131
|
-
preferredCacheClusterAZs: props.preferredCacheClusterAZs,
|
|
132
|
-
preferredMaintenanceWindow: props.preferredMaintenanceWindow,
|
|
133
|
-
primaryClusterId: props.primaryClusterId,
|
|
134
|
-
replicasPerNodeGroup: props.replicasPerNodeGroup,
|
|
135
105
|
replicationGroupDescription: `${id} Redis Replication Cluster`,
|
|
136
106
|
replicationGroupId: `${id}-${scope.props.stage}`,
|
|
137
|
-
securityGroupIds
|
|
107
|
+
securityGroupIds,
|
|
138
108
|
})
|
|
139
109
|
|
|
140
110
|
elasticacheCluster.addDependency(subnetGroup)
|
|
@@ -38,6 +38,7 @@ export class EventManager {
|
|
|
38
38
|
if (!props) throw `EventBus props undefined for ${id}`
|
|
39
39
|
|
|
40
40
|
const eventBus = new EventBus(scope, `${id}`, {
|
|
41
|
+
...props,
|
|
41
42
|
eventBusName: `${props.eventBusName}-${scope.props.stage}`,
|
|
42
43
|
})
|
|
43
44
|
|
|
@@ -65,12 +66,9 @@ export class EventManager {
|
|
|
65
66
|
if (!props) throw `EventRule props undefined for ${id}`
|
|
66
67
|
|
|
67
68
|
const rule = new Rule(scope, `${id}`, {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
eventBus: eventBus,
|
|
71
|
-
eventPattern: props.eventPattern,
|
|
69
|
+
...props,
|
|
70
|
+
eventBus,
|
|
72
71
|
ruleName: `${props.ruleName}-${scope.props.stage}`,
|
|
73
|
-
schedule: props.schedule,
|
|
74
72
|
})
|
|
75
73
|
|
|
76
74
|
if (targets && !_.isEmpty(targets)) {
|
|
@@ -113,12 +111,12 @@ export class EventManager {
|
|
|
113
111
|
if (!props) throw `EventRule props undefined for ${id}`
|
|
114
112
|
|
|
115
113
|
const eventRule = new CfnRule(scope, `${id}`, {
|
|
114
|
+
...props,
|
|
116
115
|
description: 'Rule to send notification to lambda function target',
|
|
117
|
-
eventBusName
|
|
118
|
-
eventPattern
|
|
116
|
+
eventBusName,
|
|
117
|
+
eventPattern,
|
|
119
118
|
name: `${props.name}-${scope.props.stage}`,
|
|
120
|
-
scheduleExpression
|
|
121
|
-
state: props.state,
|
|
119
|
+
scheduleExpression,
|
|
122
120
|
targets: [
|
|
123
121
|
{
|
|
124
122
|
arn: lambdaFunction.functionArn,
|
|
@@ -165,10 +163,10 @@ export class EventManager {
|
|
|
165
163
|
if (!props) throw `EventRule props undefined for ${id}`
|
|
166
164
|
|
|
167
165
|
const eventRule = new CfnRule(scope, `${id}`, {
|
|
166
|
+
...props,
|
|
168
167
|
description: 'Rule to send notification on new objects in data bucket to ecs task target',
|
|
169
|
-
eventPattern
|
|
168
|
+
eventPattern,
|
|
170
169
|
name: `${props.name}-${scope.props.stage}`,
|
|
171
|
-
state: props.state,
|
|
172
170
|
targets: [
|
|
173
171
|
{
|
|
174
172
|
arn: cluster.clusterArn,
|
|
@@ -216,9 +214,6 @@ export class EventManager {
|
|
|
216
214
|
|
|
217
215
|
const pipe = new CfnPipe(scope, `${id}`, {
|
|
218
216
|
...props,
|
|
219
|
-
description: props.description,
|
|
220
|
-
enrichment: props.enrichment,
|
|
221
|
-
enrichmentParameters: props.enrichmentParameters,
|
|
222
217
|
name: `${props.name}-${scope.props.stage}`,
|
|
223
218
|
roleArn: pipeRole.roleArn,
|
|
224
219
|
source: sourceQueue.queueArn,
|
|
@@ -30,16 +30,8 @@ export class KmsManager {
|
|
|
30
30
|
if (!props) throw `KMS Key props undefined for ${id}`
|
|
31
31
|
|
|
32
32
|
const key = new Key(scope, `${id}`, {
|
|
33
|
-
|
|
33
|
+
...props,
|
|
34
34
|
alias: `${props.alias}-${scope.props.stage}`,
|
|
35
|
-
description: props.description,
|
|
36
|
-
enableKeyRotation: props.enableKeyRotation,
|
|
37
|
-
enabled: props.enabled,
|
|
38
|
-
keySpec: props.keySpec,
|
|
39
|
-
keyUsage: props.keyUsage,
|
|
40
|
-
pendingWindow: props.pendingWindow,
|
|
41
|
-
policy: props.policy,
|
|
42
|
-
removalPolicy: props.removalPolicy,
|
|
43
35
|
})
|
|
44
36
|
|
|
45
37
|
createCfnOutput(`${id}-keyId`, scope, key.keyId)
|