@gradientedge/cdk-utils 8.124.0 → 8.126.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/rimraf +4 -4
- 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 +25 -66
- 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.d.ts +3 -2
- package/dist/src/lib/aws/services/lambda/main.js +48 -64
- 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 +25 -66
- 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 +57 -73
- 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,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);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradientedge/cdk-utils",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.126.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.
|
|
50
|
-
"@aws-sdk/credential-providers": "^3.
|
|
51
|
-
"@aws-sdk/types": "^3.
|
|
52
|
-
"@cdktf/provider-azurerm": "^10.0.
|
|
53
|
-
"@types/lodash": "^4.14.
|
|
54
|
-
"@types/node": "^20.
|
|
55
|
-
"@types/uuid": "^9.0.
|
|
49
|
+
"@aws-sdk/client-secrets-manager": "^3.418.0",
|
|
50
|
+
"@aws-sdk/credential-providers": "^3.418.0",
|
|
51
|
+
"@aws-sdk/types": "^3.418.0",
|
|
52
|
+
"@cdktf/provider-azurerm": "^10.0.4",
|
|
53
|
+
"@types/lodash": "^4.14.199",
|
|
54
|
+
"@types/node": "^20.7.0",
|
|
55
|
+
"@types/uuid": "^9.0.4",
|
|
56
56
|
"app-root-path": "^3.1.0",
|
|
57
|
-
"aws-cdk-lib": "^2.
|
|
57
|
+
"aws-cdk-lib": "^2.97.1",
|
|
58
58
|
"cdktf": "^0.18.0",
|
|
59
59
|
"constructs": "^10.2.70",
|
|
60
60
|
"lodash": "^4.17.21",
|
|
@@ -65,22 +65,22 @@
|
|
|
65
65
|
"uuid": "^9.0.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@babel/core": "^7.
|
|
68
|
+
"@babel/core": "^7.23.0",
|
|
69
69
|
"@babel/eslint-parser": "^7.22.15",
|
|
70
70
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
71
|
-
"@types/jest": "^29.5.
|
|
72
|
-
"@typescript-eslint/eslint-plugin": "^6.7.
|
|
73
|
-
"@typescript-eslint/parser": "^6.7.
|
|
74
|
-
"aws-cdk": "^2.
|
|
71
|
+
"@types/jest": "^29.5.5",
|
|
72
|
+
"@typescript-eslint/eslint-plugin": "^6.7.3",
|
|
73
|
+
"@typescript-eslint/parser": "^6.7.3",
|
|
74
|
+
"aws-cdk": "^2.97.1",
|
|
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.
|
|
80
|
+
"eslint": "^8.50.0",
|
|
81
81
|
"eslint-config-prettier": "^9.0.0",
|
|
82
82
|
"eslint-plugin-import": "^2.28.1",
|
|
83
|
-
"eslint-plugin-jsdoc": "^46.
|
|
83
|
+
"eslint-plugin-jsdoc": "^46.8.2",
|
|
84
84
|
"husky": "^8.0.3",
|
|
85
85
|
"jest": "^29.7.0",
|
|
86
86
|
"jest-extended": "^4.0.1",
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
"jsdoc-to-markdown": "^8.0.0",
|
|
93
93
|
"prettier": "^3.0.3",
|
|
94
94
|
"prettier-plugin-organize-imports": "^3.2.3",
|
|
95
|
-
"rimraf": "^5.0.
|
|
96
|
-
"semantic-release": "^
|
|
95
|
+
"rimraf": "^5.0.4",
|
|
96
|
+
"semantic-release": "^22.0.5",
|
|
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
|
-
|
|
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 }],
|