@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
@@ -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
- description: props.description,
69
- enabled: props.enabled,
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: eventBusName,
118
- eventPattern: eventPattern,
116
+ eventBusName,
117
+ eventPattern,
119
118
  name: `${props.name}-${scope.props.stage}`,
120
- scheduleExpression: 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: 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
- admins: props.admins,
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)
@@ -101,39 +101,36 @@ export class LambdaManager {
101
101
 
102
102
  const lambdaFunction = new Function(scope, `${id}`, {
103
103
  ...props,
104
- ...{
105
- allowPublicSubnet: !!vpc,
106
- architecture: props.architecture ?? Architecture.ARM_64,
107
- code: code,
108
- deadLetterQueue: deadLetterQueue,
109
- environment: {
110
- LAST_MODIFIED_TS: props.excludeLastModifiedTimestamp
111
- ? ''
112
- : scope.ssmManager.readStringParameter(
113
- `${id}-sm-ts`,
114
- scope,
115
- `${SsmManager.SECRETS_MODIFIED_TIMESTAMP_PARAM}-${scope.props.stage}`
116
- ),
117
- REGION: scope.props.region,
118
- STAGE: scope.props.stage,
119
- ...environment,
120
- },
121
- filesystem: accessPoint ? FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
122
- functionName: functionName,
123
- handler: handler || 'index.lambda_handler',
124
- insightsVersion: props.insightsVersion,
125
- layers: layers,
126
- logRetention: scope.props.logRetention ?? props.logRetention,
127
- reservedConcurrentExecutions:
128
- props.reservedConcurrentExecutions ?? scope.props.defaultReservedLambdaConcurrentExecutions,
129
- role: role instanceof Role ? role : undefined,
130
- runtime: props.runtime ?? scope.props.nodejsRuntime ?? CommonStack.NODEJS_RUNTIME,
131
- securityGroups: securityGroups,
132
- timeout: props.timeoutInSecs ? Duration.seconds(props.timeoutInSecs) : Duration.minutes(15),
133
- tracing: scope.props.defaultTracing ?? props.tracing,
134
- vpc,
135
- vpcSubnets,
104
+ allowPublicSubnet: !!vpc,
105
+ architecture: props.architecture ?? Architecture.ARM_64,
106
+ code,
107
+ deadLetterQueue,
108
+ environment: {
109
+ LAST_MODIFIED_TS: props.excludeLastModifiedTimestamp
110
+ ? ''
111
+ : scope.ssmManager.readStringParameter(
112
+ `${id}-sm-ts`,
113
+ scope,
114
+ `${SsmManager.SECRETS_MODIFIED_TIMESTAMP_PARAM}-${scope.props.stage}`
115
+ ),
116
+ REGION: scope.props.region,
117
+ STAGE: scope.props.stage,
118
+ ...environment,
136
119
  },
120
+ filesystem: accessPoint ? FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
121
+ functionName,
122
+ handler: handler || 'index.lambda_handler',
123
+ layers,
124
+ logRetention: scope.props.logRetention ?? props.logRetention,
125
+ reservedConcurrentExecutions:
126
+ props.reservedConcurrentExecutions ?? scope.props.defaultReservedLambdaConcurrentExecutions,
127
+ role: role instanceof Role ? role : undefined,
128
+ runtime: props.runtime ?? scope.props.nodejsRuntime ?? CommonStack.NODEJS_RUNTIME,
129
+ securityGroups,
130
+ timeout: props.timeoutInSecs ? Duration.seconds(props.timeoutInSecs) : Duration.minutes(15),
131
+ tracing: scope.props.defaultTracing ?? props.tracing,
132
+ vpc,
133
+ vpcSubnets,
137
134
  })
138
135
 
139
136
  if (lambdaFunction.deadLetterQueue && props.dlq?.retriesEnabled) {
@@ -254,36 +251,31 @@ export class LambdaManager {
254
251
 
255
252
  const lambdaFunction = new DockerImageFunction(scope, `${id}`, {
256
253
  ...props,
257
- ...{
258
- allowPublicSubnet: !!vpc,
259
- architecture: props.architecture ?? Architecture.ARM_64,
260
- code: code,
261
- deadLetterQueue: deadLetterQueue,
262
- environment: {
263
- LAST_MODIFIED_TS: props.excludeLastModifiedTimestamp
264
- ? ''
265
- : scope.ssmManager.readStringParameter(
266
- `${id}-sm-ts`,
267
- scope,
268
- `${SsmManager.SECRETS_MODIFIED_TIMESTAMP_PARAM}-${scope.props.stage}`
269
- ),
270
- REGION: scope.props.region,
271
- STAGE: scope.props.stage,
272
- ...environment,
273
- },
274
- filesystem: accessPoint ? FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
275
- functionName: functionName,
276
- insightsVersion: props.insightsVersion,
277
- logRetention: scope.props.logRetention ?? props.logRetention,
278
- reservedConcurrentExecutions: props.reservedConcurrentExecutions,
279
- role: role instanceof Role ? role : undefined,
280
- runtime: props.runtime ?? scope.props.nodejsRuntime ?? CommonStack.NODEJS_RUNTIME,
281
- securityGroups: securityGroups,
282
- timeout: props.timeoutInSecs ? Duration.seconds(props.timeoutInSecs) : Duration.minutes(1),
283
- tracing: props.tracing,
284
- vpc,
285
- vpcSubnets,
254
+ allowPublicSubnet: !!vpc,
255
+ architecture: props.architecture ?? Architecture.ARM_64,
256
+ code,
257
+ deadLetterQueue,
258
+ environment: {
259
+ LAST_MODIFIED_TS: props.excludeLastModifiedTimestamp
260
+ ? ''
261
+ : scope.ssmManager.readStringParameter(
262
+ `${id}-sm-ts`,
263
+ scope,
264
+ `${SsmManager.SECRETS_MODIFIED_TIMESTAMP_PARAM}-${scope.props.stage}`
265
+ ),
266
+ REGION: scope.props.region,
267
+ STAGE: scope.props.stage,
268
+ ...environment,
286
269
  },
270
+ filesystem: accessPoint ? FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
271
+ functionName,
272
+ logRetention: scope.props.logRetention ?? props.logRetention,
273
+ role: role instanceof Role ? role : undefined,
274
+ securityGroups: securityGroups,
275
+ timeout: props.timeoutInSecs ? Duration.seconds(props.timeoutInSecs) : Duration.minutes(1),
276
+ tracing: props.tracing,
277
+ vpc,
278
+ vpcSubnets,
287
279
  })
288
280
 
289
281
  if (lambdaFunction.deadLetterQueue && props.dlq?.retriesEnabled) {
@@ -318,17 +310,7 @@ export class LambdaManager {
318
310
 
319
311
  const lambdaFunctionAlias = new Alias(scope, `${id}`, {
320
312
  ...props,
321
- ...{
322
- additionalVersions: props.additionalVersions,
323
- aliasName: props.aliasName,
324
- description: props.description,
325
- maxEventAge: props.maxEventAge,
326
- onFailure: props.onFailure,
327
- onSuccess: props.onSuccess,
328
- provisionedConcurrentExecutions: props.provisionedConcurrentExecutions,
329
- retryAttempts: props.retryAttempts,
330
- version: lambdaVersion,
331
- },
313
+ version: lambdaVersion,
332
314
  })
333
315
 
334
316
  createCfnOutput(`${id}-lambdaAliasName`, scope, lambdaFunctionAlias.functionArn)
@@ -59,7 +59,7 @@ export class SecretsManager {
59
59
  public async resolveSecretValue(region: string, secretId: string, secretKey: string) {
60
60
  const client = new SecretsManagerClient({
61
61
  credentials: determineCredentials(),
62
- region: region,
62
+ region,
63
63
  })
64
64
  const command = new GetSecretValueCommand({
65
65
  SecretId: secretId,
@@ -39,8 +39,8 @@ export class SnsManager {
39
39
  if (!props) throw `Subscription props undefined for ${id}`
40
40
 
41
41
  const topic = new Topic(scope, id, {
42
+ ...props,
42
43
  displayName: `${props.topicName}-${scope.props.stage}`,
43
- fifo: props.fifo,
44
44
  topicName: `${props.topicName}-${scope.props.stage}`,
45
45
  })
46
46
 
@@ -70,8 +70,8 @@ export class SnsManager {
70
70
  if (!props) throw `Subscription props undefined for ${id}`
71
71
 
72
72
  const topic = new Topic(scope, id, {
73
+ ...props,
73
74
  displayName: `${props.topicName}-${scope.props.stage}`,
74
- fifo: props.fifo,
75
75
  topicName: `${props.topicName}-${scope.props.stage}`,
76
76
  })
77
77
 
@@ -34,7 +34,7 @@ export class SqsManager {
34
34
  if (!props) throw `Queue props undefined for ${id}`
35
35
 
36
36
  const queue = new Queue(scope, id, {
37
- contentBasedDeduplication: props.contentBasedDeduplication,
37
+ ...props,
38
38
  dataKeyReuse: props.dataKeyReuseInSecs ? Duration.seconds(props.dataKeyReuseInSecs) : props.dataKeyReuse,
39
39
  deadLetterQueue: !deadLetterQueue
40
40
  ? undefined
@@ -42,14 +42,7 @@ export class SqsManager {
42
42
  maxReceiveCount: props.maxReceiveCount ?? 5,
43
43
  queue: deadLetterQueue,
44
44
  },
45
- deduplicationScope: props.deduplicationScope,
46
45
  deliveryDelay: props.deliveryDelayInSecs ? Duration.seconds(props.deliveryDelayInSecs) : undefined,
47
- encryption: props.encryption,
48
- encryptionMasterKey: props.encryptionMasterKey,
49
- fifo: props.fifo,
50
- fifoThroughputLimit: props.fifoThroughputLimit,
51
- maxMessageSizeBytes: props.maxMessageSizeBytes,
52
- queueName: props.queueName,
53
46
  receiveMessageWaitTime: props.receiveMessageWaitTimeInSecs
54
47
  ? Duration.seconds(props.receiveMessageWaitTimeInSecs)
55
48
  : props.receiveMessageWaitTime,
@@ -35,19 +35,11 @@ export class S3Manager {
35
35
  const bucketLifecycleRules: LifecycleRule[] = []
36
36
  _.forEach(props.lifecycleRules, lifecycleRule => {
37
37
  bucketLifecycleRules.push({
38
- abortIncompleteMultipartUploadAfter: lifecycleRule.abortIncompleteMultipartUploadAfter,
39
- enabled: lifecycleRule.enabled,
38
+ ...lifecycleRule,
40
39
  expiration: lifecycleRule.expirationInDays ? Duration.days(lifecycleRule.expirationInDays) : undefined,
41
- expirationDate: lifecycleRule.expirationDate,
42
- expiredObjectDeleteMarker: lifecycleRule.expiredObjectDeleteMarker,
43
- id: lifecycleRule.id,
44
40
  noncurrentVersionExpiration: lifecycleRule.noncurrentVersionExpirationInDays
45
41
  ? Duration.days(lifecycleRule.noncurrentVersionExpirationInDays)
46
42
  : undefined,
47
- noncurrentVersionTransitions: lifecycleRule.noncurrentVersionTransitions,
48
- prefix: lifecycleRule.prefix,
49
- tagFilters: lifecycleRule.tagFilters,
50
- transitions: lifecycleRule.transitions,
51
43
  })
52
44
  })
53
45
 
@@ -108,24 +100,13 @@ export class S3Manager {
108
100
  }
109
101
 
110
102
  bucket = new Bucket(scope, `${id}-bucket`, {
111
- accessControl: props.accessControl,
112
- autoDeleteObjects: props.autoDeleteObjects,
103
+ ...props,
113
104
  blockPublicAccess: props.blockPublicAccess || BlockPublicAccess.BLOCK_ALL,
114
- bucketName: bucketName,
115
- cors: props.cors,
105
+ bucketName,
116
106
  encryption: props.encryption || BucketEncryption.S3_MANAGED,
117
- encryptionKey: props.encryptionKey,
118
107
  lifecycleRules: this.determineBucketLifecycleRules(props),
119
- metrics: props.metrics,
120
- objectOwnership: props.objectOwnership,
121
- publicReadAccess: props.publicReadAccess,
122
108
  removalPolicy: props.removalPolicy || RemovalPolicy.RETAIN,
123
109
  serverAccessLogsBucket: logBucket,
124
- serverAccessLogsPrefix: props.serverAccessLogsPrefix,
125
- versioned: props.versioned,
126
- websiteErrorDocument: props.websiteErrorDocument,
127
- websiteIndexDocument: props.websiteIndexDocument,
128
- websiteRoutingRules: props.websiteRoutingRules,
129
110
  })
130
111
 
131
112
  const cfnBucket = bucket.node.defaultChild as CfnBucket
@@ -88,9 +88,7 @@ export class SfnManager {
88
88
  if (!props) throw `Step props undefined for ${id}`
89
89
  return new Succeed(scope, `${props.name}`, {
90
90
  ...props,
91
- ...{
92
- comment: `Succeed step for ${props.name} - ${scope.props.stage} stage`,
93
- },
91
+ comment: `Succeed step for ${props.name} - ${scope.props.stage} stage`,
94
92
  })
95
93
  }
96
94
 
@@ -104,9 +102,7 @@ export class SfnManager {
104
102
  if (!props) throw `Step props undefined for ${id}`
105
103
  return new Fail(scope, `${props.name}`, {
106
104
  ...props,
107
- ...{
108
- comment: `Fail step for ${props.name} - ${scope.props.stage} stage`,
109
- },
105
+ comment: `Fail step for ${props.name} - ${scope.props.stage} stage`,
110
106
  })
111
107
  }
112
108
 
@@ -120,9 +116,7 @@ export class SfnManager {
120
116
  if (!props) throw `Step props undefined for ${id}`
121
117
  return new Pass(scope, `${props.name}`, {
122
118
  ...props,
123
- ...{
124
- comment: `Pass step for ${props.name} - ${scope.props.stage} stage`,
125
- },
119
+ comment: `Pass step for ${props.name} - ${scope.props.stage} stage`,
126
120
  })
127
121
  }
128
122
 
@@ -136,9 +130,7 @@ export class SfnManager {
136
130
  if (!props) throw `Step props undefined for ${id}`
137
131
  return new Parallel(scope, `${props.name}`, {
138
132
  ...props,
139
- ...{
140
- comment: `Parallel step for ${props.name} - ${scope.props.stage} stage`,
141
- },
133
+ comment: `Parallel step for ${props.name} - ${scope.props.stage} stage`,
142
134
  })
143
135
  }
144
136
 
@@ -152,9 +144,7 @@ export class SfnManager {
152
144
  if (!props) throw `Step props undefined for ${id}`
153
145
  return new Choice(scope, `${props.name}`, {
154
146
  ...props,
155
- ...{
156
- comment: `Choice step for ${props.name} - ${scope.props.stage} stage`,
157
- },
147
+ comment: `Choice step for ${props.name} - ${scope.props.stage} stage`,
158
148
  })
159
149
  }
160
150
 
@@ -167,10 +157,8 @@ export class SfnManager {
167
157
  public createWaitStep(id: string, scope: CommonConstruct, props: SfnWaitProps) {
168
158
  return new Wait(scope, `${props.name}`, {
169
159
  ...props,
170
- ...{
171
- comment: `Choice step for ${props.name} - ${scope.props.stage} stage`,
172
- time: WaitTime.duration(Duration.seconds(props.delayInSeconds)),
173
- },
160
+ comment: `Choice step for ${props.name} - ${scope.props.stage} stage`,
161
+ time: WaitTime.duration(Duration.seconds(props.delayInSeconds)),
174
162
  })
175
163
  }
176
164
 
@@ -192,22 +180,9 @@ export class SfnManager {
192
180
  if (!props) throw `Step props undefined for ${id}`
193
181
  const step = new DynamoGetItem(scope, `${props.name}`, {
194
182
  ...props,
195
- ...{
196
- comment: `DynamoDB GetItem step for ${props.name} - ${scope.props.stage} stage`,
197
- consistentRead: props.consistentRead,
198
- expressionAttributeNames: props.expressionAttributeNames,
199
- heartbeatTimeout: props.heartbeatTimeout,
200
- inputPath: props.inputPath,
201
- integrationPattern: props.integrationPattern,
202
- key: tableKey,
203
- outputPath: props.outputPath,
204
- projectionExpression: props.projectionExpression,
205
- resultPath: props.resultPath,
206
- resultSelector: props.resultSelector,
207
- returnConsumedCapacity: props.returnConsumedCapacity,
208
- table: table,
209
- taskTimeout: props.taskTimeout,
210
- },
183
+ comment: `DynamoDB GetItem step for ${props.name} - ${scope.props.stage} stage`,
184
+ key: tableKey,
185
+ table,
211
186
  })
212
187
 
213
188
  let retries = props.retries
@@ -218,7 +193,7 @@ export class SfnManager {
218
193
  _.forEach(retries, retry => {
219
194
  step.addRetry({
220
195
  ...retry,
221
- ...{ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval },
196
+ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval,
222
197
  })
223
198
  })
224
199
 
@@ -243,24 +218,9 @@ export class SfnManager {
243
218
  if (!props) throw `Step props undefined for ${id}`
244
219
  const step = new DynamoPutItem(scope, `${props.name}`, {
245
220
  ...props,
246
- ...{
247
- comment: `DynamoDB PutItem step for ${props.name} - ${scope.props.stage} stage`,
248
- conditionExpression: props.conditionExpression,
249
- expressionAttributeNames: props.expressionAttributeNames,
250
- expressionAttributeValues: props.expressionAttributeValues,
251
- heartbeatTimeout: props.heartbeatTimeout,
252
- inputPath: props.inputPath,
253
- integrationPattern: props.integrationPattern,
254
- item: tableItem,
255
- outputPath: props.outputPath,
256
- resultPath: props.resultPath,
257
- resultSelector: props.resultSelector,
258
- returnConsumedCapacity: props.returnConsumedCapacity,
259
- returnItemCollectionMetrics: props.returnItemCollectionMetrics,
260
- returnValues: props.returnValues,
261
- table: table,
262
- taskTimeout: props.taskTimeout,
263
- },
221
+ comment: `DynamoDB PutItem step for ${props.name} - ${scope.props.stage} stage`,
222
+ item: tableItem,
223
+ table,
264
224
  })
265
225
 
266
226
  let retries = props.retries
@@ -296,24 +256,9 @@ export class SfnManager {
296
256
  if (!props) throw `Step props undefined for ${id}`
297
257
  const step = new DynamoDeleteItem(scope, `${props.name}`, {
298
258
  ...props,
299
- ...{
300
- comment: `DynamoDB DeleteItem step for ${props.name} - ${scope.props.stage} stage`,
301
- conditionExpression: props.conditionExpression,
302
- expressionAttributeNames: props.expressionAttributeNames,
303
- expressionAttributeValues: props.expressionAttributeValues,
304
- heartbeatTimeout: props.heartbeatTimeout,
305
- inputPath: props.inputPath,
306
- integrationPattern: props.integrationPattern,
307
- key: tableKey,
308
- outputPath: props.outputPath,
309
- resultPath: props.resultPath,
310
- resultSelector: props.resultSelector,
311
- returnConsumedCapacity: props.returnConsumedCapacity,
312
- returnItemCollectionMetrics: props.returnItemCollectionMetrics,
313
- returnValues: props.returnValues,
314
- table: table,
315
- taskTimeout: props.taskTimeout,
316
- },
259
+ comment: `DynamoDB DeleteItem step for ${props.name} - ${scope.props.stage} stage`,
260
+ key: tableKey,
261
+ table,
317
262
  })
318
263
 
319
264
  let retries = props.retries
@@ -343,21 +288,8 @@ export class SfnManager {
343
288
  if (!props.messageBody) throw 'Message body undefined'
344
289
  const step = new SqsSendMessage(scope, `${props.name}`, {
345
290
  ...props,
346
- ...{
347
- comment: `DynamoDB PutItem step for ${props.name} - ${scope.props.stage} stage`,
348
- delay: props.delay,
349
- heartbeatTimeout: props.heartbeatTimeout,
350
- inputPath: props.inputPath,
351
- integrationPattern: props.integrationPattern,
352
- messageBody: props.messageBody,
353
- messageDeduplicationId: props.messageDeduplicationId,
354
- messageGroupId: props.messageGroupId,
355
- outputPath: props.outputPath,
356
- queue: queue,
357
- resultPath: props.resultPath,
358
- resultSelector: props.resultSelector,
359
- taskTimeout: props.taskTimeout,
360
- },
291
+ comment: `DynamoDB PutItem step for ${props.name} - ${scope.props.stage} stage`,
292
+ queue,
361
293
  })
362
294
 
363
295
  let retries = props.retries
@@ -368,7 +300,7 @@ export class SfnManager {
368
300
  _.forEach(retries, retry => {
369
301
  step.addRetry({
370
302
  ...retry,
371
- ...{ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval },
303
+ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval,
372
304
  })
373
305
  })
374
306
 
@@ -386,10 +318,8 @@ export class SfnManager {
386
318
  if (!props) throw `Step props undefined for ${id}`
387
319
  const step = new LambdaInvoke(scope, `${props.name}`, {
388
320
  ...props,
389
- ...{
390
- comment: `Lambda step for ${props.name} - ${scope.props.stage} stage`,
391
- lambdaFunction,
392
- },
321
+ comment: `Lambda step for ${props.name} - ${scope.props.stage} stage`,
322
+ lambdaFunction,
393
323
  })
394
324
 
395
325
  let retries = props.retries
@@ -400,7 +330,7 @@ export class SfnManager {
400
330
  _.forEach(retries, retry => {
401
331
  step.addRetry({
402
332
  ...retry,
403
- ...{ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval },
333
+ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval,
404
334
  })
405
335
  })
406
336
 
@@ -426,10 +356,8 @@ export class SfnManager {
426
356
  if (skipExecution) return this.createPassStep(id, scope, { comment: props.comment, name: props.name })
427
357
  const step = new LambdaInvoke(scope, `${props.name}`, {
428
358
  ...props,
429
- ...{
430
- comment: `Lambda step for ${props.name} - ${scope.props.stage} stage`,
431
- lambdaFunction,
432
- },
359
+ comment: `Lambda step for ${props.name} - ${scope.props.stage} stage`,
360
+ lambdaFunction,
433
361
  })
434
362
 
435
363
  let retries = props.retries
@@ -440,7 +368,7 @@ export class SfnManager {
440
368
  _.forEach(retries, retry => {
441
369
  step.addRetry({
442
370
  ...retry,
443
- ...{ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval },
371
+ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval,
444
372
  })
445
373
  })
446
374
 
@@ -463,11 +391,9 @@ export class SfnManager {
463
391
  if (!props) throw `Step props undefined for ${id}`
464
392
  const step = new CallApiGatewayRestApiEndpoint(scope, `${props.name}`, {
465
393
  ...props,
466
- ...{
467
- api,
468
- comment: `API step for ${props.name} - ${scope.props.stage} stage`,
469
- stageName: scope.props.stage,
470
- },
394
+ api,
395
+ comment: `API step for ${props.name} - ${scope.props.stage} stage`,
396
+ stageName: scope.props.stage,
471
397
  })
472
398
 
473
399
  let retries = props.retries
@@ -478,7 +404,7 @@ export class SfnManager {
478
404
  _.forEach(retries, retry => {
479
405
  step.addRetry({
480
406
  ...retry,
481
- ...{ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval },
407
+ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval,
482
408
  })
483
409
  })
484
410
 
@@ -501,9 +427,8 @@ export class SfnManager {
501
427
  const step = new StepFunctionsStartExecution(scope, `${id}`, {
502
428
  ...props,
503
429
  associateWithParent: props.associateWithParent ?? true,
504
- inputPath: props.inputPath,
505
430
  name: props.name ?? uuidv4(),
506
- stateMachine: stateMachine,
431
+ stateMachine,
507
432
  })
508
433
 
509
434
  let retries = props.retries
@@ -514,7 +439,7 @@ export class SfnManager {
514
439
  _.forEach(retries, retry => {
515
440
  step.addRetry({
516
441
  ...retry,
517
- ...{ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval },
442
+ interval: retry.intervalInSecs ? Duration.seconds(retry.intervalInSecs) : retry.interval,
518
443
  })
519
444
  })
520
445
 
@@ -550,6 +475,7 @@ export class SfnManager {
550
475
  ) {
551
476
  if (!props) throw `State Machine props undefined for ${id}`
552
477
  const stateMachine = new StateMachine(scope, `${id}`, {
478
+ ...props,
553
479
  definitionBody: DefinitionBody.fromChainable(definition),
554
480
  logs: {
555
481
  destination: logGroup,
@@ -558,9 +484,6 @@ export class SfnManager {
558
484
  },
559
485
  role,
560
486
  stateMachineName: `${props.stateMachineName}-${scope.props.stage}`,
561
- stateMachineType: props.stateMachineType,
562
- timeout: props.timeout,
563
- tracingEnabled: props.tracingEnabled,
564
487
  })
565
488
 
566
489
  createCfnOutput(`${id}-stateMachineName`, scope, stateMachine.stateMachineName)
@@ -38,9 +38,9 @@ export class SsmManager {
38
38
  if (!props) throw `Parameter props undefined for ${id}`
39
39
 
40
40
  const parameter = new StringParameter(scope, `${id}`, {
41
+ ...props,
41
42
  description: `${props.description} - ${scope.props.stage} stage`,
42
43
  parameterName: `${props.parameterName}-${scope.props.stage}`,
43
- stringValue: props.stringValue,
44
44
  })
45
45
 
46
46
  createCfnOutput(`${id}-parameterArn`, scope, parameter.parameterArn)
@@ -73,8 +73,8 @@ export class SsmManager {
73
73
  if (!region || region == '') throw `Invalid region for ${id}`
74
74
 
75
75
  return new SSMParameterReader(scope, `${id}`, {
76
- parameterName: parameterName,
77
- region: region,
76
+ parameterName,
77
+ region,
78
78
  }).getParameterValue()
79
79
  }
80
80
  }
@@ -34,8 +34,7 @@ export class VpcManager {
34
34
  public createVpc(id: string, scope: CommonConstruct, props: VpcProps) {
35
35
  if (!props) throw `Vpc props undefined for ${id}`
36
36
  const vpc = new Vpc(scope, `${id}`, {
37
- ipAddresses: props.ipAddresses,
38
- maxAzs: props.maxAzs,
37
+ ...props,
39
38
  })
40
39
 
41
40
  createCfnOutput(`${id}Id`, scope, vpc.vpcId)