@gradientedge/cdk-utils 8.91.0 → 8.92.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/.eslintrc.json +40 -0
- package/app/api-destined-function/src/lib/lambda.ts +6 -6
- package/dist/app/api-destined-function/src/lib/lambda.d.ts +6 -6
- package/dist/app/api-destined-function/src/lib/lambda.js +6 -6
- package/dist/lib/lambda.d.ts +6 -6
- package/dist/lib/lambda.js +6 -6
- package/dist/lib/lambda.js.map +1 -1
- package/dist/src/lib/common/construct.d.ts +4 -7
- package/dist/src/lib/common/construct.js +4 -7
- package/dist/src/lib/common/stack.d.ts +9 -13
- package/dist/src/lib/common/stack.js +9 -13
- package/dist/src/lib/common/types.d.ts +0 -2
- package/dist/src/lib/construct/api-to-eventbridge-target/api.d.ts +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/api.js +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/event.d.ts +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/event.js +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +0 -27
- package/dist/src/lib/construct/api-to-eventbridge-target/main.js +41 -68
- package/dist/src/lib/construct/api-to-eventbridge-target/types.d.ts +13 -25
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.js +0 -3
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.d.ts +0 -37
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.js +44 -81
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/types.d.ts +1 -5
- package/dist/src/lib/construct/api-to-lambda-target/api.d.ts +0 -3
- package/dist/src/lib/construct/api-to-lambda-target/api.js +0 -3
- package/dist/src/lib/construct/api-to-lambda-target/main.d.ts +0 -14
- package/dist/src/lib/construct/api-to-lambda-target/main.js +7 -21
- package/dist/src/lib/construct/api-to-lambda-target/types.d.ts +7 -13
- package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +0 -18
- package/dist/src/lib/construct/graphql-api-lambda/main.js +1 -19
- package/dist/src/lib/construct/graphql-api-lambda/types.d.ts +4 -8
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.d.ts +0 -11
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.js +1 -12
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/types.d.ts +1 -3
- package/dist/src/lib/construct/lambda-with-iam-access/main.d.ts +0 -12
- package/dist/src/lib/construct/lambda-with-iam-access/main.js +2 -14
- package/dist/src/lib/construct/rest-api-lambda/main.d.ts +0 -18
- package/dist/src/lib/construct/rest-api-lambda/main.js +1 -19
- package/dist/src/lib/construct/rest-api-lambda/types.d.ts +6 -10
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.d.ts +0 -11
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.js +3 -14
- package/dist/src/lib/construct/rest-api-lambda-with-cache/types.d.ts +1 -3
- package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +0 -25
- package/dist/src/lib/construct/site-with-ecs-backend/main.js +32 -52
- package/dist/src/lib/construct/site-with-ecs-backend/types.d.ts +10 -11
- package/dist/src/lib/construct/static-asset-deployment/main.d.ts +0 -8
- package/dist/src/lib/construct/static-asset-deployment/main.js +0 -8
- package/dist/src/lib/construct/static-asset-deployment/types.d.ts +1 -1
- package/dist/src/lib/construct/static-site/main.d.ts +0 -17
- package/dist/src/lib/construct/static-site/main.js +1 -18
- package/dist/src/lib/construct/static-site/types.d.ts +9 -11
- package/dist/src/lib/services/aws/api-gateway/main.d.ts +21 -25
- package/dist/src/lib/services/aws/api-gateway/main.js +42 -46
- package/dist/src/lib/services/aws/api-gateway/types.d.ts +0 -2
- package/dist/src/lib/services/aws/appconfig/constants.d.ts +0 -6
- package/dist/src/lib/services/aws/appconfig/constants.js +26 -32
- package/dist/src/lib/services/aws/appconfig/main.d.ts +16 -19
- package/dist/src/lib/services/aws/appconfig/main.js +19 -22
- package/dist/src/lib/services/aws/appconfig/types.d.ts +1 -3
- package/dist/src/lib/services/aws/certificate-manager/main.d.ts +5 -10
- package/dist/src/lib/services/aws/certificate-manager/main.js +5 -10
- package/dist/src/lib/services/aws/certificate-manager/types.d.ts +3 -5
- package/dist/src/lib/services/aws/cloudfront/main.d.ts +41 -47
- package/dist/src/lib/services/aws/cloudfront/main.js +56 -62
- package/dist/src/lib/services/aws/cloudfront/types.d.ts +1 -7
- package/dist/src/lib/services/aws/cloudtrail/main.d.ts +8 -12
- package/dist/src/lib/services/aws/cloudtrail/main.js +8 -12
- package/dist/src/lib/services/aws/cloudtrail/types.d.ts +0 -2
- package/dist/src/lib/services/aws/cloudwatch/logs.d.ts +11 -15
- package/dist/src/lib/services/aws/cloudwatch/logs.js +15 -19
- package/dist/src/lib/services/aws/cloudwatch/main.d.ts +80 -84
- package/dist/src/lib/services/aws/cloudwatch/main.js +116 -122
- package/dist/src/lib/services/aws/cloudwatch/types.d.ts +20 -42
- package/dist/src/lib/services/aws/codebuild/main.d.ts +0 -4
- package/dist/src/lib/services/aws/codebuild/main.js +3 -7
- package/dist/src/lib/services/aws/dynamodb/main.d.ts +3 -7
- package/dist/src/lib/services/aws/dynamodb/main.js +13 -17
- package/dist/src/lib/services/aws/dynamodb/types.d.ts +0 -2
- package/dist/src/lib/services/aws/elastic-container-registry/main.d.ts +3 -7
- package/dist/src/lib/services/aws/elastic-container-registry/main.js +3 -7
- package/dist/src/lib/services/aws/elastic-container-service/main.d.ts +19 -23
- package/dist/src/lib/services/aws/elastic-container-service/main.js +35 -39
- package/dist/src/lib/services/aws/elastic-container-service/types.d.ts +1 -9
- package/dist/src/lib/services/aws/elastic-file-system/main.d.ts +9 -13
- package/dist/src/lib/services/aws/elastic-file-system/main.js +14 -18
- package/dist/src/lib/services/aws/elastic-file-system/types.d.ts +1 -5
- package/dist/src/lib/services/aws/elastic-kubernetes-service/main.d.ts +5 -9
- package/dist/src/lib/services/aws/elastic-kubernetes-service/main.js +8 -12
- package/dist/src/lib/services/aws/elastic-kubernetes-service/types.d.ts +1 -3
- package/dist/src/lib/services/aws/elasticache/main.d.ts +14 -18
- package/dist/src/lib/services/aws/elasticache/main.js +35 -39
- package/dist/src/lib/services/aws/elasticache/types.d.ts +0 -4
- package/dist/src/lib/services/aws/eventbridge/main.d.ts +25 -29
- package/dist/src/lib/services/aws/eventbridge/main.js +34 -38
- package/dist/src/lib/services/aws/eventbridge/target.d.ts +6 -9
- package/dist/src/lib/services/aws/eventbridge/target.js +8 -10
- package/dist/src/lib/services/aws/eventbridge/types.d.ts +2 -10
- package/dist/src/lib/services/aws/evidently/main.d.ts +15 -19
- package/dist/src/lib/services/aws/evidently/main.js +19 -23
- package/dist/src/lib/services/aws/evidently/types.d.ts +0 -10
- package/dist/src/lib/services/aws/identity-access-management/main.d.ts +66 -70
- package/dist/src/lib/services/aws/identity-access-management/main.js +97 -101
- package/dist/src/lib/services/aws/key-management-service/main.d.ts +3 -7
- package/dist/src/lib/services/aws/key-management-service/main.js +6 -10
- package/dist/src/lib/services/aws/key-management-service/types.d.ts +0 -2
- package/dist/src/lib/services/aws/lambda/main.d.ts +42 -47
- package/dist/src/lib/services/aws/lambda/main.js +64 -69
- package/dist/src/lib/services/aws/lambda/types.d.ts +6 -16
- package/dist/src/lib/services/aws/route53/main.d.ts +17 -21
- package/dist/src/lib/services/aws/route53/main.js +19 -23
- package/dist/src/lib/services/aws/route53/types.d.ts +0 -2
- package/dist/src/lib/services/aws/secrets-manager/main.d.ts +6 -19
- package/dist/src/lib/services/aws/secrets-manager/main.js +6 -25
- package/dist/src/lib/services/aws/simple-notification-service/main.d.ts +8 -12
- package/dist/src/lib/services/aws/simple-notification-service/main.js +10 -14
- package/dist/src/lib/services/aws/simple-notification-service/types.d.ts +0 -2
- package/dist/src/lib/services/aws/simple-queue-service/main.d.ts +11 -15
- package/dist/src/lib/services/aws/simple-queue-service/main.js +19 -23
- package/dist/src/lib/services/aws/simple-queue-service/types.d.ts +4 -6
- package/dist/src/lib/services/aws/simple-storage-service/main.d.ts +24 -32
- package/dist/src/lib/services/aws/simple-storage-service/main.js +32 -40
- package/dist/src/lib/services/aws/simple-storage-service/types.d.ts +2 -8
- package/dist/src/lib/services/aws/step-function/main.d.ts +55 -59
- package/dist/src/lib/services/aws/step-function/main.js +91 -95
- package/dist/src/lib/services/aws/step-function/types.d.ts +0 -32
- package/dist/src/lib/services/aws/systems-manager/main.d.ts +10 -16
- package/dist/src/lib/services/aws/systems-manager/main.js +13 -19
- package/dist/src/lib/services/aws/systems-manager/types.d.ts +0 -2
- package/dist/src/lib/services/aws/virtual-private-cloud/main.d.ts +9 -12
- package/dist/src/lib/services/aws/virtual-private-cloud/main.js +10 -16
- package/dist/src/lib/services/aws/web-application-firewall/main.d.ts +6 -10
- package/dist/src/lib/services/aws/web-application-firewall/main.js +12 -16
- package/dist/src/lib/services/aws/web-application-firewall/types.d.ts +0 -4
- package/dist/src/lib/types/aws/index.d.ts +0 -2
- package/dist/src/lib/utils/aws/index.d.ts +6 -9
- package/dist/src/lib/utils/aws/index.js +7 -10
- package/dist/src/lib/utils/index.d.ts +6 -13
- package/dist/src/lib/utils/index.js +4 -12
- package/package.json +1 -1
- package/src/lib/common/construct.ts +4 -7
- package/src/lib/common/stack.ts +9 -13
- package/src/lib/common/types.ts +0 -2
- package/src/lib/construct/api-to-eventbridge-target/api.ts +0 -3
- package/src/lib/construct/api-to-eventbridge-target/event.ts +0 -3
- package/src/lib/construct/api-to-eventbridge-target/main.ts +41 -68
- package/src/lib/construct/api-to-eventbridge-target/types.ts +13 -25
- package/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +0 -3
- package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +44 -81
- package/src/lib/construct/api-to-eventbridge-target-with-sns/types.ts +1 -5
- package/src/lib/construct/api-to-lambda-target/api.ts +0 -3
- package/src/lib/construct/api-to-lambda-target/main.ts +7 -21
- package/src/lib/construct/api-to-lambda-target/types.ts +7 -13
- package/src/lib/construct/graphql-api-lambda/main.ts +1 -19
- package/src/lib/construct/graphql-api-lambda/types.ts +4 -8
- package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +1 -12
- package/src/lib/construct/graphql-api-lambda-with-cache/types.ts +1 -3
- package/src/lib/construct/lambda-with-iam-access/main.ts +2 -14
- package/src/lib/construct/rest-api-lambda/main.ts +1 -19
- package/src/lib/construct/rest-api-lambda/types.ts +6 -10
- package/src/lib/construct/rest-api-lambda-with-cache/main.ts +3 -14
- package/src/lib/construct/rest-api-lambda-with-cache/types.ts +1 -3
- package/src/lib/construct/site-with-ecs-backend/main.ts +31 -52
- package/src/lib/construct/site-with-ecs-backend/types.ts +10 -11
- package/src/lib/construct/static-asset-deployment/main.ts +0 -8
- package/src/lib/construct/static-asset-deployment/types.ts +1 -1
- package/src/lib/construct/static-site/main.ts +1 -18
- package/src/lib/construct/static-site/types.ts +9 -11
- package/src/lib/services/aws/api-gateway/main.ts +43 -47
- package/src/lib/services/aws/api-gateway/types.ts +0 -2
- package/src/lib/services/aws/appconfig/constants.ts +26 -32
- package/src/lib/services/aws/appconfig/main.ts +19 -22
- package/src/lib/services/aws/appconfig/types.ts +1 -3
- package/src/lib/services/aws/certificate-manager/main.ts +5 -10
- package/src/lib/services/aws/certificate-manager/types.ts +3 -5
- package/src/lib/services/aws/cloudfront/main.ts +56 -62
- package/src/lib/services/aws/cloudfront/types.ts +1 -7
- package/src/lib/services/aws/cloudtrail/main.ts +8 -12
- package/src/lib/services/aws/cloudtrail/types.ts +0 -2
- package/src/lib/services/aws/cloudwatch/logs.ts +15 -19
- package/src/lib/services/aws/cloudwatch/main.ts +116 -122
- package/src/lib/services/aws/cloudwatch/types.ts +20 -42
- package/src/lib/services/aws/codebuild/main.ts +3 -7
- package/src/lib/services/aws/dynamodb/main.ts +13 -17
- package/src/lib/services/aws/dynamodb/types.ts +0 -2
- package/src/lib/services/aws/elastic-container-registry/main.ts +3 -7
- package/src/lib/services/aws/elastic-container-service/main.ts +35 -39
- package/src/lib/services/aws/elastic-container-service/types.ts +1 -9
- package/src/lib/services/aws/elastic-file-system/main.ts +14 -18
- package/src/lib/services/aws/elastic-file-system/types.ts +1 -5
- package/src/lib/services/aws/elastic-kubernetes-service/main.ts +8 -12
- package/src/lib/services/aws/elastic-kubernetes-service/types.ts +1 -3
- package/src/lib/services/aws/elasticache/main.ts +35 -39
- package/src/lib/services/aws/elasticache/types.ts +0 -4
- package/src/lib/services/aws/eventbridge/main.ts +34 -38
- package/src/lib/services/aws/eventbridge/target.ts +8 -11
- package/src/lib/services/aws/eventbridge/types.ts +2 -10
- package/src/lib/services/aws/evidently/main.ts +19 -23
- package/src/lib/services/aws/evidently/types.ts +0 -10
- package/src/lib/services/aws/identity-access-management/main.ts +97 -101
- package/src/lib/services/aws/key-management-service/main.ts +6 -10
- package/src/lib/services/aws/key-management-service/types.ts +0 -2
- package/src/lib/services/aws/lambda/main.ts +64 -69
- package/src/lib/services/aws/lambda/types.ts +6 -16
- package/src/lib/services/aws/route53/main.ts +19 -23
- package/src/lib/services/aws/route53/types.ts +0 -2
- package/src/lib/services/aws/secrets-manager/main.ts +6 -28
- package/src/lib/services/aws/simple-notification-service/main.ts +10 -14
- package/src/lib/services/aws/simple-notification-service/types.ts +0 -2
- package/src/lib/services/aws/simple-queue-service/main.ts +19 -23
- package/src/lib/services/aws/simple-queue-service/types.ts +4 -6
- package/src/lib/services/aws/simple-storage-service/main.ts +32 -40
- package/src/lib/services/aws/simple-storage-service/types.ts +2 -8
- package/src/lib/services/aws/step-function/main.ts +91 -95
- package/src/lib/services/aws/step-function/types.ts +0 -32
- package/src/lib/services/aws/systems-manager/main.ts +13 -19
- package/src/lib/services/aws/systems-manager/types.ts +0 -2
- package/src/lib/services/aws/virtual-private-cloud/main.ts +10 -16
- package/src/lib/services/aws/web-application-firewall/main.ts +12 -16
- package/src/lib/services/aws/web-application-firewall/types.ts +0 -4
- package/src/lib/types/aws/index.ts +0 -2
- package/src/lib/utils/aws/index.ts +7 -10
- package/src/lib/utils/index.ts +4 -12
|
@@ -2,17 +2,15 @@ import * as sqs from 'aws-cdk-lib/aws-sqs'
|
|
|
2
2
|
import { TagProps } from '../../../types'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* @category cdk-utils.sqs-manager
|
|
6
|
-
* @subcategory Properties
|
|
7
5
|
*/
|
|
8
6
|
export interface QueueProps extends sqs.QueueProps {
|
|
9
|
-
maxReceiveCount?: number
|
|
10
|
-
visibilityTimeoutInSecs?: number
|
|
11
|
-
receiveMessageWaitTimeInSecs?: number
|
|
12
7
|
dataKeyReuseInSecs?: number
|
|
13
8
|
deliveryDelayInSecs?: number
|
|
9
|
+
maxReceiveCount?: number
|
|
10
|
+
receiveMessageWaitTimeInSecs?: number
|
|
14
11
|
retentionInDays?: number
|
|
15
|
-
tags?: TagProps[]
|
|
16
12
|
retriesEnabled?: boolean
|
|
17
13
|
retryBatchSize?: number
|
|
14
|
+
tags?: TagProps[]
|
|
15
|
+
visibilityTimeoutInSecs?: number
|
|
18
16
|
}
|
|
@@ -8,9 +8,6 @@ import { LifecycleRule, S3BucketProps } from './types'
|
|
|
8
8
|
import { CommonConstruct } from '../../../common'
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* @stability stable
|
|
12
|
-
* @category cdk-utils.s3-manager
|
|
13
|
-
* @subcategory Construct
|
|
14
11
|
* @classdesc Provides operations on AWS S3.
|
|
15
12
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
16
13
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -24,14 +21,12 @@ import { CommonConstruct } from '../../../common'
|
|
|
24
21
|
* this.s3Manager.createS3Bucket('MyBucket', this)
|
|
25
22
|
* }
|
|
26
23
|
* }
|
|
27
|
-
*
|
|
28
24
|
* @see [CDK S3 Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3-readme.html}
|
|
29
25
|
*/
|
|
30
26
|
export class S3Manager {
|
|
31
27
|
/**
|
|
32
28
|
* @summary Method to determine S3 Bucket lifecycle properties
|
|
33
|
-
* @param
|
|
34
|
-
* @private
|
|
29
|
+
* @param props bucket properties
|
|
35
30
|
*/
|
|
36
31
|
protected determineBucketLifecycleRules(props: S3BucketProps) {
|
|
37
32
|
if (!props.lifecycleRules) return undefined
|
|
@@ -39,19 +34,19 @@ export class S3Manager {
|
|
|
39
34
|
const bucketLifecycleRules: LifecycleRule[] = []
|
|
40
35
|
props.lifecycleRules.forEach(lifecycleRule => {
|
|
41
36
|
bucketLifecycleRules.push({
|
|
42
|
-
id: lifecycleRule.id,
|
|
43
|
-
enabled: lifecycleRule.enabled,
|
|
44
37
|
abortIncompleteMultipartUploadAfter: lifecycleRule.abortIncompleteMultipartUploadAfter,
|
|
45
|
-
|
|
38
|
+
enabled: lifecycleRule.enabled,
|
|
46
39
|
expiration: lifecycleRule.expirationInDays ? cdk.Duration.days(lifecycleRule.expirationInDays) : undefined,
|
|
40
|
+
expirationDate: lifecycleRule.expirationDate,
|
|
41
|
+
expiredObjectDeleteMarker: lifecycleRule.expiredObjectDeleteMarker,
|
|
42
|
+
id: lifecycleRule.id,
|
|
47
43
|
noncurrentVersionExpiration: lifecycleRule.noncurrentVersionExpirationInDays
|
|
48
44
|
? cdk.Duration.days(lifecycleRule.noncurrentVersionExpirationInDays)
|
|
49
45
|
: undefined,
|
|
50
46
|
noncurrentVersionTransitions: lifecycleRule.noncurrentVersionTransitions,
|
|
51
|
-
transitions: lifecycleRule.transitions,
|
|
52
47
|
prefix: lifecycleRule.prefix,
|
|
53
48
|
tagFilters: lifecycleRule.tagFilters,
|
|
54
|
-
|
|
49
|
+
transitions: lifecycleRule.transitions,
|
|
55
50
|
})
|
|
56
51
|
})
|
|
57
52
|
|
|
@@ -60,9 +55,8 @@ export class S3Manager {
|
|
|
60
55
|
|
|
61
56
|
/**
|
|
62
57
|
* @summary Method to determine the bucket name using account and region
|
|
63
|
-
* @param
|
|
64
|
-
* @param
|
|
65
|
-
* @protected
|
|
58
|
+
* @param scope scope in which this resource is defined
|
|
59
|
+
* @param bucketName the bucket name
|
|
66
60
|
*/
|
|
67
61
|
protected static determineBucketNameByAccountAndRegion(scope: CommonConstruct, bucketName: string) {
|
|
68
62
|
return `${bucketName}-${cdk.Stack.of(scope).account}-${scope.props.region}-${scope.props.stage}`
|
|
@@ -70,9 +64,8 @@ export class S3Manager {
|
|
|
70
64
|
|
|
71
65
|
/**
|
|
72
66
|
* @summary Method to determine the bucket name using domain name
|
|
73
|
-
* @param
|
|
74
|
-
* @param
|
|
75
|
-
* @protected
|
|
67
|
+
* @param scope scope in which this resource is defined
|
|
68
|
+
* @param bucketName the bucket name
|
|
76
69
|
*/
|
|
77
70
|
protected static determineBucketNameByDomainName(scope: CommonConstruct, bucketName: string) {
|
|
78
71
|
return scope.isProductionStage()
|
|
@@ -82,9 +75,8 @@ export class S3Manager {
|
|
|
82
75
|
|
|
83
76
|
/**
|
|
84
77
|
* @summary Method to determine the bucket name
|
|
85
|
-
* @param
|
|
86
|
-
* @param
|
|
87
|
-
* @private
|
|
78
|
+
* @param scope scope in which this resource is defined
|
|
79
|
+
* @param bucketName the bucket name
|
|
88
80
|
*/
|
|
89
81
|
public static determineBucketName(scope: CommonConstruct, bucketName: string) {
|
|
90
82
|
return scope.props.excludeDomainNameForBuckets
|
|
@@ -94,9 +86,9 @@ export class S3Manager {
|
|
|
94
86
|
|
|
95
87
|
/**
|
|
96
88
|
* @summary Method to create a s3 bucket
|
|
97
|
-
* @param
|
|
98
|
-
* @param
|
|
99
|
-
* @param
|
|
89
|
+
* @param id scoped id of the resource
|
|
90
|
+
* @param scope scope in which this resource is defined
|
|
91
|
+
* @param props bucket properties
|
|
100
92
|
*/
|
|
101
93
|
public createS3Bucket(id: string, scope: CommonConstruct, props: S3BucketProps) {
|
|
102
94
|
if (!props) throw `S3 props undefined for ${id}`
|
|
@@ -129,10 +121,10 @@ export class S3Manager {
|
|
|
129
121
|
removalPolicy: props.removalPolicy || cdk.RemovalPolicy.RETAIN,
|
|
130
122
|
serverAccessLogsBucket: logBucket,
|
|
131
123
|
serverAccessLogsPrefix: props.serverAccessLogsPrefix,
|
|
132
|
-
|
|
124
|
+
versioned: props.versioned,
|
|
133
125
|
websiteErrorDocument: props.websiteErrorDocument,
|
|
126
|
+
websiteIndexDocument: props.websiteIndexDocument,
|
|
134
127
|
websiteRoutingRules: props.websiteRoutingRules,
|
|
135
|
-
versioned: props.versioned,
|
|
136
128
|
})
|
|
137
129
|
|
|
138
130
|
const cfnBucket = bucket.node.defaultChild as s3.CfnBucket
|
|
@@ -157,9 +149,9 @@ export class S3Manager {
|
|
|
157
149
|
|
|
158
150
|
/**
|
|
159
151
|
* @summary Method to create an iam bucket policy for cloudtrail
|
|
160
|
-
* @param
|
|
161
|
-
* @param
|
|
162
|
-
* @param
|
|
152
|
+
* @param id scoped id of the resource
|
|
153
|
+
* @param scope scope in which this resource is defined
|
|
154
|
+
* @param bucket
|
|
163
155
|
*/
|
|
164
156
|
public createBucketPolicyForCloudTrail(id: string, scope: CommonConstruct, bucket: s3.IBucket) {
|
|
165
157
|
const bucketPolicyDocument = new iam.PolicyDocument({
|
|
@@ -189,13 +181,13 @@ export class S3Manager {
|
|
|
189
181
|
|
|
190
182
|
/**
|
|
191
183
|
* @summary Method to create a s3 bucket deployment
|
|
192
|
-
* @param
|
|
193
|
-
* @param
|
|
194
|
-
* @param
|
|
195
|
-
* @param
|
|
196
|
-
* @param
|
|
197
|
-
* @param
|
|
198
|
-
* @param
|
|
184
|
+
* @param id scoped id of the resource
|
|
185
|
+
* @param scope scope in which this resource is defined
|
|
186
|
+
* @param siteBucket
|
|
187
|
+
* @param distribution
|
|
188
|
+
* @param sources
|
|
189
|
+
* @param prefix
|
|
190
|
+
* @param prune
|
|
199
191
|
*/
|
|
200
192
|
public doBucketDeployment(
|
|
201
193
|
id: string,
|
|
@@ -220,10 +212,10 @@ export class S3Manager {
|
|
|
220
212
|
|
|
221
213
|
/**
|
|
222
214
|
*
|
|
223
|
-
* @param
|
|
224
|
-
* @param
|
|
225
|
-
* @param
|
|
226
|
-
* @param
|
|
215
|
+
* @param id scoped id of the resource
|
|
216
|
+
* @param scope scope in which this resource is defined
|
|
217
|
+
* @param bucket bucket to create the folders in
|
|
218
|
+
* @param folders list of folder names to be created in the bucket
|
|
227
219
|
*/
|
|
228
220
|
public createBucketFolders(id: string, scope: CommonConstruct, bucket: s3.IBucket, folders: string[]) {
|
|
229
221
|
if (!folders || folders.length == 0) {
|
|
@@ -234,8 +226,8 @@ export class S3Manager {
|
|
|
234
226
|
new s3deploy.BucketDeployment(scope, `${id}-${folder}`, {
|
|
235
227
|
destinationBucket: bucket,
|
|
236
228
|
destinationKeyPrefix: folder,
|
|
237
|
-
sources: [s3deploy.Source.data('README.md', `This is the ${folder} folder for ${id}`)],
|
|
238
229
|
prune: false,
|
|
230
|
+
sources: [s3deploy.Source.data('README.md', `This is the ${folder} folder for ${id}`)],
|
|
239
231
|
})
|
|
240
232
|
})
|
|
241
233
|
}
|
|
@@ -3,8 +3,6 @@ import * as s3 from 'aws-cdk-lib/aws-s3'
|
|
|
3
3
|
import * as s3deploy from 'aws-cdk-lib/aws-s3-deployment'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* @category cdk-utils.s3-manager
|
|
7
|
-
* @subcategory Properties
|
|
8
6
|
*/
|
|
9
7
|
export interface LifecycleRule extends s3.LifecycleRule {
|
|
10
8
|
expirationInDays?: number
|
|
@@ -12,8 +10,6 @@ export interface LifecycleRule extends s3.LifecycleRule {
|
|
|
12
10
|
}
|
|
13
11
|
|
|
14
12
|
/**
|
|
15
|
-
* @category cdk-utils.s3-manager
|
|
16
|
-
* @subcategory Properties
|
|
17
13
|
*/
|
|
18
14
|
export interface BucketDeploymentProps extends s3deploy.BucketDeploymentProps {
|
|
19
15
|
expirationInDays?: number
|
|
@@ -21,14 +17,12 @@ export interface BucketDeploymentProps extends s3deploy.BucketDeploymentProps {
|
|
|
21
17
|
}
|
|
22
18
|
|
|
23
19
|
/**
|
|
24
|
-
* @category cdk-utils.s3-manager
|
|
25
|
-
* @subcategory Properties
|
|
26
20
|
*/
|
|
27
21
|
export interface S3BucketProps extends s3.BucketProps {
|
|
22
|
+
bucketName: string
|
|
28
23
|
enableEventBridge?: boolean
|
|
24
|
+
existingBucket?: boolean
|
|
29
25
|
lifecycleRules?: LifecycleRule[]
|
|
30
|
-
bucketName: string
|
|
31
26
|
logBucketName?: string
|
|
32
|
-
existingBucket?: boolean
|
|
33
27
|
tags?: TagProps[]
|
|
34
28
|
}
|
|
@@ -30,17 +30,14 @@ import {
|
|
|
30
30
|
|
|
31
31
|
const DEFAULT_RETRY_CONFIG = [
|
|
32
32
|
{
|
|
33
|
+
backoffRate: 2,
|
|
33
34
|
errors: ['States.ALL'],
|
|
34
35
|
intervalInSecs: 30,
|
|
35
36
|
maxAttempts: 6,
|
|
36
|
-
backoffRate: 2,
|
|
37
37
|
},
|
|
38
38
|
]
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
* @stability stable
|
|
42
|
-
* @category cdk-utils.step-functions-manager
|
|
43
|
-
* @subcategory Construct
|
|
44
41
|
* @classdesc Provides operations on AWS Step Functions Service.
|
|
45
42
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
46
43
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -54,15 +51,14 @@ const DEFAULT_RETRY_CONFIG = [
|
|
|
54
51
|
* this.sfnManager.createSuccessStep('MyStep', this, myStepProps)
|
|
55
52
|
* }
|
|
56
53
|
* }
|
|
57
|
-
*
|
|
58
54
|
* @see [CDK Step Functions Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions-readme.html}
|
|
59
55
|
*/
|
|
60
56
|
export class SfnManager {
|
|
61
57
|
/**
|
|
62
58
|
* @summary Method to create a success step
|
|
63
|
-
* @param
|
|
64
|
-
* @param
|
|
65
|
-
* @param
|
|
59
|
+
* @param id scoped id of the resource
|
|
60
|
+
* @param scope scope in which this resource is defined
|
|
61
|
+
* @param props
|
|
66
62
|
*/
|
|
67
63
|
public createSuccessStep(id: string, scope: CommonConstruct, props: SfnSucceedProps) {
|
|
68
64
|
if (!props) throw `Step props undefined for ${id}`
|
|
@@ -76,9 +72,9 @@ export class SfnManager {
|
|
|
76
72
|
|
|
77
73
|
/**
|
|
78
74
|
* @summary Method to create a failure step
|
|
79
|
-
* @param
|
|
80
|
-
* @param
|
|
81
|
-
* @param
|
|
75
|
+
* @param id scoped id of the resource
|
|
76
|
+
* @param scope scope in which this resource is defined
|
|
77
|
+
* @param props
|
|
82
78
|
*/
|
|
83
79
|
public createFailStep(id: string, scope: CommonConstruct, props: SfnFailProps) {
|
|
84
80
|
if (!props) throw `Step props undefined for ${id}`
|
|
@@ -92,9 +88,9 @@ export class SfnManager {
|
|
|
92
88
|
|
|
93
89
|
/**
|
|
94
90
|
* @summary Method to create a pass step
|
|
95
|
-
* @param
|
|
96
|
-
* @param
|
|
97
|
-
* @param
|
|
91
|
+
* @param id scoped id of the resource
|
|
92
|
+
* @param scope scope in which this resource is defined
|
|
93
|
+
* @param props
|
|
98
94
|
*/
|
|
99
95
|
public createPassStep(id: string, scope: CommonConstruct, props: SfnPassProps) {
|
|
100
96
|
if (!props) throw `Step props undefined for ${id}`
|
|
@@ -108,9 +104,9 @@ export class SfnManager {
|
|
|
108
104
|
|
|
109
105
|
/**
|
|
110
106
|
* @summary Method to create a parallel step
|
|
111
|
-
* @param
|
|
112
|
-
* @param
|
|
113
|
-
* @param
|
|
107
|
+
* @param id scoped id of the resource
|
|
108
|
+
* @param scope scope in which this resource is defined
|
|
109
|
+
* @param props
|
|
114
110
|
*/
|
|
115
111
|
public createParallelStep(id: string, scope: CommonConstruct, props: SfnParallelProps) {
|
|
116
112
|
if (!props) throw `Step props undefined for ${id}`
|
|
@@ -138,9 +134,9 @@ export class SfnManager {
|
|
|
138
134
|
|
|
139
135
|
/**
|
|
140
136
|
* @summary Method to create a choice step
|
|
141
|
-
* @param
|
|
142
|
-
* @param
|
|
143
|
-
* @param
|
|
137
|
+
* @param id scoped id of the resource
|
|
138
|
+
* @param scope scope in which this resource is defined
|
|
139
|
+
* @param props
|
|
144
140
|
*/
|
|
145
141
|
public createChoiceStep(id: string, scope: CommonConstruct, props: SfnChoiceProps) {
|
|
146
142
|
if (!props) throw `Step props undefined for ${id}`
|
|
@@ -154,9 +150,9 @@ export class SfnManager {
|
|
|
154
150
|
|
|
155
151
|
/**
|
|
156
152
|
* @summary Method to create a wait step
|
|
157
|
-
* @param
|
|
158
|
-
* @param
|
|
159
|
-
* @param
|
|
153
|
+
* @param id scoped id of the resource
|
|
154
|
+
* @param scope scope in which this resource is defined
|
|
155
|
+
* @param props
|
|
160
156
|
*/
|
|
161
157
|
public createWaitStep(id: string, scope: CommonConstruct, props: SfnWaitProps) {
|
|
162
158
|
return new sfn.Wait(scope, `${props.name}`, {
|
|
@@ -170,10 +166,10 @@ export class SfnManager {
|
|
|
170
166
|
|
|
171
167
|
/**
|
|
172
168
|
* @summary Method to create a DynamoDB get item step
|
|
173
|
-
* @param
|
|
174
|
-
* @param
|
|
175
|
-
* @param
|
|
176
|
-
* @param
|
|
169
|
+
* @param id scoped id of the resource
|
|
170
|
+
* @param scope scope in which this resource is defined
|
|
171
|
+
* @param props
|
|
172
|
+
* @param table The table to get the item from
|
|
177
173
|
* @param tableKey The table key for query/scan
|
|
178
174
|
*/
|
|
179
175
|
public createDynamoDbGetItemStep(
|
|
@@ -187,20 +183,20 @@ export class SfnManager {
|
|
|
187
183
|
const step = new tasks.DynamoGetItem(scope, `${props.name}`, {
|
|
188
184
|
...props,
|
|
189
185
|
...{
|
|
190
|
-
|
|
191
|
-
key: tableKey,
|
|
186
|
+
comment: `DynamoDB GetItem step for ${props.name} - ${scope.props.stage} stage`,
|
|
192
187
|
consistentRead: props.consistentRead,
|
|
188
|
+
expressionAttributeNames: props.expressionAttributeNames,
|
|
189
|
+
heartbeatTimeout: props.heartbeatTimeout,
|
|
193
190
|
inputPath: props.inputPath,
|
|
191
|
+
integrationPattern: props.integrationPattern,
|
|
192
|
+
key: tableKey,
|
|
194
193
|
outputPath: props.outputPath,
|
|
194
|
+
projectionExpression: props.projectionExpression,
|
|
195
195
|
resultPath: props.resultPath,
|
|
196
196
|
resultSelector: props.resultSelector,
|
|
197
|
-
taskTimeout: props.taskTimeout,
|
|
198
|
-
heartbeatTimeout: props.heartbeatTimeout,
|
|
199
|
-
integrationPattern: props.integrationPattern,
|
|
200
|
-
expressionAttributeNames: props.expressionAttributeNames,
|
|
201
|
-
projectionExpression: props.projectionExpression,
|
|
202
197
|
returnConsumedCapacity: props.returnConsumedCapacity,
|
|
203
|
-
|
|
198
|
+
table: table,
|
|
199
|
+
taskTimeout: props.taskTimeout,
|
|
204
200
|
},
|
|
205
201
|
})
|
|
206
202
|
|
|
@@ -221,10 +217,10 @@ export class SfnManager {
|
|
|
221
217
|
|
|
222
218
|
/**
|
|
223
219
|
* @summary Method to create a DynamoDB put item step
|
|
224
|
-
* @param
|
|
225
|
-
* @param
|
|
226
|
-
* @param
|
|
227
|
-
* @param
|
|
220
|
+
* @param id scoped id of the resource
|
|
221
|
+
* @param scope scope in which this resource is defined
|
|
222
|
+
* @param props
|
|
223
|
+
* @param table The table to put the item in
|
|
228
224
|
* @param tableItem The item to add to the table
|
|
229
225
|
*/
|
|
230
226
|
public createDynamoDbPutItemStep(
|
|
@@ -238,22 +234,22 @@ export class SfnManager {
|
|
|
238
234
|
const step = new tasks.DynamoPutItem(scope, `${props.name}`, {
|
|
239
235
|
...props,
|
|
240
236
|
...{
|
|
241
|
-
|
|
242
|
-
|
|
237
|
+
comment: `DynamoDB PutItem step for ${props.name} - ${scope.props.stage} stage`,
|
|
238
|
+
conditionExpression: props.conditionExpression,
|
|
239
|
+
expressionAttributeNames: props.expressionAttributeNames,
|
|
240
|
+
expressionAttributeValues: props.expressionAttributeValues,
|
|
241
|
+
heartbeatTimeout: props.heartbeatTimeout,
|
|
243
242
|
inputPath: props.inputPath,
|
|
243
|
+
integrationPattern: props.integrationPattern,
|
|
244
|
+
item: tableItem,
|
|
244
245
|
outputPath: props.outputPath,
|
|
245
246
|
resultPath: props.resultPath,
|
|
246
247
|
resultSelector: props.resultSelector,
|
|
247
|
-
taskTimeout: props.taskTimeout,
|
|
248
|
-
heartbeatTimeout: props.heartbeatTimeout,
|
|
249
|
-
integrationPattern: props.integrationPattern,
|
|
250
|
-
conditionExpression: props.conditionExpression,
|
|
251
|
-
expressionAttributeNames: props.expressionAttributeNames,
|
|
252
|
-
expressionAttributeValues: props.expressionAttributeValues,
|
|
253
248
|
returnConsumedCapacity: props.returnConsumedCapacity,
|
|
254
249
|
returnItemCollectionMetrics: props.returnItemCollectionMetrics,
|
|
255
250
|
returnValues: props.returnValues,
|
|
256
|
-
|
|
251
|
+
table: table,
|
|
252
|
+
taskTimeout: props.taskTimeout,
|
|
257
253
|
},
|
|
258
254
|
})
|
|
259
255
|
|
|
@@ -274,10 +270,10 @@ export class SfnManager {
|
|
|
274
270
|
|
|
275
271
|
/**
|
|
276
272
|
* @summary Method to create a DynamoDB delete item step
|
|
277
|
-
* @param
|
|
278
|
-
* @param
|
|
279
|
-
* @param
|
|
280
|
-
* @param
|
|
273
|
+
* @param id scoped id of the resource
|
|
274
|
+
* @param scope scope in which this resource is defined
|
|
275
|
+
* @param props
|
|
276
|
+
* @param table The table to put the item in
|
|
281
277
|
* @param tableKey The table key for query/scan
|
|
282
278
|
*/
|
|
283
279
|
public createDynamoDbDeleteItemStep(
|
|
@@ -291,22 +287,22 @@ export class SfnManager {
|
|
|
291
287
|
const step = new tasks.DynamoDeleteItem(scope, `${props.name}`, {
|
|
292
288
|
...props,
|
|
293
289
|
...{
|
|
294
|
-
|
|
295
|
-
key: tableKey,
|
|
290
|
+
comment: `DynamoDB DeleteItem step for ${props.name} - ${scope.props.stage} stage`,
|
|
296
291
|
conditionExpression: props.conditionExpression,
|
|
297
292
|
expressionAttributeNames: props.expressionAttributeNames,
|
|
298
293
|
expressionAttributeValues: props.expressionAttributeValues,
|
|
299
|
-
taskTimeout: props.taskTimeout,
|
|
300
294
|
heartbeatTimeout: props.heartbeatTimeout,
|
|
301
295
|
inputPath: props.inputPath,
|
|
296
|
+
integrationPattern: props.integrationPattern,
|
|
297
|
+
key: tableKey,
|
|
302
298
|
outputPath: props.outputPath,
|
|
303
299
|
resultPath: props.resultPath,
|
|
304
300
|
resultSelector: props.resultSelector,
|
|
305
|
-
integrationPattern: props.integrationPattern,
|
|
306
301
|
returnConsumedCapacity: props.returnConsumedCapacity,
|
|
307
302
|
returnItemCollectionMetrics: props.returnItemCollectionMetrics,
|
|
308
303
|
returnValues: props.returnValues,
|
|
309
|
-
|
|
304
|
+
table: table,
|
|
305
|
+
taskTimeout: props.taskTimeout,
|
|
310
306
|
},
|
|
311
307
|
})
|
|
312
308
|
|
|
@@ -327,10 +323,10 @@ export class SfnManager {
|
|
|
327
323
|
|
|
328
324
|
/**
|
|
329
325
|
* @summary Method to send a message to SQS step
|
|
330
|
-
* @param
|
|
331
|
-
* @param
|
|
332
|
-
* @param
|
|
333
|
-
* @param
|
|
326
|
+
* @param id scoped id of the resource
|
|
327
|
+
* @param scope scope in which this resource is defined
|
|
328
|
+
* @param props
|
|
329
|
+
* @param queue The queue to send the message to
|
|
334
330
|
*/
|
|
335
331
|
public createSendSqsMessageStep(
|
|
336
332
|
id: string,
|
|
@@ -343,19 +339,19 @@ export class SfnManager {
|
|
|
343
339
|
const step = new tasks.SqsSendMessage(scope, `${props.name}`, {
|
|
344
340
|
...props,
|
|
345
341
|
...{
|
|
346
|
-
|
|
347
|
-
messageBody: props.messageBody,
|
|
348
|
-
messageGroupId: props.messageGroupId,
|
|
349
|
-
messageDeduplicationId: props.messageDeduplicationId,
|
|
342
|
+
comment: `DynamoDB PutItem step for ${props.name} - ${scope.props.stage} stage`,
|
|
350
343
|
delay: props.delay,
|
|
344
|
+
heartbeatTimeout: props.heartbeatTimeout,
|
|
351
345
|
inputPath: props.inputPath,
|
|
346
|
+
integrationPattern: props.integrationPattern,
|
|
347
|
+
messageBody: props.messageBody,
|
|
348
|
+
messageDeduplicationId: props.messageDeduplicationId,
|
|
349
|
+
messageGroupId: props.messageGroupId,
|
|
352
350
|
outputPath: props.outputPath,
|
|
351
|
+
queue: queue,
|
|
353
352
|
resultPath: props.resultPath,
|
|
354
353
|
resultSelector: props.resultSelector,
|
|
355
354
|
taskTimeout: props.taskTimeout,
|
|
356
|
-
heartbeatTimeout: props.heartbeatTimeout,
|
|
357
|
-
integrationPattern: props.integrationPattern,
|
|
358
|
-
comment: `DynamoDB PutItem step for ${props.name} - ${scope.props.stage} stage`,
|
|
359
355
|
},
|
|
360
356
|
})
|
|
361
357
|
|
|
@@ -376,10 +372,10 @@ export class SfnManager {
|
|
|
376
372
|
|
|
377
373
|
/**
|
|
378
374
|
* @summary Method to create a lambda invoke step
|
|
379
|
-
* @param
|
|
380
|
-
* @param
|
|
381
|
-
* @param
|
|
382
|
-
* @param
|
|
375
|
+
* @param id scoped id of the resource
|
|
376
|
+
* @param scope scope in which this resource is defined
|
|
377
|
+
* @param props
|
|
378
|
+
* @param lambdaFunction
|
|
383
379
|
*/
|
|
384
380
|
public createLambdaStep(
|
|
385
381
|
id: string,
|
|
@@ -391,8 +387,8 @@ export class SfnManager {
|
|
|
391
387
|
const step = new tasks.LambdaInvoke(scope, `${props.name}`, {
|
|
392
388
|
...props,
|
|
393
389
|
...{
|
|
394
|
-
lambdaFunction,
|
|
395
390
|
comment: `Lambda step for ${props.name} - ${scope.props.stage} stage`,
|
|
391
|
+
lambdaFunction,
|
|
396
392
|
},
|
|
397
393
|
})
|
|
398
394
|
|
|
@@ -413,10 +409,10 @@ export class SfnManager {
|
|
|
413
409
|
|
|
414
410
|
/**
|
|
415
411
|
* @summary Method to create a API Gateway invoke step
|
|
416
|
-
* @param
|
|
417
|
-
* @param
|
|
418
|
-
* @param
|
|
419
|
-
* @param
|
|
412
|
+
* @param id scoped id of the resource
|
|
413
|
+
* @param scope scope in which this resource is defined
|
|
414
|
+
* @param props
|
|
415
|
+
* @param api
|
|
420
416
|
*/
|
|
421
417
|
public createApiStep(
|
|
422
418
|
id: string,
|
|
@@ -429,8 +425,8 @@ export class SfnManager {
|
|
|
429
425
|
...props,
|
|
430
426
|
...{
|
|
431
427
|
api,
|
|
432
|
-
stageName: scope.props.stage,
|
|
433
428
|
comment: `API step for ${props.name} - ${scope.props.stage} stage`,
|
|
429
|
+
stageName: scope.props.stage,
|
|
434
430
|
},
|
|
435
431
|
})
|
|
436
432
|
|
|
@@ -451,10 +447,10 @@ export class SfnManager {
|
|
|
451
447
|
|
|
452
448
|
/**
|
|
453
449
|
* @summary Method to create a step function execution step
|
|
454
|
-
* @param
|
|
455
|
-
* @param
|
|
456
|
-
* @param
|
|
457
|
-
* @param
|
|
450
|
+
* @param id scoped id of the resource
|
|
451
|
+
* @param scope scope in which this resource is defined
|
|
452
|
+
* @param props props for the step
|
|
453
|
+
* @param stateMachine the state machine to execute
|
|
458
454
|
*/
|
|
459
455
|
public createSfnExecutionStep(
|
|
460
456
|
id: string,
|
|
@@ -487,9 +483,9 @@ export class SfnManager {
|
|
|
487
483
|
|
|
488
484
|
/**
|
|
489
485
|
* @summary Method to create a step function map state
|
|
490
|
-
* @param
|
|
491
|
-
* @param
|
|
492
|
-
* @param
|
|
486
|
+
* @param id scoped id of the resource
|
|
487
|
+
* @param scope scope in which this resource is defined
|
|
488
|
+
* @param props props for the map state
|
|
493
489
|
*/
|
|
494
490
|
public createMapState(id: string, scope: CommonConstruct, props: SfnMapProps) {
|
|
495
491
|
return new sfn.Map(scope, `${id}`, props)
|
|
@@ -497,12 +493,12 @@ export class SfnManager {
|
|
|
497
493
|
|
|
498
494
|
/**
|
|
499
495
|
* @summary Method to create a state machine
|
|
500
|
-
* @param
|
|
501
|
-
* @param
|
|
502
|
-
* @param
|
|
503
|
-
* @param
|
|
504
|
-
* @param
|
|
505
|
-
* @param
|
|
496
|
+
* @param id scoped id of the resource
|
|
497
|
+
* @param scope scope in which this resource is defined
|
|
498
|
+
* @param props
|
|
499
|
+
* @param definition
|
|
500
|
+
* @param logGroup
|
|
501
|
+
* @param role
|
|
506
502
|
*/
|
|
507
503
|
public createStateMachine(
|
|
508
504
|
id: string,
|
|
@@ -514,17 +510,17 @@ export class SfnManager {
|
|
|
514
510
|
) {
|
|
515
511
|
if (!props) throw `State Machine props undefined for ${id}`
|
|
516
512
|
const stateMachine = new sfn.StateMachine(scope, `${id}`, {
|
|
517
|
-
stateMachineName: `${props.stateMachineName}-${scope.props.stage}`,
|
|
518
513
|
definition,
|
|
519
|
-
role,
|
|
520
|
-
stateMachineType: props.stateMachineType,
|
|
521
514
|
logs: {
|
|
522
515
|
destination: logGroup,
|
|
523
516
|
includeExecutionData: props.logs?.includeExecutionData ?? true,
|
|
524
517
|
level: props.logs?.level ?? sfn.LogLevel.ALL,
|
|
525
518
|
},
|
|
526
|
-
|
|
519
|
+
role,
|
|
520
|
+
stateMachineName: `${props.stateMachineName}-${scope.props.stage}`,
|
|
521
|
+
stateMachineType: props.stateMachineType,
|
|
527
522
|
timeout: props.timeout,
|
|
523
|
+
tracingEnabled: props.tracingEnabled,
|
|
528
524
|
})
|
|
529
525
|
|
|
530
526
|
utils.createCfnOutput(`${id}-stateMachineName`, scope, stateMachine.stateMachineName)
|