@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
|
@@ -30,9 +30,6 @@ const s3 = __importStar(require("aws-cdk-lib/aws-s3"));
|
|
|
30
30
|
const s3deploy = __importStar(require("aws-cdk-lib/aws-s3-deployment"));
|
|
31
31
|
const utils = __importStar(require("../../../utils"));
|
|
32
32
|
/**
|
|
33
|
-
* @stability stable
|
|
34
|
-
* @category cdk-utils.s3-manager
|
|
35
|
-
* @subcategory Construct
|
|
36
33
|
* @classdesc Provides operations on AWS S3.
|
|
37
34
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
38
35
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -46,14 +43,12 @@ const utils = __importStar(require("../../../utils"));
|
|
|
46
43
|
* this.s3Manager.createS3Bucket('MyBucket', this)
|
|
47
44
|
* }
|
|
48
45
|
* }
|
|
49
|
-
*
|
|
50
46
|
* @see [CDK S3 Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3-readme.html}
|
|
51
47
|
*/
|
|
52
48
|
class S3Manager {
|
|
53
49
|
/**
|
|
54
50
|
* @summary Method to determine S3 Bucket lifecycle properties
|
|
55
|
-
* @param
|
|
56
|
-
* @private
|
|
51
|
+
* @param props bucket properties
|
|
57
52
|
*/
|
|
58
53
|
determineBucketLifecycleRules(props) {
|
|
59
54
|
if (!props.lifecycleRules)
|
|
@@ -61,37 +56,35 @@ class S3Manager {
|
|
|
61
56
|
const bucketLifecycleRules = [];
|
|
62
57
|
props.lifecycleRules.forEach(lifecycleRule => {
|
|
63
58
|
bucketLifecycleRules.push({
|
|
64
|
-
id: lifecycleRule.id,
|
|
65
|
-
enabled: lifecycleRule.enabled,
|
|
66
59
|
abortIncompleteMultipartUploadAfter: lifecycleRule.abortIncompleteMultipartUploadAfter,
|
|
67
|
-
|
|
60
|
+
enabled: lifecycleRule.enabled,
|
|
68
61
|
expiration: lifecycleRule.expirationInDays ? cdk.Duration.days(lifecycleRule.expirationInDays) : undefined,
|
|
62
|
+
expirationDate: lifecycleRule.expirationDate,
|
|
63
|
+
expiredObjectDeleteMarker: lifecycleRule.expiredObjectDeleteMarker,
|
|
64
|
+
id: lifecycleRule.id,
|
|
69
65
|
noncurrentVersionExpiration: lifecycleRule.noncurrentVersionExpirationInDays
|
|
70
66
|
? cdk.Duration.days(lifecycleRule.noncurrentVersionExpirationInDays)
|
|
71
67
|
: undefined,
|
|
72
68
|
noncurrentVersionTransitions: lifecycleRule.noncurrentVersionTransitions,
|
|
73
|
-
transitions: lifecycleRule.transitions,
|
|
74
69
|
prefix: lifecycleRule.prefix,
|
|
75
70
|
tagFilters: lifecycleRule.tagFilters,
|
|
76
|
-
|
|
71
|
+
transitions: lifecycleRule.transitions,
|
|
77
72
|
});
|
|
78
73
|
});
|
|
79
74
|
return bucketLifecycleRules;
|
|
80
75
|
}
|
|
81
76
|
/**
|
|
82
77
|
* @summary Method to determine the bucket name using account and region
|
|
83
|
-
* @param
|
|
84
|
-
* @param
|
|
85
|
-
* @protected
|
|
78
|
+
* @param scope scope in which this resource is defined
|
|
79
|
+
* @param bucketName the bucket name
|
|
86
80
|
*/
|
|
87
81
|
static determineBucketNameByAccountAndRegion(scope, bucketName) {
|
|
88
82
|
return `${bucketName}-${cdk.Stack.of(scope).account}-${scope.props.region}-${scope.props.stage}`;
|
|
89
83
|
}
|
|
90
84
|
/**
|
|
91
85
|
* @summary Method to determine the bucket name using domain name
|
|
92
|
-
* @param
|
|
93
|
-
* @param
|
|
94
|
-
* @protected
|
|
86
|
+
* @param scope scope in which this resource is defined
|
|
87
|
+
* @param bucketName the bucket name
|
|
95
88
|
*/
|
|
96
89
|
static determineBucketNameByDomainName(scope, bucketName) {
|
|
97
90
|
return scope.isProductionStage()
|
|
@@ -100,9 +93,8 @@ class S3Manager {
|
|
|
100
93
|
}
|
|
101
94
|
/**
|
|
102
95
|
* @summary Method to determine the bucket name
|
|
103
|
-
* @param
|
|
104
|
-
* @param
|
|
105
|
-
* @private
|
|
96
|
+
* @param scope scope in which this resource is defined
|
|
97
|
+
* @param bucketName the bucket name
|
|
106
98
|
*/
|
|
107
99
|
static determineBucketName(scope, bucketName) {
|
|
108
100
|
return scope.props.excludeDomainNameForBuckets
|
|
@@ -111,9 +103,9 @@ class S3Manager {
|
|
|
111
103
|
}
|
|
112
104
|
/**
|
|
113
105
|
* @summary Method to create a s3 bucket
|
|
114
|
-
* @param
|
|
115
|
-
* @param
|
|
116
|
-
* @param
|
|
106
|
+
* @param id scoped id of the resource
|
|
107
|
+
* @param scope scope in which this resource is defined
|
|
108
|
+
* @param props bucket properties
|
|
117
109
|
*/
|
|
118
110
|
createS3Bucket(id, scope, props) {
|
|
119
111
|
if (!props)
|
|
@@ -144,10 +136,10 @@ class S3Manager {
|
|
|
144
136
|
removalPolicy: props.removalPolicy || cdk.RemovalPolicy.RETAIN,
|
|
145
137
|
serverAccessLogsBucket: logBucket,
|
|
146
138
|
serverAccessLogsPrefix: props.serverAccessLogsPrefix,
|
|
147
|
-
|
|
139
|
+
versioned: props.versioned,
|
|
148
140
|
websiteErrorDocument: props.websiteErrorDocument,
|
|
141
|
+
websiteIndexDocument: props.websiteIndexDocument,
|
|
149
142
|
websiteRoutingRules: props.websiteRoutingRules,
|
|
150
|
-
versioned: props.versioned,
|
|
151
143
|
});
|
|
152
144
|
const cfnBucket = bucket.node.defaultChild;
|
|
153
145
|
cfnBucket.notificationConfiguration = {
|
|
@@ -167,9 +159,9 @@ class S3Manager {
|
|
|
167
159
|
}
|
|
168
160
|
/**
|
|
169
161
|
* @summary Method to create an iam bucket policy for cloudtrail
|
|
170
|
-
* @param
|
|
171
|
-
* @param
|
|
172
|
-
* @param
|
|
162
|
+
* @param id scoped id of the resource
|
|
163
|
+
* @param scope scope in which this resource is defined
|
|
164
|
+
* @param bucket
|
|
173
165
|
*/
|
|
174
166
|
createBucketPolicyForCloudTrail(id, scope, bucket) {
|
|
175
167
|
const bucketPolicyDocument = new iam.PolicyDocument({
|
|
@@ -197,13 +189,13 @@ class S3Manager {
|
|
|
197
189
|
}
|
|
198
190
|
/**
|
|
199
191
|
* @summary Method to create a s3 bucket deployment
|
|
200
|
-
* @param
|
|
201
|
-
* @param
|
|
202
|
-
* @param
|
|
203
|
-
* @param
|
|
204
|
-
* @param
|
|
205
|
-
* @param
|
|
206
|
-
* @param
|
|
192
|
+
* @param id scoped id of the resource
|
|
193
|
+
* @param scope scope in which this resource is defined
|
|
194
|
+
* @param siteBucket
|
|
195
|
+
* @param distribution
|
|
196
|
+
* @param sources
|
|
197
|
+
* @param prefix
|
|
198
|
+
* @param prune
|
|
207
199
|
*/
|
|
208
200
|
doBucketDeployment(id, scope, siteBucket, distribution, sources, prefix, prune) {
|
|
209
201
|
new s3deploy.BucketDeployment(scope, `${id}`, {
|
|
@@ -219,10 +211,10 @@ class S3Manager {
|
|
|
219
211
|
}
|
|
220
212
|
/**
|
|
221
213
|
*
|
|
222
|
-
* @param
|
|
223
|
-
* @param
|
|
224
|
-
* @param
|
|
225
|
-
* @param
|
|
214
|
+
* @param id scoped id of the resource
|
|
215
|
+
* @param scope scope in which this resource is defined
|
|
216
|
+
* @param bucket bucket to create the folders in
|
|
217
|
+
* @param folders list of folder names to be created in the bucket
|
|
226
218
|
*/
|
|
227
219
|
createBucketFolders(id, scope, bucket, folders) {
|
|
228
220
|
if (!folders || folders.length == 0) {
|
|
@@ -232,8 +224,8 @@ class S3Manager {
|
|
|
232
224
|
new s3deploy.BucketDeployment(scope, `${id}-${folder}`, {
|
|
233
225
|
destinationBucket: bucket,
|
|
234
226
|
destinationKeyPrefix: folder,
|
|
235
|
-
sources: [s3deploy.Source.data('README.md', `This is the ${folder} folder for ${id}`)],
|
|
236
227
|
prune: false,
|
|
228
|
+
sources: [s3deploy.Source.data('README.md', `This is the ${folder} folder for ${id}`)],
|
|
237
229
|
});
|
|
238
230
|
});
|
|
239
231
|
}
|
|
@@ -2,30 +2,24 @@ import { TagProps } from '../../../types';
|
|
|
2
2
|
import * as s3 from 'aws-cdk-lib/aws-s3';
|
|
3
3
|
import * as s3deploy from 'aws-cdk-lib/aws-s3-deployment';
|
|
4
4
|
/**
|
|
5
|
-
* @category cdk-utils.s3-manager
|
|
6
|
-
* @subcategory Properties
|
|
7
5
|
*/
|
|
8
6
|
export interface LifecycleRule extends s3.LifecycleRule {
|
|
9
7
|
expirationInDays?: number;
|
|
10
8
|
noncurrentVersionExpirationInDays?: number;
|
|
11
9
|
}
|
|
12
10
|
/**
|
|
13
|
-
* @category cdk-utils.s3-manager
|
|
14
|
-
* @subcategory Properties
|
|
15
11
|
*/
|
|
16
12
|
export interface BucketDeploymentProps extends s3deploy.BucketDeploymentProps {
|
|
17
13
|
expirationInDays?: number;
|
|
18
14
|
noncurrentVersionExpirationInDays?: number;
|
|
19
15
|
}
|
|
20
16
|
/**
|
|
21
|
-
* @category cdk-utils.s3-manager
|
|
22
|
-
* @subcategory Properties
|
|
23
17
|
*/
|
|
24
18
|
export interface S3BucketProps extends s3.BucketProps {
|
|
19
|
+
bucketName: string;
|
|
25
20
|
enableEventBridge?: boolean;
|
|
21
|
+
existingBucket?: boolean;
|
|
26
22
|
lifecycleRules?: LifecycleRule[];
|
|
27
|
-
bucketName: string;
|
|
28
23
|
logBucketName?: string;
|
|
29
|
-
existingBucket?: boolean;
|
|
30
24
|
tags?: TagProps[];
|
|
31
25
|
}
|
|
@@ -10,9 +10,6 @@ import * as tasks from 'aws-cdk-lib/aws-stepfunctions-tasks';
|
|
|
10
10
|
import { CommonConstruct } from '../../../common';
|
|
11
11
|
import { SfnCallApiGatewayRestApiEndpointProps, SfnChoiceProps, SfnDynamoDeleteItemProps, SfnDynamoGetItemProps, SfnDynamoPutItemProps, SfnFailProps, SfnLambdaInvokeProps, SfnMapProps, SfnParallelProps, SfnPassProps, SfnSqsSendMessageProps, SfnStartExecutionProps, SfnStateMachineProps, SfnSucceedProps, SfnWaitProps } from './types';
|
|
12
12
|
/**
|
|
13
|
-
* @stability stable
|
|
14
|
-
* @category cdk-utils.step-functions-manager
|
|
15
|
-
* @subcategory Construct
|
|
16
13
|
* @classdesc Provides operations on AWS Step Functions Service.
|
|
17
14
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
18
15
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
@@ -26,58 +23,57 @@ import { SfnCallApiGatewayRestApiEndpointProps, SfnChoiceProps, SfnDynamoDeleteI
|
|
|
26
23
|
* this.sfnManager.createSuccessStep('MyStep', this, myStepProps)
|
|
27
24
|
* }
|
|
28
25
|
* }
|
|
29
|
-
*
|
|
30
26
|
* @see [CDK Step Functions Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions-readme.html}
|
|
31
27
|
*/
|
|
32
28
|
export declare class SfnManager {
|
|
33
29
|
/**
|
|
34
30
|
* @summary Method to create a success step
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
31
|
+
* @param id scoped id of the resource
|
|
32
|
+
* @param scope scope in which this resource is defined
|
|
33
|
+
* @param props
|
|
38
34
|
*/
|
|
39
35
|
createSuccessStep(id: string, scope: CommonConstruct, props: SfnSucceedProps): cdk.aws_stepfunctions.Succeed;
|
|
40
36
|
/**
|
|
41
37
|
* @summary Method to create a failure step
|
|
42
|
-
* @param
|
|
43
|
-
* @param
|
|
44
|
-
* @param
|
|
38
|
+
* @param id scoped id of the resource
|
|
39
|
+
* @param scope scope in which this resource is defined
|
|
40
|
+
* @param props
|
|
45
41
|
*/
|
|
46
42
|
createFailStep(id: string, scope: CommonConstruct, props: SfnFailProps): cdk.aws_stepfunctions.Fail;
|
|
47
43
|
/**
|
|
48
44
|
* @summary Method to create a pass step
|
|
49
|
-
* @param
|
|
50
|
-
* @param
|
|
51
|
-
* @param
|
|
45
|
+
* @param id scoped id of the resource
|
|
46
|
+
* @param scope scope in which this resource is defined
|
|
47
|
+
* @param props
|
|
52
48
|
*/
|
|
53
49
|
createPassStep(id: string, scope: CommonConstruct, props: SfnPassProps): cdk.aws_stepfunctions.Pass;
|
|
54
50
|
/**
|
|
55
51
|
* @summary Method to create a parallel step
|
|
56
|
-
* @param
|
|
57
|
-
* @param
|
|
58
|
-
* @param
|
|
52
|
+
* @param id scoped id of the resource
|
|
53
|
+
* @param scope scope in which this resource is defined
|
|
54
|
+
* @param props
|
|
59
55
|
*/
|
|
60
56
|
createParallelStep(id: string, scope: CommonConstruct, props: SfnParallelProps): cdk.aws_stepfunctions.Parallel;
|
|
61
57
|
/**
|
|
62
58
|
* @summary Method to create a choice 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
|
createChoiceStep(id: string, scope: CommonConstruct, props: SfnChoiceProps): cdk.aws_stepfunctions.Choice;
|
|
68
64
|
/**
|
|
69
65
|
* @summary Method to create a wait step
|
|
70
|
-
* @param
|
|
71
|
-
* @param
|
|
72
|
-
* @param
|
|
66
|
+
* @param id scoped id of the resource
|
|
67
|
+
* @param scope scope in which this resource is defined
|
|
68
|
+
* @param props
|
|
73
69
|
*/
|
|
74
70
|
createWaitStep(id: string, scope: CommonConstruct, props: SfnWaitProps): cdk.aws_stepfunctions.Wait;
|
|
75
71
|
/**
|
|
76
72
|
* @summary Method to create a DynamoDB get item step
|
|
77
|
-
* @param
|
|
78
|
-
* @param
|
|
79
|
-
* @param
|
|
80
|
-
* @param
|
|
73
|
+
* @param id scoped id of the resource
|
|
74
|
+
* @param scope scope in which this resource is defined
|
|
75
|
+
* @param props
|
|
76
|
+
* @param table The table to get the item from
|
|
81
77
|
* @param tableKey The table key for query/scan
|
|
82
78
|
*/
|
|
83
79
|
createDynamoDbGetItemStep(id: string, scope: CommonConstruct, props: SfnDynamoGetItemProps, table: dynamodb.ITable, tableKey: {
|
|
@@ -85,10 +81,10 @@ export declare class SfnManager {
|
|
|
85
81
|
}): cdk.aws_stepfunctions_tasks.DynamoGetItem;
|
|
86
82
|
/**
|
|
87
83
|
* @summary Method to create a DynamoDB put item step
|
|
88
|
-
* @param
|
|
89
|
-
* @param
|
|
90
|
-
* @param
|
|
91
|
-
* @param
|
|
84
|
+
* @param id scoped id of the resource
|
|
85
|
+
* @param scope scope in which this resource is defined
|
|
86
|
+
* @param props
|
|
87
|
+
* @param table The table to put the item in
|
|
92
88
|
* @param tableItem The item to add to the table
|
|
93
89
|
*/
|
|
94
90
|
createDynamoDbPutItemStep(id: string, scope: CommonConstruct, props: SfnDynamoPutItemProps, table: dynamodb.ITable, tableItem: {
|
|
@@ -96,10 +92,10 @@ export declare class SfnManager {
|
|
|
96
92
|
}): cdk.aws_stepfunctions_tasks.DynamoPutItem;
|
|
97
93
|
/**
|
|
98
94
|
* @summary Method to create a DynamoDB delete item step
|
|
99
|
-
* @param
|
|
100
|
-
* @param
|
|
101
|
-
* @param
|
|
102
|
-
* @param
|
|
95
|
+
* @param id scoped id of the resource
|
|
96
|
+
* @param scope scope in which this resource is defined
|
|
97
|
+
* @param props
|
|
98
|
+
* @param table The table to put the item in
|
|
103
99
|
* @param tableKey The table key for query/scan
|
|
104
100
|
*/
|
|
105
101
|
createDynamoDbDeleteItemStep(id: string, scope: CommonConstruct, props: SfnDynamoDeleteItemProps, table: dynamodb.ITable, tableKey: {
|
|
@@ -107,51 +103,51 @@ export declare class SfnManager {
|
|
|
107
103
|
}): cdk.aws_stepfunctions_tasks.DynamoDeleteItem;
|
|
108
104
|
/**
|
|
109
105
|
* @summary Method to send a message to SQS step
|
|
110
|
-
* @param
|
|
111
|
-
* @param
|
|
112
|
-
* @param
|
|
113
|
-
* @param
|
|
106
|
+
* @param id scoped id of the resource
|
|
107
|
+
* @param scope scope in which this resource is defined
|
|
108
|
+
* @param props
|
|
109
|
+
* @param queue The queue to send the message to
|
|
114
110
|
*/
|
|
115
111
|
createSendSqsMessageStep(id: string, scope: CommonConstruct, props: SfnSqsSendMessageProps, queue: sqs.IQueue): cdk.aws_stepfunctions_tasks.SqsSendMessage;
|
|
116
112
|
/**
|
|
117
113
|
* @summary Method to create a lambda invoke step
|
|
118
|
-
* @param
|
|
119
|
-
* @param
|
|
120
|
-
* @param
|
|
121
|
-
* @param
|
|
114
|
+
* @param id scoped id of the resource
|
|
115
|
+
* @param scope scope in which this resource is defined
|
|
116
|
+
* @param props
|
|
117
|
+
* @param lambdaFunction
|
|
122
118
|
*/
|
|
123
119
|
createLambdaStep(id: string, scope: CommonConstruct, props: SfnLambdaInvokeProps, lambdaFunction: lambda.IFunction): cdk.aws_stepfunctions_tasks.LambdaInvoke;
|
|
124
120
|
/**
|
|
125
121
|
* @summary Method to create a API Gateway invoke step
|
|
126
|
-
* @param
|
|
127
|
-
* @param
|
|
128
|
-
* @param
|
|
129
|
-
* @param
|
|
122
|
+
* @param id scoped id of the resource
|
|
123
|
+
* @param scope scope in which this resource is defined
|
|
124
|
+
* @param props
|
|
125
|
+
* @param api
|
|
130
126
|
*/
|
|
131
127
|
createApiStep(id: string, scope: CommonConstruct, props: SfnCallApiGatewayRestApiEndpointProps, api: apig.IRestApi): cdk.aws_stepfunctions_tasks.CallApiGatewayRestApiEndpoint;
|
|
132
128
|
/**
|
|
133
129
|
* @summary Method to create a step function execution step
|
|
134
|
-
* @param
|
|
135
|
-
* @param
|
|
136
|
-
* @param
|
|
137
|
-
* @param
|
|
130
|
+
* @param id scoped id of the resource
|
|
131
|
+
* @param scope scope in which this resource is defined
|
|
132
|
+
* @param props props for the step
|
|
133
|
+
* @param stateMachine the state machine to execute
|
|
138
134
|
*/
|
|
139
135
|
createSfnExecutionStep(id: string, scope: CommonConstruct, props: SfnStartExecutionProps, stateMachine: sfn.IStateMachine): cdk.aws_stepfunctions_tasks.StepFunctionsStartExecution;
|
|
140
136
|
/**
|
|
141
137
|
* @summary Method to create a step function map state
|
|
142
|
-
* @param
|
|
143
|
-
* @param
|
|
144
|
-
* @param
|
|
138
|
+
* @param id scoped id of the resource
|
|
139
|
+
* @param scope scope in which this resource is defined
|
|
140
|
+
* @param props props for the map state
|
|
145
141
|
*/
|
|
146
142
|
createMapState(id: string, scope: CommonConstruct, props: SfnMapProps): cdk.aws_stepfunctions.Map;
|
|
147
143
|
/**
|
|
148
144
|
* @summary Method to create a state machine
|
|
149
|
-
* @param
|
|
150
|
-
* @param
|
|
151
|
-
* @param
|
|
152
|
-
* @param
|
|
153
|
-
* @param
|
|
154
|
-
* @param
|
|
145
|
+
* @param id scoped id of the resource
|
|
146
|
+
* @param scope scope in which this resource is defined
|
|
147
|
+
* @param props
|
|
148
|
+
* @param definition
|
|
149
|
+
* @param logGroup
|
|
150
|
+
* @param role
|
|
155
151
|
*/
|
|
156
152
|
createStateMachine(id: string, scope: CommonConstruct, props: SfnStateMachineProps, definition: sfn.IChainable, logGroup: logs.ILogGroup, role?: iam.IRole): cdk.aws_stepfunctions.StateMachine;
|
|
157
153
|
}
|