@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.
Files changed (223) hide show
  1. package/.eslintrc.json +40 -0
  2. package/app/api-destined-function/src/lib/lambda.ts +6 -6
  3. package/dist/app/api-destined-function/src/lib/lambda.d.ts +6 -6
  4. package/dist/app/api-destined-function/src/lib/lambda.js +6 -6
  5. package/dist/lib/lambda.d.ts +6 -6
  6. package/dist/lib/lambda.js +6 -6
  7. package/dist/lib/lambda.js.map +1 -1
  8. package/dist/src/lib/common/construct.d.ts +4 -7
  9. package/dist/src/lib/common/construct.js +4 -7
  10. package/dist/src/lib/common/stack.d.ts +9 -13
  11. package/dist/src/lib/common/stack.js +9 -13
  12. package/dist/src/lib/common/types.d.ts +0 -2
  13. package/dist/src/lib/construct/api-to-eventbridge-target/api.d.ts +0 -3
  14. package/dist/src/lib/construct/api-to-eventbridge-target/api.js +0 -3
  15. package/dist/src/lib/construct/api-to-eventbridge-target/event.d.ts +0 -3
  16. package/dist/src/lib/construct/api-to-eventbridge-target/event.js +0 -3
  17. package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +0 -27
  18. package/dist/src/lib/construct/api-to-eventbridge-target/main.js +41 -68
  19. package/dist/src/lib/construct/api-to-eventbridge-target/types.d.ts +13 -25
  20. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +0 -3
  21. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.js +0 -3
  22. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.d.ts +0 -37
  23. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.js +44 -81
  24. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/types.d.ts +1 -5
  25. package/dist/src/lib/construct/api-to-lambda-target/api.d.ts +0 -3
  26. package/dist/src/lib/construct/api-to-lambda-target/api.js +0 -3
  27. package/dist/src/lib/construct/api-to-lambda-target/main.d.ts +0 -14
  28. package/dist/src/lib/construct/api-to-lambda-target/main.js +7 -21
  29. package/dist/src/lib/construct/api-to-lambda-target/types.d.ts +7 -13
  30. package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +0 -18
  31. package/dist/src/lib/construct/graphql-api-lambda/main.js +1 -19
  32. package/dist/src/lib/construct/graphql-api-lambda/types.d.ts +4 -8
  33. package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.d.ts +0 -11
  34. package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.js +1 -12
  35. package/dist/src/lib/construct/graphql-api-lambda-with-cache/types.d.ts +1 -3
  36. package/dist/src/lib/construct/lambda-with-iam-access/main.d.ts +0 -12
  37. package/dist/src/lib/construct/lambda-with-iam-access/main.js +2 -14
  38. package/dist/src/lib/construct/rest-api-lambda/main.d.ts +0 -18
  39. package/dist/src/lib/construct/rest-api-lambda/main.js +1 -19
  40. package/dist/src/lib/construct/rest-api-lambda/types.d.ts +6 -10
  41. package/dist/src/lib/construct/rest-api-lambda-with-cache/main.d.ts +0 -11
  42. package/dist/src/lib/construct/rest-api-lambda-with-cache/main.js +3 -14
  43. package/dist/src/lib/construct/rest-api-lambda-with-cache/types.d.ts +1 -3
  44. package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +0 -25
  45. package/dist/src/lib/construct/site-with-ecs-backend/main.js +32 -52
  46. package/dist/src/lib/construct/site-with-ecs-backend/types.d.ts +10 -11
  47. package/dist/src/lib/construct/static-asset-deployment/main.d.ts +0 -8
  48. package/dist/src/lib/construct/static-asset-deployment/main.js +0 -8
  49. package/dist/src/lib/construct/static-asset-deployment/types.d.ts +1 -1
  50. package/dist/src/lib/construct/static-site/main.d.ts +0 -17
  51. package/dist/src/lib/construct/static-site/main.js +1 -18
  52. package/dist/src/lib/construct/static-site/types.d.ts +9 -11
  53. package/dist/src/lib/services/aws/api-gateway/main.d.ts +21 -25
  54. package/dist/src/lib/services/aws/api-gateway/main.js +42 -46
  55. package/dist/src/lib/services/aws/api-gateway/types.d.ts +0 -2
  56. package/dist/src/lib/services/aws/appconfig/constants.d.ts +0 -6
  57. package/dist/src/lib/services/aws/appconfig/constants.js +26 -32
  58. package/dist/src/lib/services/aws/appconfig/main.d.ts +16 -19
  59. package/dist/src/lib/services/aws/appconfig/main.js +19 -22
  60. package/dist/src/lib/services/aws/appconfig/types.d.ts +1 -3
  61. package/dist/src/lib/services/aws/certificate-manager/main.d.ts +5 -10
  62. package/dist/src/lib/services/aws/certificate-manager/main.js +5 -10
  63. package/dist/src/lib/services/aws/certificate-manager/types.d.ts +3 -5
  64. package/dist/src/lib/services/aws/cloudfront/main.d.ts +41 -47
  65. package/dist/src/lib/services/aws/cloudfront/main.js +56 -62
  66. package/dist/src/lib/services/aws/cloudfront/types.d.ts +1 -7
  67. package/dist/src/lib/services/aws/cloudtrail/main.d.ts +8 -12
  68. package/dist/src/lib/services/aws/cloudtrail/main.js +8 -12
  69. package/dist/src/lib/services/aws/cloudtrail/types.d.ts +0 -2
  70. package/dist/src/lib/services/aws/cloudwatch/logs.d.ts +11 -15
  71. package/dist/src/lib/services/aws/cloudwatch/logs.js +15 -19
  72. package/dist/src/lib/services/aws/cloudwatch/main.d.ts +80 -84
  73. package/dist/src/lib/services/aws/cloudwatch/main.js +116 -122
  74. package/dist/src/lib/services/aws/cloudwatch/types.d.ts +20 -42
  75. package/dist/src/lib/services/aws/codebuild/main.d.ts +0 -4
  76. package/dist/src/lib/services/aws/codebuild/main.js +3 -7
  77. package/dist/src/lib/services/aws/dynamodb/main.d.ts +3 -7
  78. package/dist/src/lib/services/aws/dynamodb/main.js +13 -17
  79. package/dist/src/lib/services/aws/dynamodb/types.d.ts +0 -2
  80. package/dist/src/lib/services/aws/elastic-container-registry/main.d.ts +3 -7
  81. package/dist/src/lib/services/aws/elastic-container-registry/main.js +3 -7
  82. package/dist/src/lib/services/aws/elastic-container-service/main.d.ts +19 -23
  83. package/dist/src/lib/services/aws/elastic-container-service/main.js +35 -39
  84. package/dist/src/lib/services/aws/elastic-container-service/types.d.ts +1 -9
  85. package/dist/src/lib/services/aws/elastic-file-system/main.d.ts +9 -13
  86. package/dist/src/lib/services/aws/elastic-file-system/main.js +14 -18
  87. package/dist/src/lib/services/aws/elastic-file-system/types.d.ts +1 -5
  88. package/dist/src/lib/services/aws/elastic-kubernetes-service/main.d.ts +5 -9
  89. package/dist/src/lib/services/aws/elastic-kubernetes-service/main.js +8 -12
  90. package/dist/src/lib/services/aws/elastic-kubernetes-service/types.d.ts +1 -3
  91. package/dist/src/lib/services/aws/elasticache/main.d.ts +14 -18
  92. package/dist/src/lib/services/aws/elasticache/main.js +35 -39
  93. package/dist/src/lib/services/aws/elasticache/types.d.ts +0 -4
  94. package/dist/src/lib/services/aws/eventbridge/main.d.ts +25 -29
  95. package/dist/src/lib/services/aws/eventbridge/main.js +34 -38
  96. package/dist/src/lib/services/aws/eventbridge/target.d.ts +6 -9
  97. package/dist/src/lib/services/aws/eventbridge/target.js +8 -10
  98. package/dist/src/lib/services/aws/eventbridge/types.d.ts +2 -10
  99. package/dist/src/lib/services/aws/evidently/main.d.ts +15 -19
  100. package/dist/src/lib/services/aws/evidently/main.js +19 -23
  101. package/dist/src/lib/services/aws/evidently/types.d.ts +0 -10
  102. package/dist/src/lib/services/aws/identity-access-management/main.d.ts +66 -70
  103. package/dist/src/lib/services/aws/identity-access-management/main.js +97 -101
  104. package/dist/src/lib/services/aws/key-management-service/main.d.ts +3 -7
  105. package/dist/src/lib/services/aws/key-management-service/main.js +6 -10
  106. package/dist/src/lib/services/aws/key-management-service/types.d.ts +0 -2
  107. package/dist/src/lib/services/aws/lambda/main.d.ts +42 -47
  108. package/dist/src/lib/services/aws/lambda/main.js +64 -69
  109. package/dist/src/lib/services/aws/lambda/types.d.ts +6 -16
  110. package/dist/src/lib/services/aws/route53/main.d.ts +17 -21
  111. package/dist/src/lib/services/aws/route53/main.js +19 -23
  112. package/dist/src/lib/services/aws/route53/types.d.ts +0 -2
  113. package/dist/src/lib/services/aws/secrets-manager/main.d.ts +6 -19
  114. package/dist/src/lib/services/aws/secrets-manager/main.js +6 -25
  115. package/dist/src/lib/services/aws/simple-notification-service/main.d.ts +8 -12
  116. package/dist/src/lib/services/aws/simple-notification-service/main.js +10 -14
  117. package/dist/src/lib/services/aws/simple-notification-service/types.d.ts +0 -2
  118. package/dist/src/lib/services/aws/simple-queue-service/main.d.ts +11 -15
  119. package/dist/src/lib/services/aws/simple-queue-service/main.js +19 -23
  120. package/dist/src/lib/services/aws/simple-queue-service/types.d.ts +4 -6
  121. package/dist/src/lib/services/aws/simple-storage-service/main.d.ts +24 -32
  122. package/dist/src/lib/services/aws/simple-storage-service/main.js +32 -40
  123. package/dist/src/lib/services/aws/simple-storage-service/types.d.ts +2 -8
  124. package/dist/src/lib/services/aws/step-function/main.d.ts +55 -59
  125. package/dist/src/lib/services/aws/step-function/main.js +91 -95
  126. package/dist/src/lib/services/aws/step-function/types.d.ts +0 -32
  127. package/dist/src/lib/services/aws/systems-manager/main.d.ts +10 -16
  128. package/dist/src/lib/services/aws/systems-manager/main.js +13 -19
  129. package/dist/src/lib/services/aws/systems-manager/types.d.ts +0 -2
  130. package/dist/src/lib/services/aws/virtual-private-cloud/main.d.ts +9 -12
  131. package/dist/src/lib/services/aws/virtual-private-cloud/main.js +10 -16
  132. package/dist/src/lib/services/aws/web-application-firewall/main.d.ts +6 -10
  133. package/dist/src/lib/services/aws/web-application-firewall/main.js +12 -16
  134. package/dist/src/lib/services/aws/web-application-firewall/types.d.ts +0 -4
  135. package/dist/src/lib/types/aws/index.d.ts +0 -2
  136. package/dist/src/lib/utils/aws/index.d.ts +6 -9
  137. package/dist/src/lib/utils/aws/index.js +7 -10
  138. package/dist/src/lib/utils/index.d.ts +6 -13
  139. package/dist/src/lib/utils/index.js +4 -12
  140. package/package.json +1 -1
  141. package/src/lib/common/construct.ts +4 -7
  142. package/src/lib/common/stack.ts +9 -13
  143. package/src/lib/common/types.ts +0 -2
  144. package/src/lib/construct/api-to-eventbridge-target/api.ts +0 -3
  145. package/src/lib/construct/api-to-eventbridge-target/event.ts +0 -3
  146. package/src/lib/construct/api-to-eventbridge-target/main.ts +41 -68
  147. package/src/lib/construct/api-to-eventbridge-target/types.ts +13 -25
  148. package/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +0 -3
  149. package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +44 -81
  150. package/src/lib/construct/api-to-eventbridge-target-with-sns/types.ts +1 -5
  151. package/src/lib/construct/api-to-lambda-target/api.ts +0 -3
  152. package/src/lib/construct/api-to-lambda-target/main.ts +7 -21
  153. package/src/lib/construct/api-to-lambda-target/types.ts +7 -13
  154. package/src/lib/construct/graphql-api-lambda/main.ts +1 -19
  155. package/src/lib/construct/graphql-api-lambda/types.ts +4 -8
  156. package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +1 -12
  157. package/src/lib/construct/graphql-api-lambda-with-cache/types.ts +1 -3
  158. package/src/lib/construct/lambda-with-iam-access/main.ts +2 -14
  159. package/src/lib/construct/rest-api-lambda/main.ts +1 -19
  160. package/src/lib/construct/rest-api-lambda/types.ts +6 -10
  161. package/src/lib/construct/rest-api-lambda-with-cache/main.ts +3 -14
  162. package/src/lib/construct/rest-api-lambda-with-cache/types.ts +1 -3
  163. package/src/lib/construct/site-with-ecs-backend/main.ts +31 -52
  164. package/src/lib/construct/site-with-ecs-backend/types.ts +10 -11
  165. package/src/lib/construct/static-asset-deployment/main.ts +0 -8
  166. package/src/lib/construct/static-asset-deployment/types.ts +1 -1
  167. package/src/lib/construct/static-site/main.ts +1 -18
  168. package/src/lib/construct/static-site/types.ts +9 -11
  169. package/src/lib/services/aws/api-gateway/main.ts +43 -47
  170. package/src/lib/services/aws/api-gateway/types.ts +0 -2
  171. package/src/lib/services/aws/appconfig/constants.ts +26 -32
  172. package/src/lib/services/aws/appconfig/main.ts +19 -22
  173. package/src/lib/services/aws/appconfig/types.ts +1 -3
  174. package/src/lib/services/aws/certificate-manager/main.ts +5 -10
  175. package/src/lib/services/aws/certificate-manager/types.ts +3 -5
  176. package/src/lib/services/aws/cloudfront/main.ts +56 -62
  177. package/src/lib/services/aws/cloudfront/types.ts +1 -7
  178. package/src/lib/services/aws/cloudtrail/main.ts +8 -12
  179. package/src/lib/services/aws/cloudtrail/types.ts +0 -2
  180. package/src/lib/services/aws/cloudwatch/logs.ts +15 -19
  181. package/src/lib/services/aws/cloudwatch/main.ts +116 -122
  182. package/src/lib/services/aws/cloudwatch/types.ts +20 -42
  183. package/src/lib/services/aws/codebuild/main.ts +3 -7
  184. package/src/lib/services/aws/dynamodb/main.ts +13 -17
  185. package/src/lib/services/aws/dynamodb/types.ts +0 -2
  186. package/src/lib/services/aws/elastic-container-registry/main.ts +3 -7
  187. package/src/lib/services/aws/elastic-container-service/main.ts +35 -39
  188. package/src/lib/services/aws/elastic-container-service/types.ts +1 -9
  189. package/src/lib/services/aws/elastic-file-system/main.ts +14 -18
  190. package/src/lib/services/aws/elastic-file-system/types.ts +1 -5
  191. package/src/lib/services/aws/elastic-kubernetes-service/main.ts +8 -12
  192. package/src/lib/services/aws/elastic-kubernetes-service/types.ts +1 -3
  193. package/src/lib/services/aws/elasticache/main.ts +35 -39
  194. package/src/lib/services/aws/elasticache/types.ts +0 -4
  195. package/src/lib/services/aws/eventbridge/main.ts +34 -38
  196. package/src/lib/services/aws/eventbridge/target.ts +8 -11
  197. package/src/lib/services/aws/eventbridge/types.ts +2 -10
  198. package/src/lib/services/aws/evidently/main.ts +19 -23
  199. package/src/lib/services/aws/evidently/types.ts +0 -10
  200. package/src/lib/services/aws/identity-access-management/main.ts +97 -101
  201. package/src/lib/services/aws/key-management-service/main.ts +6 -10
  202. package/src/lib/services/aws/key-management-service/types.ts +0 -2
  203. package/src/lib/services/aws/lambda/main.ts +64 -69
  204. package/src/lib/services/aws/lambda/types.ts +6 -16
  205. package/src/lib/services/aws/route53/main.ts +19 -23
  206. package/src/lib/services/aws/route53/types.ts +0 -2
  207. package/src/lib/services/aws/secrets-manager/main.ts +6 -28
  208. package/src/lib/services/aws/simple-notification-service/main.ts +10 -14
  209. package/src/lib/services/aws/simple-notification-service/types.ts +0 -2
  210. package/src/lib/services/aws/simple-queue-service/main.ts +19 -23
  211. package/src/lib/services/aws/simple-queue-service/types.ts +4 -6
  212. package/src/lib/services/aws/simple-storage-service/main.ts +32 -40
  213. package/src/lib/services/aws/simple-storage-service/types.ts +2 -8
  214. package/src/lib/services/aws/step-function/main.ts +91 -95
  215. package/src/lib/services/aws/step-function/types.ts +0 -32
  216. package/src/lib/services/aws/systems-manager/main.ts +13 -19
  217. package/src/lib/services/aws/systems-manager/types.ts +0 -2
  218. package/src/lib/services/aws/virtual-private-cloud/main.ts +10 -16
  219. package/src/lib/services/aws/web-application-firewall/main.ts +12 -16
  220. package/src/lib/services/aws/web-application-firewall/types.ts +0 -4
  221. package/src/lib/types/aws/index.ts +0 -2
  222. package/src/lib/utils/aws/index.ts +7 -10
  223. 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 {S3BucketProps} props bucket properties
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
- expirationDate: lifecycleRule.expirationDate,
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
- expiredObjectDeleteMarker: lifecycleRule.expiredObjectDeleteMarker,
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 {CommonConstruct} scope scope in which this resource is defined
64
- * @param {string} bucketName the bucket name
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 {CommonConstruct} scope scope in which this resource is defined
74
- * @param {string} bucketName the bucket name
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 {CommonConstruct} scope scope in which this resource is defined
86
- * @param {string} bucketName the bucket name
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 {string} id scoped id of the resource
98
- * @param {CommonConstruct} scope scope in which this resource is defined
99
- * @param {S3BucketProps} props bucket properties
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
- websiteIndexDocument: props.websiteIndexDocument,
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 {string} id scoped id of the resource
161
- * @param {CommonConstruct} scope scope in which this resource is defined
162
- * @param {s3.IBucket} bucket
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 {string} id scoped id of the resource
193
- * @param {CommonConstruct} scope scope in which this resource is defined
194
- * @param {s3.IBucket} siteBucket
195
- * @param {cloudfront.IDistribution} distribution
196
- * @param {s3deploy.ISource[]} sources
197
- * @param {string} prefix
198
- * @param {boolean} prune
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 {string} id scoped id of the resource
224
- * @param {CommonConstruct} scope scope in which this resource is defined
225
- * @param {s3.IBucket} bucket bucket to create the folders in
226
- * @param {string[]} folders list of folder names to be created in the bucket
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 {string} id scoped id of the resource
64
- * @param {CommonConstruct} scope scope in which this resource is defined
65
- * @param {SfnSucceedProps} props
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 {string} id scoped id of the resource
80
- * @param {CommonConstruct} scope scope in which this resource is defined
81
- * @param {SfnFailProps} props
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 {string} id scoped id of the resource
96
- * @param {CommonConstruct} scope scope in which this resource is defined
97
- * @param {SfnPassProps} props
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 {string} id scoped id of the resource
112
- * @param {CommonConstruct} scope scope in which this resource is defined
113
- * @param {SfnParallelProps} props
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 {string} id scoped id of the resource
142
- * @param {CommonConstruct} scope scope in which this resource is defined
143
- * @param {SfnChoiceProps} props
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 {string} id scoped id of the resource
158
- * @param {CommonConstruct} scope scope in which this resource is defined
159
- * @param {SfnWaitProps} props
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 {string} id scoped id of the resource
174
- * @param {CommonConstruct} scope scope in which this resource is defined
175
- * @param {SfnDynamoGetItemProps} props
176
- * @param {dynamodb.ITable} table The table to get the item from
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
- table: table,
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
- comment: `DynamoDB GetItem step for ${props.name} - ${scope.props.stage} stage`,
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 {string} id scoped id of the resource
225
- * @param {CommonConstruct} scope scope in which this resource is defined
226
- * @param {SfnDynamoPutItemProps} props
227
- * @param {dynamodb.ITable} table The table to put the item in
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
- table: table,
242
- item: tableItem,
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
- comment: `DynamoDB PutItem step for ${props.name} - ${scope.props.stage} stage`,
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 {string} id scoped id of the resource
278
- * @param {CommonConstruct} scope scope in which this resource is defined
279
- * @param {SfnDynamoDeleteItemProps} props
280
- * @param {dynamodb.ITable} table The table to put the item in
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
- table: table,
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
- comment: `DynamoDB DeleteItem step for ${props.name} - ${scope.props.stage} stage`,
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 {string} id scoped id of the resource
331
- * @param {CommonConstruct} scope scope in which this resource is defined
332
- * @param {SfnSqsSendMessageProps} props
333
- * @param {sqs.IQueue} queue The queue to send the message to
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
- queue: queue,
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 {string} id scoped id of the resource
380
- * @param {CommonConstruct} scope scope in which this resource is defined
381
- * @param {SfnLambdaInvokeProps} props
382
- * @param {lambda.IFunction} lambdaFunction
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 {string} id scoped id of the resource
417
- * @param {CommonConstruct} scope scope in which this resource is defined
418
- * @param {SfnLambdaInvokeProps} props
419
- * @param {apig.IRestApi} api
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 {string} id scoped id of the resource
455
- * @param {CommonConstruct} scope scope in which this resource is defined
456
- * @param {SfnStartExecutionProps} props props for the step
457
- * @param {sfn.IStateMachine} stateMachine the state machine to execute
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 {string} id scoped id of the resource
491
- * @param {CommonConstruct} scope scope in which this resource is defined
492
- * @param {SfnMapProps} props props for the map state
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 {string} id scoped id of the resource
501
- * @param {CommonConstruct} scope scope in which this resource is defined
502
- * @param {SfnStateMachineProps} props
503
- * @param {sfn.IChainable} definition
504
- * @param {logs.ILogGroup} logGroup
505
- * @param {iam.IRole} role
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
- tracingEnabled: props.tracingEnabled,
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)