@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.
- package/app/api-destined-function/node_modules/.bin/uuid +2 -2
- package/app/api-destined-function/package.json +2 -2
- 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 +18 -18
- 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
|
@@ -30,16 +30,8 @@ class KmsManager {
|
|
|
30
30
|
if (!props)
|
|
31
31
|
throw `KMS Key props undefined for ${id}`;
|
|
32
32
|
const key = new aws_kms_1.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
|
(0, utils_1.createCfnOutput)(`${id}-keyId`, scope, key.keyId);
|
|
45
37
|
(0, utils_1.createCfnOutput)(`${id}-keyArn`, scope, key.keyArn);
|
|
@@ -73,34 +73,31 @@ class LambdaManager {
|
|
|
73
73
|
}
|
|
74
74
|
const lambdaFunction = new aws_lambda_1.Function(scope, `${id}`, {
|
|
75
75
|
...props,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
...environment,
|
|
88
|
-
},
|
|
89
|
-
filesystem: accessPoint ? aws_lambda_1.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
|
|
90
|
-
functionName: functionName,
|
|
91
|
-
handler: handler || 'index.lambda_handler',
|
|
92
|
-
insightsVersion: props.insightsVersion,
|
|
93
|
-
layers: layers,
|
|
94
|
-
logRetention: scope.props.logRetention ?? props.logRetention,
|
|
95
|
-
reservedConcurrentExecutions: props.reservedConcurrentExecutions ?? scope.props.defaultReservedLambdaConcurrentExecutions,
|
|
96
|
-
role: role instanceof aws_iam_1.Role ? role : undefined,
|
|
97
|
-
runtime: props.runtime ?? scope.props.nodejsRuntime ?? common_1.CommonStack.NODEJS_RUNTIME,
|
|
98
|
-
securityGroups: securityGroups,
|
|
99
|
-
timeout: props.timeoutInSecs ? aws_cdk_lib_1.Duration.seconds(props.timeoutInSecs) : aws_cdk_lib_1.Duration.minutes(15),
|
|
100
|
-
tracing: scope.props.defaultTracing ?? props.tracing,
|
|
101
|
-
vpc,
|
|
102
|
-
vpcSubnets,
|
|
76
|
+
allowPublicSubnet: !!vpc,
|
|
77
|
+
architecture: props.architecture ?? aws_lambda_1.Architecture.ARM_64,
|
|
78
|
+
code,
|
|
79
|
+
deadLetterQueue,
|
|
80
|
+
environment: {
|
|
81
|
+
LAST_MODIFIED_TS: props.excludeLastModifiedTimestamp
|
|
82
|
+
? ''
|
|
83
|
+
: scope.ssmManager.readStringParameter(`${id}-sm-ts`, scope, `${systems_manager_1.SsmManager.SECRETS_MODIFIED_TIMESTAMP_PARAM}-${scope.props.stage}`),
|
|
84
|
+
REGION: scope.props.region,
|
|
85
|
+
STAGE: scope.props.stage,
|
|
86
|
+
...environment,
|
|
103
87
|
},
|
|
88
|
+
filesystem: accessPoint ? aws_lambda_1.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
|
|
89
|
+
functionName,
|
|
90
|
+
handler: handler || 'index.lambda_handler',
|
|
91
|
+
layers,
|
|
92
|
+
logRetention: scope.props.logRetention ?? props.logRetention,
|
|
93
|
+
reservedConcurrentExecutions: props.reservedConcurrentExecutions ?? scope.props.defaultReservedLambdaConcurrentExecutions,
|
|
94
|
+
role: role instanceof aws_iam_1.Role ? role : undefined,
|
|
95
|
+
runtime: props.runtime ?? scope.props.nodejsRuntime ?? common_1.CommonStack.NODEJS_RUNTIME,
|
|
96
|
+
securityGroups,
|
|
97
|
+
timeout: props.timeoutInSecs ? aws_cdk_lib_1.Duration.seconds(props.timeoutInSecs) : aws_cdk_lib_1.Duration.minutes(15),
|
|
98
|
+
tracing: scope.props.defaultTracing ?? props.tracing,
|
|
99
|
+
vpc,
|
|
100
|
+
vpcSubnets,
|
|
104
101
|
});
|
|
105
102
|
if (lambdaFunction.deadLetterQueue && props.dlq?.retriesEnabled) {
|
|
106
103
|
lambdaFunction.addEventSource(new aws_lambda_event_sources_1.SqsEventSource(lambdaFunction.deadLetterQueue, {
|
|
@@ -173,32 +170,27 @@ class LambdaManager {
|
|
|
173
170
|
}
|
|
174
171
|
const lambdaFunction = new aws_lambda_1.DockerImageFunction(scope, `${id}`, {
|
|
175
172
|
...props,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
...environment,
|
|
188
|
-
},
|
|
189
|
-
filesystem: accessPoint ? aws_lambda_1.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
|
|
190
|
-
functionName: functionName,
|
|
191
|
-
insightsVersion: props.insightsVersion,
|
|
192
|
-
logRetention: scope.props.logRetention ?? props.logRetention,
|
|
193
|
-
reservedConcurrentExecutions: props.reservedConcurrentExecutions,
|
|
194
|
-
role: role instanceof aws_iam_1.Role ? role : undefined,
|
|
195
|
-
runtime: props.runtime ?? scope.props.nodejsRuntime ?? common_1.CommonStack.NODEJS_RUNTIME,
|
|
196
|
-
securityGroups: securityGroups,
|
|
197
|
-
timeout: props.timeoutInSecs ? aws_cdk_lib_1.Duration.seconds(props.timeoutInSecs) : aws_cdk_lib_1.Duration.minutes(1),
|
|
198
|
-
tracing: props.tracing,
|
|
199
|
-
vpc,
|
|
200
|
-
vpcSubnets,
|
|
173
|
+
allowPublicSubnet: !!vpc,
|
|
174
|
+
architecture: props.architecture ?? aws_lambda_1.Architecture.ARM_64,
|
|
175
|
+
code,
|
|
176
|
+
deadLetterQueue,
|
|
177
|
+
environment: {
|
|
178
|
+
LAST_MODIFIED_TS: props.excludeLastModifiedTimestamp
|
|
179
|
+
? ''
|
|
180
|
+
: scope.ssmManager.readStringParameter(`${id}-sm-ts`, scope, `${systems_manager_1.SsmManager.SECRETS_MODIFIED_TIMESTAMP_PARAM}-${scope.props.stage}`),
|
|
181
|
+
REGION: scope.props.region,
|
|
182
|
+
STAGE: scope.props.stage,
|
|
183
|
+
...environment,
|
|
201
184
|
},
|
|
185
|
+
filesystem: accessPoint ? aws_lambda_1.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
|
|
186
|
+
functionName,
|
|
187
|
+
logRetention: scope.props.logRetention ?? props.logRetention,
|
|
188
|
+
role: role instanceof aws_iam_1.Role ? role : undefined,
|
|
189
|
+
securityGroups: securityGroups,
|
|
190
|
+
timeout: props.timeoutInSecs ? aws_cdk_lib_1.Duration.seconds(props.timeoutInSecs) : aws_cdk_lib_1.Duration.minutes(1),
|
|
191
|
+
tracing: props.tracing,
|
|
192
|
+
vpc,
|
|
193
|
+
vpcSubnets,
|
|
202
194
|
});
|
|
203
195
|
if (lambdaFunction.deadLetterQueue && props.dlq?.retriesEnabled) {
|
|
204
196
|
lambdaFunction.addEventSource(new aws_lambda_event_sources_1.SqsEventSource(lambdaFunction.deadLetterQueue, {
|
|
@@ -222,17 +214,7 @@ class LambdaManager {
|
|
|
222
214
|
throw `Lambda Alias props undefined for ${id}`;
|
|
223
215
|
const lambdaFunctionAlias = new aws_lambda_1.Alias(scope, `${id}`, {
|
|
224
216
|
...props,
|
|
225
|
-
|
|
226
|
-
additionalVersions: props.additionalVersions,
|
|
227
|
-
aliasName: props.aliasName,
|
|
228
|
-
description: props.description,
|
|
229
|
-
maxEventAge: props.maxEventAge,
|
|
230
|
-
onFailure: props.onFailure,
|
|
231
|
-
onSuccess: props.onSuccess,
|
|
232
|
-
provisionedConcurrentExecutions: props.provisionedConcurrentExecutions,
|
|
233
|
-
retryAttempts: props.retryAttempts,
|
|
234
|
-
version: lambdaVersion,
|
|
235
|
-
},
|
|
217
|
+
version: lambdaVersion,
|
|
236
218
|
});
|
|
237
219
|
(0, utils_1.createCfnOutput)(`${id}-lambdaAliasName`, scope, lambdaFunctionAlias.functionArn);
|
|
238
220
|
(0, utils_1.createCfnOutput)(`${id}-lambdaAliasArn`, scope, lambdaFunctionAlias.functionName);
|
|
@@ -56,7 +56,7 @@ class SecretsManager {
|
|
|
56
56
|
async resolveSecretValue(region, secretId, secretKey) {
|
|
57
57
|
const client = new client_secrets_manager_1.SecretsManagerClient({
|
|
58
58
|
credentials: (0, utils_1.determineCredentials)(),
|
|
59
|
-
region
|
|
59
|
+
region,
|
|
60
60
|
});
|
|
61
61
|
const command = new client_secrets_manager_1.GetSecretValueCommand({
|
|
62
62
|
SecretId: secretId,
|
|
@@ -36,8 +36,8 @@ class SnsManager {
|
|
|
36
36
|
if (!props)
|
|
37
37
|
throw `Subscription props undefined for ${id}`;
|
|
38
38
|
const topic = new aws_sns_1.Topic(scope, id, {
|
|
39
|
+
...props,
|
|
39
40
|
displayName: `${props.topicName}-${scope.props.stage}`,
|
|
40
|
-
fifo: props.fifo,
|
|
41
41
|
topicName: `${props.topicName}-${scope.props.stage}`,
|
|
42
42
|
});
|
|
43
43
|
if (emails && !lodash_1.default.isEmpty(emails)) {
|
|
@@ -58,8 +58,8 @@ class SnsManager {
|
|
|
58
58
|
if (!props)
|
|
59
59
|
throw `Subscription props undefined for ${id}`;
|
|
60
60
|
const topic = new aws_sns_1.Topic(scope, id, {
|
|
61
|
+
...props,
|
|
61
62
|
displayName: `${props.topicName}-${scope.props.stage}`,
|
|
62
|
-
fifo: props.fifo,
|
|
63
63
|
topicName: `${props.topicName}-${scope.props.stage}`,
|
|
64
64
|
});
|
|
65
65
|
topic.addSubscription(new aws_sns_subscriptions_1.LambdaSubscription(lambdaFunction));
|
|
@@ -36,7 +36,7 @@ class SqsManager {
|
|
|
36
36
|
if (!props)
|
|
37
37
|
throw `Queue props undefined for ${id}`;
|
|
38
38
|
const queue = new aws_sqs_1.Queue(scope, id, {
|
|
39
|
-
|
|
39
|
+
...props,
|
|
40
40
|
dataKeyReuse: props.dataKeyReuseInSecs ? aws_cdk_lib_1.Duration.seconds(props.dataKeyReuseInSecs) : props.dataKeyReuse,
|
|
41
41
|
deadLetterQueue: !deadLetterQueue
|
|
42
42
|
? undefined
|
|
@@ -44,14 +44,7 @@ class SqsManager {
|
|
|
44
44
|
maxReceiveCount: props.maxReceiveCount ?? 5,
|
|
45
45
|
queue: deadLetterQueue,
|
|
46
46
|
},
|
|
47
|
-
deduplicationScope: props.deduplicationScope,
|
|
48
47
|
deliveryDelay: props.deliveryDelayInSecs ? aws_cdk_lib_1.Duration.seconds(props.deliveryDelayInSecs) : undefined,
|
|
49
|
-
encryption: props.encryption,
|
|
50
|
-
encryptionMasterKey: props.encryptionMasterKey,
|
|
51
|
-
fifo: props.fifo,
|
|
52
|
-
fifoThroughputLimit: props.fifoThroughputLimit,
|
|
53
|
-
maxMessageSizeBytes: props.maxMessageSizeBytes,
|
|
54
|
-
queueName: props.queueName,
|
|
55
48
|
receiveMessageWaitTime: props.receiveMessageWaitTimeInSecs
|
|
56
49
|
? aws_cdk_lib_1.Duration.seconds(props.receiveMessageWaitTimeInSecs)
|
|
57
50
|
: props.receiveMessageWaitTime,
|
|
@@ -37,19 +37,11 @@ class S3Manager {
|
|
|
37
37
|
const bucketLifecycleRules = [];
|
|
38
38
|
lodash_1.default.forEach(props.lifecycleRules, lifecycleRule => {
|
|
39
39
|
bucketLifecycleRules.push({
|
|
40
|
-
|
|
41
|
-
enabled: lifecycleRule.enabled,
|
|
40
|
+
...lifecycleRule,
|
|
42
41
|
expiration: lifecycleRule.expirationInDays ? aws_cdk_lib_1.Duration.days(lifecycleRule.expirationInDays) : undefined,
|
|
43
|
-
expirationDate: lifecycleRule.expirationDate,
|
|
44
|
-
expiredObjectDeleteMarker: lifecycleRule.expiredObjectDeleteMarker,
|
|
45
|
-
id: lifecycleRule.id,
|
|
46
42
|
noncurrentVersionExpiration: lifecycleRule.noncurrentVersionExpirationInDays
|
|
47
43
|
? aws_cdk_lib_1.Duration.days(lifecycleRule.noncurrentVersionExpirationInDays)
|
|
48
44
|
: undefined,
|
|
49
|
-
noncurrentVersionTransitions: lifecycleRule.noncurrentVersionTransitions,
|
|
50
|
-
prefix: lifecycleRule.prefix,
|
|
51
|
-
tagFilters: lifecycleRule.tagFilters,
|
|
52
|
-
transitions: lifecycleRule.transitions,
|
|
53
45
|
});
|
|
54
46
|
});
|
|
55
47
|
return bucketLifecycleRules;
|
|
@@ -103,24 +95,13 @@ class S3Manager {
|
|
|
103
95
|
logBucket = aws_s3_1.Bucket.fromBucketName(scope, `${id}-logs`, logBucketName);
|
|
104
96
|
}
|
|
105
97
|
bucket = new aws_s3_1.Bucket(scope, `${id}-bucket`, {
|
|
106
|
-
|
|
107
|
-
autoDeleteObjects: props.autoDeleteObjects,
|
|
98
|
+
...props,
|
|
108
99
|
blockPublicAccess: props.blockPublicAccess || aws_s3_1.BlockPublicAccess.BLOCK_ALL,
|
|
109
|
-
bucketName
|
|
110
|
-
cors: props.cors,
|
|
100
|
+
bucketName,
|
|
111
101
|
encryption: props.encryption || aws_s3_1.BucketEncryption.S3_MANAGED,
|
|
112
|
-
encryptionKey: props.encryptionKey,
|
|
113
102
|
lifecycleRules: this.determineBucketLifecycleRules(props),
|
|
114
|
-
metrics: props.metrics,
|
|
115
|
-
objectOwnership: props.objectOwnership,
|
|
116
|
-
publicReadAccess: props.publicReadAccess,
|
|
117
103
|
removalPolicy: props.removalPolicy || aws_cdk_lib_1.RemovalPolicy.RETAIN,
|
|
118
104
|
serverAccessLogsBucket: logBucket,
|
|
119
|
-
serverAccessLogsPrefix: props.serverAccessLogsPrefix,
|
|
120
|
-
versioned: props.versioned,
|
|
121
|
-
websiteErrorDocument: props.websiteErrorDocument,
|
|
122
|
-
websiteIndexDocument: props.websiteIndexDocument,
|
|
123
|
-
websiteRoutingRules: props.websiteRoutingRules,
|
|
124
105
|
});
|
|
125
106
|
const cfnBucket = bucket.node.defaultChild;
|
|
126
107
|
cfnBucket.notificationConfiguration = {
|
|
@@ -46,9 +46,7 @@ class SfnManager {
|
|
|
46
46
|
throw `Step props undefined for ${id}`;
|
|
47
47
|
return new aws_stepfunctions_1.Succeed(scope, `${props.name}`, {
|
|
48
48
|
...props,
|
|
49
|
-
|
|
50
|
-
comment: `Succeed step for ${props.name} - ${scope.props.stage} stage`,
|
|
51
|
-
},
|
|
49
|
+
comment: `Succeed step for ${props.name} - ${scope.props.stage} stage`,
|
|
52
50
|
});
|
|
53
51
|
}
|
|
54
52
|
/**
|
|
@@ -62,9 +60,7 @@ class SfnManager {
|
|
|
62
60
|
throw `Step props undefined for ${id}`;
|
|
63
61
|
return new aws_stepfunctions_1.Fail(scope, `${props.name}`, {
|
|
64
62
|
...props,
|
|
65
|
-
|
|
66
|
-
comment: `Fail step for ${props.name} - ${scope.props.stage} stage`,
|
|
67
|
-
},
|
|
63
|
+
comment: `Fail step for ${props.name} - ${scope.props.stage} stage`,
|
|
68
64
|
});
|
|
69
65
|
}
|
|
70
66
|
/**
|
|
@@ -78,9 +74,7 @@ class SfnManager {
|
|
|
78
74
|
throw `Step props undefined for ${id}`;
|
|
79
75
|
return new aws_stepfunctions_1.Pass(scope, `${props.name}`, {
|
|
80
76
|
...props,
|
|
81
|
-
|
|
82
|
-
comment: `Pass step for ${props.name} - ${scope.props.stage} stage`,
|
|
83
|
-
},
|
|
77
|
+
comment: `Pass step for ${props.name} - ${scope.props.stage} stage`,
|
|
84
78
|
});
|
|
85
79
|
}
|
|
86
80
|
/**
|
|
@@ -94,9 +88,7 @@ class SfnManager {
|
|
|
94
88
|
throw `Step props undefined for ${id}`;
|
|
95
89
|
return new aws_stepfunctions_1.Parallel(scope, `${props.name}`, {
|
|
96
90
|
...props,
|
|
97
|
-
|
|
98
|
-
comment: `Parallel step for ${props.name} - ${scope.props.stage} stage`,
|
|
99
|
-
},
|
|
91
|
+
comment: `Parallel step for ${props.name} - ${scope.props.stage} stage`,
|
|
100
92
|
});
|
|
101
93
|
}
|
|
102
94
|
/**
|
|
@@ -110,9 +102,7 @@ class SfnManager {
|
|
|
110
102
|
throw `Step props undefined for ${id}`;
|
|
111
103
|
return new aws_stepfunctions_1.Choice(scope, `${props.name}`, {
|
|
112
104
|
...props,
|
|
113
|
-
|
|
114
|
-
comment: `Choice step for ${props.name} - ${scope.props.stage} stage`,
|
|
115
|
-
},
|
|
105
|
+
comment: `Choice step for ${props.name} - ${scope.props.stage} stage`,
|
|
116
106
|
});
|
|
117
107
|
}
|
|
118
108
|
/**
|
|
@@ -124,10 +114,8 @@ class SfnManager {
|
|
|
124
114
|
createWaitStep(id, scope, props) {
|
|
125
115
|
return new aws_stepfunctions_1.Wait(scope, `${props.name}`, {
|
|
126
116
|
...props,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
time: aws_stepfunctions_1.WaitTime.duration(aws_cdk_lib_1.Duration.seconds(props.delayInSeconds)),
|
|
130
|
-
},
|
|
117
|
+
comment: `Choice step for ${props.name} - ${scope.props.stage} stage`,
|
|
118
|
+
time: aws_stepfunctions_1.WaitTime.duration(aws_cdk_lib_1.Duration.seconds(props.delayInSeconds)),
|
|
131
119
|
});
|
|
132
120
|
}
|
|
133
121
|
/**
|
|
@@ -143,22 +131,9 @@ class SfnManager {
|
|
|
143
131
|
throw `Step props undefined for ${id}`;
|
|
144
132
|
const step = new aws_stepfunctions_tasks_1.DynamoGetItem(scope, `${props.name}`, {
|
|
145
133
|
...props,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
expressionAttributeNames: props.expressionAttributeNames,
|
|
150
|
-
heartbeatTimeout: props.heartbeatTimeout,
|
|
151
|
-
inputPath: props.inputPath,
|
|
152
|
-
integrationPattern: props.integrationPattern,
|
|
153
|
-
key: tableKey,
|
|
154
|
-
outputPath: props.outputPath,
|
|
155
|
-
projectionExpression: props.projectionExpression,
|
|
156
|
-
resultPath: props.resultPath,
|
|
157
|
-
resultSelector: props.resultSelector,
|
|
158
|
-
returnConsumedCapacity: props.returnConsumedCapacity,
|
|
159
|
-
table: table,
|
|
160
|
-
taskTimeout: props.taskTimeout,
|
|
161
|
-
},
|
|
134
|
+
comment: `DynamoDB GetItem step for ${props.name} - ${scope.props.stage} stage`,
|
|
135
|
+
key: tableKey,
|
|
136
|
+
table,
|
|
162
137
|
});
|
|
163
138
|
let retries = props.retries;
|
|
164
139
|
if (!retries || retries.length === 0) {
|
|
@@ -167,7 +142,7 @@ class SfnManager {
|
|
|
167
142
|
lodash_1.default.forEach(retries, retry => {
|
|
168
143
|
step.addRetry({
|
|
169
144
|
...retry,
|
|
170
|
-
|
|
145
|
+
interval: retry.intervalInSecs ? aws_cdk_lib_1.Duration.seconds(retry.intervalInSecs) : retry.interval,
|
|
171
146
|
});
|
|
172
147
|
});
|
|
173
148
|
return step;
|
|
@@ -185,24 +160,9 @@ class SfnManager {
|
|
|
185
160
|
throw `Step props undefined for ${id}`;
|
|
186
161
|
const step = new aws_stepfunctions_tasks_1.DynamoPutItem(scope, `${props.name}`, {
|
|
187
162
|
...props,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
expressionAttributeNames: props.expressionAttributeNames,
|
|
192
|
-
expressionAttributeValues: props.expressionAttributeValues,
|
|
193
|
-
heartbeatTimeout: props.heartbeatTimeout,
|
|
194
|
-
inputPath: props.inputPath,
|
|
195
|
-
integrationPattern: props.integrationPattern,
|
|
196
|
-
item: tableItem,
|
|
197
|
-
outputPath: props.outputPath,
|
|
198
|
-
resultPath: props.resultPath,
|
|
199
|
-
resultSelector: props.resultSelector,
|
|
200
|
-
returnConsumedCapacity: props.returnConsumedCapacity,
|
|
201
|
-
returnItemCollectionMetrics: props.returnItemCollectionMetrics,
|
|
202
|
-
returnValues: props.returnValues,
|
|
203
|
-
table: table,
|
|
204
|
-
taskTimeout: props.taskTimeout,
|
|
205
|
-
},
|
|
163
|
+
comment: `DynamoDB PutItem step for ${props.name} - ${scope.props.stage} stage`,
|
|
164
|
+
item: tableItem,
|
|
165
|
+
table,
|
|
206
166
|
});
|
|
207
167
|
let retries = props.retries;
|
|
208
168
|
if (!retries || retries.length === 0) {
|
|
@@ -229,24 +189,9 @@ class SfnManager {
|
|
|
229
189
|
throw `Step props undefined for ${id}`;
|
|
230
190
|
const step = new aws_stepfunctions_tasks_1.DynamoDeleteItem(scope, `${props.name}`, {
|
|
231
191
|
...props,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
expressionAttributeNames: props.expressionAttributeNames,
|
|
236
|
-
expressionAttributeValues: props.expressionAttributeValues,
|
|
237
|
-
heartbeatTimeout: props.heartbeatTimeout,
|
|
238
|
-
inputPath: props.inputPath,
|
|
239
|
-
integrationPattern: props.integrationPattern,
|
|
240
|
-
key: tableKey,
|
|
241
|
-
outputPath: props.outputPath,
|
|
242
|
-
resultPath: props.resultPath,
|
|
243
|
-
resultSelector: props.resultSelector,
|
|
244
|
-
returnConsumedCapacity: props.returnConsumedCapacity,
|
|
245
|
-
returnItemCollectionMetrics: props.returnItemCollectionMetrics,
|
|
246
|
-
returnValues: props.returnValues,
|
|
247
|
-
table: table,
|
|
248
|
-
taskTimeout: props.taskTimeout,
|
|
249
|
-
},
|
|
192
|
+
comment: `DynamoDB DeleteItem step for ${props.name} - ${scope.props.stage} stage`,
|
|
193
|
+
key: tableKey,
|
|
194
|
+
table,
|
|
250
195
|
});
|
|
251
196
|
let retries = props.retries;
|
|
252
197
|
if (!retries || retries.length === 0) {
|
|
@@ -274,21 +219,8 @@ class SfnManager {
|
|
|
274
219
|
throw 'Message body undefined';
|
|
275
220
|
const step = new aws_stepfunctions_tasks_1.SqsSendMessage(scope, `${props.name}`, {
|
|
276
221
|
...props,
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
delay: props.delay,
|
|
280
|
-
heartbeatTimeout: props.heartbeatTimeout,
|
|
281
|
-
inputPath: props.inputPath,
|
|
282
|
-
integrationPattern: props.integrationPattern,
|
|
283
|
-
messageBody: props.messageBody,
|
|
284
|
-
messageDeduplicationId: props.messageDeduplicationId,
|
|
285
|
-
messageGroupId: props.messageGroupId,
|
|
286
|
-
outputPath: props.outputPath,
|
|
287
|
-
queue: queue,
|
|
288
|
-
resultPath: props.resultPath,
|
|
289
|
-
resultSelector: props.resultSelector,
|
|
290
|
-
taskTimeout: props.taskTimeout,
|
|
291
|
-
},
|
|
222
|
+
comment: `DynamoDB PutItem step for ${props.name} - ${scope.props.stage} stage`,
|
|
223
|
+
queue,
|
|
292
224
|
});
|
|
293
225
|
let retries = props.retries;
|
|
294
226
|
if (!retries || retries.length === 0) {
|
|
@@ -297,7 +229,7 @@ class SfnManager {
|
|
|
297
229
|
lodash_1.default.forEach(retries, retry => {
|
|
298
230
|
step.addRetry({
|
|
299
231
|
...retry,
|
|
300
|
-
|
|
232
|
+
interval: retry.intervalInSecs ? aws_cdk_lib_1.Duration.seconds(retry.intervalInSecs) : retry.interval,
|
|
301
233
|
});
|
|
302
234
|
});
|
|
303
235
|
return step;
|
|
@@ -314,10 +246,8 @@ class SfnManager {
|
|
|
314
246
|
throw `Step props undefined for ${id}`;
|
|
315
247
|
const step = new aws_stepfunctions_tasks_1.LambdaInvoke(scope, `${props.name}`, {
|
|
316
248
|
...props,
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
lambdaFunction,
|
|
320
|
-
},
|
|
249
|
+
comment: `Lambda step for ${props.name} - ${scope.props.stage} stage`,
|
|
250
|
+
lambdaFunction,
|
|
321
251
|
});
|
|
322
252
|
let retries = props.retries;
|
|
323
253
|
if (!retries || retries.length === 0) {
|
|
@@ -326,7 +256,7 @@ class SfnManager {
|
|
|
326
256
|
lodash_1.default.forEach(retries, retry => {
|
|
327
257
|
step.addRetry({
|
|
328
258
|
...retry,
|
|
329
|
-
|
|
259
|
+
interval: retry.intervalInSecs ? aws_cdk_lib_1.Duration.seconds(retry.intervalInSecs) : retry.interval,
|
|
330
260
|
});
|
|
331
261
|
});
|
|
332
262
|
return step;
|
|
@@ -346,10 +276,8 @@ class SfnManager {
|
|
|
346
276
|
return this.createPassStep(id, scope, { comment: props.comment, name: props.name });
|
|
347
277
|
const step = new aws_stepfunctions_tasks_1.LambdaInvoke(scope, `${props.name}`, {
|
|
348
278
|
...props,
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
lambdaFunction,
|
|
352
|
-
},
|
|
279
|
+
comment: `Lambda step for ${props.name} - ${scope.props.stage} stage`,
|
|
280
|
+
lambdaFunction,
|
|
353
281
|
});
|
|
354
282
|
let retries = props.retries;
|
|
355
283
|
if (!retries || retries.length === 0) {
|
|
@@ -358,7 +286,7 @@ class SfnManager {
|
|
|
358
286
|
lodash_1.default.forEach(retries, retry => {
|
|
359
287
|
step.addRetry({
|
|
360
288
|
...retry,
|
|
361
|
-
|
|
289
|
+
interval: retry.intervalInSecs ? aws_cdk_lib_1.Duration.seconds(retry.intervalInSecs) : retry.interval,
|
|
362
290
|
});
|
|
363
291
|
});
|
|
364
292
|
return step;
|
|
@@ -375,11 +303,9 @@ class SfnManager {
|
|
|
375
303
|
throw `Step props undefined for ${id}`;
|
|
376
304
|
const step = new aws_stepfunctions_tasks_1.CallApiGatewayRestApiEndpoint(scope, `${props.name}`, {
|
|
377
305
|
...props,
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
stageName: scope.props.stage,
|
|
382
|
-
},
|
|
306
|
+
api,
|
|
307
|
+
comment: `API step for ${props.name} - ${scope.props.stage} stage`,
|
|
308
|
+
stageName: scope.props.stage,
|
|
383
309
|
});
|
|
384
310
|
let retries = props.retries;
|
|
385
311
|
if (!retries || retries.length === 0) {
|
|
@@ -388,7 +314,7 @@ class SfnManager {
|
|
|
388
314
|
lodash_1.default.forEach(retries, retry => {
|
|
389
315
|
step.addRetry({
|
|
390
316
|
...retry,
|
|
391
|
-
|
|
317
|
+
interval: retry.intervalInSecs ? aws_cdk_lib_1.Duration.seconds(retry.intervalInSecs) : retry.interval,
|
|
392
318
|
});
|
|
393
319
|
});
|
|
394
320
|
return step;
|
|
@@ -404,9 +330,8 @@ class SfnManager {
|
|
|
404
330
|
const step = new aws_stepfunctions_tasks_1.StepFunctionsStartExecution(scope, `${id}`, {
|
|
405
331
|
...props,
|
|
406
332
|
associateWithParent: props.associateWithParent ?? true,
|
|
407
|
-
inputPath: props.inputPath,
|
|
408
333
|
name: props.name ?? (0, uuid_1.v4)(),
|
|
409
|
-
stateMachine
|
|
334
|
+
stateMachine,
|
|
410
335
|
});
|
|
411
336
|
let retries = props.retries;
|
|
412
337
|
if (!retries || retries.length === 0) {
|
|
@@ -415,7 +340,7 @@ class SfnManager {
|
|
|
415
340
|
lodash_1.default.forEach(retries, retry => {
|
|
416
341
|
step.addRetry({
|
|
417
342
|
...retry,
|
|
418
|
-
|
|
343
|
+
interval: retry.intervalInSecs ? aws_cdk_lib_1.Duration.seconds(retry.intervalInSecs) : retry.interval,
|
|
419
344
|
});
|
|
420
345
|
});
|
|
421
346
|
return step;
|
|
@@ -442,6 +367,7 @@ class SfnManager {
|
|
|
442
367
|
if (!props)
|
|
443
368
|
throw `State Machine props undefined for ${id}`;
|
|
444
369
|
const stateMachine = new aws_stepfunctions_1.StateMachine(scope, `${id}`, {
|
|
370
|
+
...props,
|
|
445
371
|
definitionBody: aws_stepfunctions_1.DefinitionBody.fromChainable(definition),
|
|
446
372
|
logs: {
|
|
447
373
|
destination: logGroup,
|
|
@@ -450,9 +376,6 @@ class SfnManager {
|
|
|
450
376
|
},
|
|
451
377
|
role,
|
|
452
378
|
stateMachineName: `${props.stateMachineName}-${scope.props.stage}`,
|
|
453
|
-
stateMachineType: props.stateMachineType,
|
|
454
|
-
timeout: props.timeout,
|
|
455
|
-
tracingEnabled: props.tracingEnabled,
|
|
456
379
|
});
|
|
457
380
|
(0, utils_1.createCfnOutput)(`${id}-stateMachineName`, scope, stateMachine.stateMachineName);
|
|
458
381
|
(0, utils_1.createCfnOutput)(`${id}-stateMachineArn`, scope, stateMachine.stateMachineArn);
|
|
@@ -32,9 +32,9 @@ class SsmManager {
|
|
|
32
32
|
if (!props)
|
|
33
33
|
throw `Parameter props undefined for ${id}`;
|
|
34
34
|
const parameter = new aws_ssm_1.StringParameter(scope, `${id}`, {
|
|
35
|
+
...props,
|
|
35
36
|
description: `${props.description} - ${scope.props.stage} stage`,
|
|
36
37
|
parameterName: `${props.parameterName}-${scope.props.stage}`,
|
|
37
|
-
stringValue: props.stringValue,
|
|
38
38
|
});
|
|
39
39
|
(0, utils_1.createCfnOutput)(`${id}-parameterArn`, scope, parameter.parameterArn);
|
|
40
40
|
(0, utils_1.createCfnOutput)(`${id}-parameterName`, scope, parameter.parameterName);
|
|
@@ -64,8 +64,8 @@ class SsmManager {
|
|
|
64
64
|
if (!region || region == '')
|
|
65
65
|
throw `Invalid region for ${id}`;
|
|
66
66
|
return new SSMParameterReader(scope, `${id}`, {
|
|
67
|
-
parameterName
|
|
68
|
-
region
|
|
67
|
+
parameterName,
|
|
68
|
+
region,
|
|
69
69
|
}).getParameterValue();
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -38,8 +38,7 @@ class VpcManager {
|
|
|
38
38
|
if (!props)
|
|
39
39
|
throw `Vpc props undefined for ${id}`;
|
|
40
40
|
const vpc = new aws_ec2_1.Vpc(scope, `${id}`, {
|
|
41
|
-
|
|
42
|
-
maxAzs: props.maxAzs,
|
|
41
|
+
...props,
|
|
43
42
|
});
|
|
44
43
|
(0, utils_1.createCfnOutput)(`${id}Id`, scope, vpc.vpcId);
|
|
45
44
|
(0, utils_1.createCfnOutput)(`${id}PublicSubnetIds`, scope, lodash_1.default.map(vpc.publicSubnets, subnet => subnet.subnetId).toString());
|
|
@@ -30,11 +30,9 @@ class WafManager {
|
|
|
30
30
|
if (!props)
|
|
31
31
|
throw `WAF Ip Set props undefined for ${id}`;
|
|
32
32
|
const ipSet = new aws_wafv2_1.CfnIPSet(scope, `${id}`, {
|
|
33
|
-
|
|
33
|
+
...props,
|
|
34
34
|
description: `IP Set for ${id} - ${scope.props.stage} stage`,
|
|
35
|
-
ipAddressVersion: props.ipAddressVersion,
|
|
36
35
|
name: scope.isProductionStage() ? props.name : `${props.name}-${scope.props.stage}`,
|
|
37
|
-
scope: props.scope,
|
|
38
36
|
});
|
|
39
37
|
(0, utils_1.createCfnOutput)(`${id}-ipSetId`, scope, ipSet.attrId);
|
|
40
38
|
(0, utils_1.createCfnOutput)(`${id}-ipSetArn`, scope, ipSet.attrArn);
|
|
@@ -50,13 +48,10 @@ class WafManager {
|
|
|
50
48
|
if (!props)
|
|
51
49
|
throw `WAF WebACL props undefined for ${id}`;
|
|
52
50
|
const webAcl = new aws_wafv2_1.CfnWebACL(scope, `${id}`, {
|
|
53
|
-
|
|
51
|
+
...props,
|
|
54
52
|
description: `Web Acl for ${id} - ${scope.props.stage} stage`,
|
|
55
53
|
name: scope.isProductionStage() ? props.name : `${props.name}-${scope.props.stage}`,
|
|
56
|
-
rules: props.rules,
|
|
57
|
-
scope: props.scope,
|
|
58
54
|
tags: [{ key: 'service', value: scope.props.name }],
|
|
59
|
-
visibilityConfig: props.visibilityConfig,
|
|
60
55
|
});
|
|
61
56
|
(0, utils_1.createCfnOutput)(`${id}-webAclId`, scope, webAcl.attrId);
|
|
62
57
|
(0, utils_1.createCfnOutput)(`${id}-webAclArn`, scope, webAcl.attrArn);
|