@gradientedge/cdk-utils 8.123.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.
Files changed (43) hide show
  1. package/app/api-destined-function/node_modules/.bin/uuid +2 -2
  2. package/app/api-destined-function/package.json +2 -2
  3. package/dist/src/lib/aws/services/api-gateway/main.d.ts +2 -2
  4. package/dist/src/lib/aws/services/api-gateway/main.js +8 -28
  5. package/dist/src/lib/aws/services/appconfig/main.d.ts +1 -1
  6. package/dist/src/lib/aws/services/appconfig/main.js +6 -13
  7. package/dist/src/lib/aws/services/cloudfront/main.js +6 -18
  8. package/dist/src/lib/aws/services/cloudtrail/main.js +1 -4
  9. package/dist/src/lib/aws/services/cloudwatch/main.js +15 -56
  10. package/dist/src/lib/aws/services/dynamodb/main.js +1 -16
  11. package/dist/src/lib/aws/services/elastic-container-service/main.js +11 -38
  12. package/dist/src/lib/aws/services/elasticache/main.js +4 -34
  13. package/dist/src/lib/aws/services/eventbridge/main.js +9 -14
  14. package/dist/src/lib/aws/services/key-management-service/main.js +1 -9
  15. package/dist/src/lib/aws/services/lambda/main.js +45 -63
  16. package/dist/src/lib/aws/services/secrets-manager/main.js +1 -1
  17. package/dist/src/lib/aws/services/simple-notification-service/main.js +2 -2
  18. package/dist/src/lib/aws/services/simple-queue-service/main.js +1 -8
  19. package/dist/src/lib/aws/services/simple-storage-service/main.js +3 -22
  20. package/dist/src/lib/aws/services/step-function/main.js +33 -110
  21. package/dist/src/lib/aws/services/systems-manager/main.js +3 -3
  22. package/dist/src/lib/aws/services/virtual-private-cloud/main.js +1 -2
  23. package/dist/src/lib/aws/services/web-application-firewall/main.js +2 -7
  24. package/package.json +18 -18
  25. package/src/lib/aws/services/api-gateway/main.ts +8 -28
  26. package/src/lib/aws/services/appconfig/main.ts +6 -13
  27. package/src/lib/aws/services/cloudfront/main.ts +6 -18
  28. package/src/lib/aws/services/cloudtrail/main.ts +1 -4
  29. package/src/lib/aws/services/cloudwatch/main.ts +15 -56
  30. package/src/lib/aws/services/dynamodb/main.ts +1 -16
  31. package/src/lib/aws/services/elastic-container-service/main.ts +11 -38
  32. package/src/lib/aws/services/elasticache/main.ts +4 -34
  33. package/src/lib/aws/services/eventbridge/main.ts +9 -14
  34. package/src/lib/aws/services/key-management-service/main.ts +1 -9
  35. package/src/lib/aws/services/lambda/main.ts +54 -72
  36. package/src/lib/aws/services/secrets-manager/main.ts +1 -1
  37. package/src/lib/aws/services/simple-notification-service/main.ts +2 -2
  38. package/src/lib/aws/services/simple-queue-service/main.ts +1 -8
  39. package/src/lib/aws/services/simple-storage-service/main.ts +3 -22
  40. package/src/lib/aws/services/step-function/main.ts +33 -110
  41. package/src/lib/aws/services/systems-manager/main.ts +3 -3
  42. package/src/lib/aws/services/virtual-private-cloud/main.ts +1 -2
  43. package/src/lib/aws/services/web-application-firewall/main.ts +2 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/cdk-utils",
3
- "version": "8.123.0",
3
+ "version": "8.125.0",
4
4
  "description": "Utilities for AWS CDK provisioning",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -46,15 +46,15 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "@aws-sdk/client-secrets-manager": "^3.408.0",
50
- "@aws-sdk/credential-providers": "^3.408.0",
51
- "@aws-sdk/types": "^3.408.0",
52
- "@cdktf/provider-azurerm": "^10.0.2",
49
+ "@aws-sdk/client-secrets-manager": "^3.414.0",
50
+ "@aws-sdk/credential-providers": "^3.414.0",
51
+ "@aws-sdk/types": "^3.413.0",
52
+ "@cdktf/provider-azurerm": "^10.0.3",
53
53
  "@types/lodash": "^4.14.198",
54
- "@types/node": "^20.5.9",
55
- "@types/uuid": "^9.0.3",
54
+ "@types/node": "^20.6.2",
55
+ "@types/uuid": "^9.0.4",
56
56
  "app-root-path": "^3.1.0",
57
- "aws-cdk-lib": "^2.95.0",
57
+ "aws-cdk-lib": "^2.96.2",
58
58
  "cdktf": "^0.18.0",
59
59
  "constructs": "^10.2.70",
60
60
  "lodash": "^4.17.21",
@@ -62,27 +62,27 @@
62
62
  "nconf": "^0.12.0",
63
63
  "pluralize": "^8.0.0",
64
64
  "ts-node": "^10.9.1",
65
- "uuid": "^9.0.0"
65
+ "uuid": "^9.0.1"
66
66
  },
67
67
  "devDependencies": {
68
- "@babel/core": "^7.22.15",
68
+ "@babel/core": "^7.22.20",
69
69
  "@babel/eslint-parser": "^7.22.15",
70
70
  "@babel/plugin-proposal-class-properties": "^7.18.6",
71
- "@types/jest": "^29.5.4",
72
- "@typescript-eslint/eslint-plugin": "^6.6.0",
73
- "@typescript-eslint/parser": "^6.6.0",
74
- "aws-cdk": "^2.95.0",
71
+ "@types/jest": "^29.5.5",
72
+ "@typescript-eslint/eslint-plugin": "^6.7.0",
73
+ "@typescript-eslint/parser": "^6.7.0",
74
+ "aws-cdk": "^2.96.2",
75
75
  "better-docs": "^2.7.2",
76
76
  "codecov": "^3.8.3",
77
77
  "commitizen": "^4.3.0",
78
78
  "docdash": "^2.0.2",
79
79
  "dotenv": "^16.3.1",
80
- "eslint": "^8.48.0",
80
+ "eslint": "^8.49.0",
81
81
  "eslint-config-prettier": "^9.0.0",
82
82
  "eslint-plugin-import": "^2.28.1",
83
- "eslint-plugin-jsdoc": "^46.5.1",
83
+ "eslint-plugin-jsdoc": "^46.8.1",
84
84
  "husky": "^8.0.3",
85
- "jest": "^29.6.4",
85
+ "jest": "^29.7.0",
86
86
  "jest-extended": "^4.0.1",
87
87
  "jest-junit": "^16.0.0",
88
88
  "jsdoc": "^4.0.2",
@@ -93,7 +93,7 @@
93
93
  "prettier": "^3.0.3",
94
94
  "prettier-plugin-organize-imports": "^3.2.3",
95
95
  "rimraf": "^5.0.1",
96
- "semantic-release": "^21.1.1",
96
+ "semantic-release": "^22.0.0",
97
97
  "taffydb": "^2.7.3",
98
98
  "ts-jest": "^29.1.1",
99
99
  "ts-node": "^10.9.1",
@@ -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
- binaryMediaTypes: props.binaryMediaTypes,
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
- accessLogDestination: props.deployOptions?.accessLogDestination,
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: certificate,
109
- domainName: 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 restApi
172
+ * @param api
193
173
  */
194
- public createApiDeployment(id: string, scope: CommonConstruct, restApi: IRestApi) {
174
+ public createApiDeployment(id: string, scope: CommonConstruct, api: IRestApi) {
195
175
  new Deployment(scope, `${id}`, {
196
- api: restApi,
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
- description: props.application.description,
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
- applicationId: applicationId,
82
- description: props.environment.description,
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
- * - <p>&#9888; The <b>locationUri</b> is defaulted to <i>hosted</i> if undefined</p>
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
- applicationId: applicationId,
113
- description: props.configurationProfile.description,
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
- additionalBehaviors: props.additionalBehaviors,
158
- certificate: certificate,
153
+ ...props,
154
+ certificate,
159
155
  comment: `${id} - ${scope.props.stage} stage`,
160
156
  defaultBehavior: {
161
- cachePolicy: props.defaultBehavior ? props.defaultBehavior.cachePolicy : undefined,
162
- edgeLambdas: props.defaultBehavior ? props.defaultBehavior.edgeLambdas : undefined,
157
+ ...props.defaultBehavior,
163
158
  functionAssociations: defaultFunctionAssociations ?? undefined,
164
- origin: 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: 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
- alarmDescription: props.alarmDescription,
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
- alarmDescription: props.alarmDescription,
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
- dashboardName: props.dashboardName,
112
+ ...props,
124
113
  end: CloudWatchManager.determineTimeRange(props.end),
125
- periodOverride: props.periodOverride,
126
114
  start: CloudWatchManager.determineTimeRange(props.start),
127
- widgets: 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
- height: props.height,
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
- fullPrecision: props.fullPrecision,
381
- height: props.height,
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
- height: props.height,
406
- leftYAxis: props.leftYAxis,
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
- height: props.height,
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
- alarms: alarms,
474
- height: props.height,
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
- height: props.height,
495
- logGroupNames: 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
- billingMode: props.billingMode,
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
- capacity: props.capacity,
50
+ ...props,
51
51
  clusterName: `${props.clusterName}-${scope.props.stage}`,
52
- containerInsights: props.containerInsights,
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: command,
108
+ command,
121
109
  cpu: props.cpu ? parseInt(props.cpu) : undefined,
122
110
  disableNetworking: false,
123
- environment: environment,
111
+ environment,
124
112
  image: containerImage,
125
113
  logging: LogDriver.awsLogs({
126
- logGroup: 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: 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
- certificate: props.certificate,
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
- containerPort: props.taskImageOptions?.containerPort,
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
- autoMinorVersionUpgrade: props.autoMinorVersionUpgrade,
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
- engine: props.engine,
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
- autoMinorVersionUpgrade: props.autoMinorVersionUpgrade,
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: securityGroupIds,
107
+ securityGroupIds,
138
108
  })
139
109
 
140
110
  elasticacheCluster.addDependency(subnetGroup)