@gradientedge/cdk-utils 8.90.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 (226) 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 +7 -12
  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/index.d.ts +1 -0
  133. package/dist/src/lib/services/aws/web-application-firewall/index.js +1 -0
  134. package/dist/src/lib/services/aws/web-application-firewall/main.d.ts +6 -10
  135. package/dist/src/lib/services/aws/web-application-firewall/main.js +12 -16
  136. package/dist/src/lib/services/aws/web-application-firewall/types.d.ts +0 -4
  137. package/dist/src/lib/types/aws/index.d.ts +0 -2
  138. package/dist/src/lib/utils/aws/index.d.ts +6 -9
  139. package/dist/src/lib/utils/aws/index.js +7 -10
  140. package/dist/src/lib/utils/index.d.ts +6 -13
  141. package/dist/src/lib/utils/index.js +4 -12
  142. package/package.json +5 -5
  143. package/src/lib/common/construct.ts +4 -7
  144. package/src/lib/common/stack.ts +9 -13
  145. package/src/lib/common/types.ts +0 -2
  146. package/src/lib/construct/api-to-eventbridge-target/api.ts +0 -3
  147. package/src/lib/construct/api-to-eventbridge-target/event.ts +0 -3
  148. package/src/lib/construct/api-to-eventbridge-target/main.ts +41 -68
  149. package/src/lib/construct/api-to-eventbridge-target/types.ts +13 -25
  150. package/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +0 -3
  151. package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +44 -81
  152. package/src/lib/construct/api-to-eventbridge-target-with-sns/types.ts +1 -5
  153. package/src/lib/construct/api-to-lambda-target/api.ts +0 -3
  154. package/src/lib/construct/api-to-lambda-target/main.ts +7 -21
  155. package/src/lib/construct/api-to-lambda-target/types.ts +7 -13
  156. package/src/lib/construct/graphql-api-lambda/main.ts +1 -19
  157. package/src/lib/construct/graphql-api-lambda/types.ts +4 -8
  158. package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +1 -12
  159. package/src/lib/construct/graphql-api-lambda-with-cache/types.ts +1 -3
  160. package/src/lib/construct/lambda-with-iam-access/main.ts +2 -14
  161. package/src/lib/construct/rest-api-lambda/main.ts +1 -19
  162. package/src/lib/construct/rest-api-lambda/types.ts +7 -12
  163. package/src/lib/construct/rest-api-lambda-with-cache/main.ts +3 -14
  164. package/src/lib/construct/rest-api-lambda-with-cache/types.ts +1 -3
  165. package/src/lib/construct/site-with-ecs-backend/main.ts +31 -52
  166. package/src/lib/construct/site-with-ecs-backend/types.ts +10 -11
  167. package/src/lib/construct/static-asset-deployment/main.ts +0 -8
  168. package/src/lib/construct/static-asset-deployment/types.ts +1 -1
  169. package/src/lib/construct/static-site/main.ts +1 -18
  170. package/src/lib/construct/static-site/types.ts +9 -11
  171. package/src/lib/services/aws/api-gateway/main.ts +43 -47
  172. package/src/lib/services/aws/api-gateway/types.ts +0 -2
  173. package/src/lib/services/aws/appconfig/constants.ts +26 -32
  174. package/src/lib/services/aws/appconfig/main.ts +19 -22
  175. package/src/lib/services/aws/appconfig/types.ts +1 -3
  176. package/src/lib/services/aws/certificate-manager/main.ts +5 -10
  177. package/src/lib/services/aws/certificate-manager/types.ts +3 -5
  178. package/src/lib/services/aws/cloudfront/main.ts +56 -62
  179. package/src/lib/services/aws/cloudfront/types.ts +1 -7
  180. package/src/lib/services/aws/cloudtrail/main.ts +8 -12
  181. package/src/lib/services/aws/cloudtrail/types.ts +0 -2
  182. package/src/lib/services/aws/cloudwatch/logs.ts +15 -19
  183. package/src/lib/services/aws/cloudwatch/main.ts +116 -122
  184. package/src/lib/services/aws/cloudwatch/types.ts +20 -42
  185. package/src/lib/services/aws/codebuild/main.ts +3 -7
  186. package/src/lib/services/aws/dynamodb/main.ts +13 -17
  187. package/src/lib/services/aws/dynamodb/types.ts +0 -2
  188. package/src/lib/services/aws/elastic-container-registry/main.ts +3 -7
  189. package/src/lib/services/aws/elastic-container-service/main.ts +35 -39
  190. package/src/lib/services/aws/elastic-container-service/types.ts +1 -9
  191. package/src/lib/services/aws/elastic-file-system/main.ts +14 -18
  192. package/src/lib/services/aws/elastic-file-system/types.ts +1 -5
  193. package/src/lib/services/aws/elastic-kubernetes-service/main.ts +8 -12
  194. package/src/lib/services/aws/elastic-kubernetes-service/types.ts +1 -3
  195. package/src/lib/services/aws/elasticache/main.ts +35 -39
  196. package/src/lib/services/aws/elasticache/types.ts +0 -4
  197. package/src/lib/services/aws/eventbridge/main.ts +34 -38
  198. package/src/lib/services/aws/eventbridge/target.ts +8 -11
  199. package/src/lib/services/aws/eventbridge/types.ts +2 -10
  200. package/src/lib/services/aws/evidently/main.ts +19 -23
  201. package/src/lib/services/aws/evidently/types.ts +0 -10
  202. package/src/lib/services/aws/identity-access-management/main.ts +97 -101
  203. package/src/lib/services/aws/key-management-service/main.ts +6 -10
  204. package/src/lib/services/aws/key-management-service/types.ts +0 -2
  205. package/src/lib/services/aws/lambda/main.ts +64 -69
  206. package/src/lib/services/aws/lambda/types.ts +6 -16
  207. package/src/lib/services/aws/route53/main.ts +19 -23
  208. package/src/lib/services/aws/route53/types.ts +0 -2
  209. package/src/lib/services/aws/secrets-manager/main.ts +6 -28
  210. package/src/lib/services/aws/simple-notification-service/main.ts +10 -14
  211. package/src/lib/services/aws/simple-notification-service/types.ts +0 -2
  212. package/src/lib/services/aws/simple-queue-service/main.ts +19 -23
  213. package/src/lib/services/aws/simple-queue-service/types.ts +4 -6
  214. package/src/lib/services/aws/simple-storage-service/main.ts +32 -40
  215. package/src/lib/services/aws/simple-storage-service/types.ts +2 -8
  216. package/src/lib/services/aws/step-function/main.ts +91 -95
  217. package/src/lib/services/aws/step-function/types.ts +0 -32
  218. package/src/lib/services/aws/systems-manager/main.ts +13 -19
  219. package/src/lib/services/aws/systems-manager/types.ts +0 -2
  220. package/src/lib/services/aws/virtual-private-cloud/main.ts +10 -16
  221. package/src/lib/services/aws/web-application-firewall/index.ts +1 -0
  222. package/src/lib/services/aws/web-application-firewall/main.ts +12 -16
  223. package/src/lib/services/aws/web-application-firewall/types.ts +0 -4
  224. package/src/lib/types/aws/index.ts +0 -2
  225. package/src/lib/utils/aws/index.ts +7 -10
  226. package/src/lib/utils/index.ts +4 -12
@@ -20,40 +20,30 @@ import {
20
20
  } from 'aws-cdk-lib/aws-stepfunctions-tasks'
21
21
 
22
22
  /**
23
- * @category cdk-utils.step-functions-manager
24
- * @subcategory Properties
25
23
  */
26
24
  export interface SfnSucceedProps extends SucceedProps {
27
25
  name: string
28
26
  }
29
27
 
30
28
  /**
31
- * @category cdk-utils.step-functions-manager
32
- * @subcategory Properties
33
29
  */
34
30
  export interface SfnRetryProps extends RetryProps {
35
31
  intervalInSecs: number
36
32
  }
37
33
 
38
34
  /**
39
- * @category cdk-utils.step-functions-manager
40
- * @subcategory Properties
41
35
  */
42
36
  export interface SfnFailProps extends FailProps {
43
37
  name: string
44
38
  }
45
39
 
46
40
  /**
47
- * @category cdk-utils.step-functions-manager
48
- * @subcategory Properties
49
41
  */
50
42
  export interface SfnPassProps extends PassProps {
51
43
  name: string
52
44
  }
53
45
 
54
46
  /**
55
- * @category cdk-utils.step-functions-manager
56
- * @subcategory Properties
57
47
  */
58
48
  export interface SfnDynamoGetItemProps extends DynamoGetItemProps {
59
49
  name: string
@@ -61,8 +51,6 @@ export interface SfnDynamoGetItemProps extends DynamoGetItemProps {
61
51
  }
62
52
 
63
53
  /**
64
- * @category cdk-utils.step-functions-manager
65
- * @subcategory Properties
66
54
  */
67
55
  export interface SfnDynamoPutItemProps extends DynamoPutItemProps {
68
56
  name: string
@@ -70,8 +58,6 @@ export interface SfnDynamoPutItemProps extends DynamoPutItemProps {
70
58
  }
71
59
 
72
60
  /**
73
- * @category cdk-utils.step-functions-manager
74
- * @subcategory Properties
75
61
  */
76
62
  export interface SfnDynamoDeleteItemProps extends DynamoDeleteItemProps {
77
63
  name: string
@@ -79,8 +65,6 @@ export interface SfnDynamoDeleteItemProps extends DynamoDeleteItemProps {
79
65
  }
80
66
 
81
67
  /**
82
- * @category cdk-utils.step-functions-manager
83
- * @subcategory Properties
84
68
  */
85
69
  export interface SfnSqsSendMessageProps extends SqsSendMessageProps {
86
70
  name: string
@@ -88,8 +72,6 @@ export interface SfnSqsSendMessageProps extends SqsSendMessageProps {
88
72
  }
89
73
 
90
74
  /**
91
- * @category cdk-utils.step-functions-manager
92
- * @subcategory Properties
93
75
  */
94
76
  export interface SfnParallelProps extends ParallelProps {
95
77
  name: string
@@ -97,16 +79,12 @@ export interface SfnParallelProps extends ParallelProps {
97
79
  }
98
80
 
99
81
  /**
100
- * @category cdk-utils.step-functions-manager
101
- * @subcategory Properties
102
82
  */
103
83
  export interface SfnChoiceProps extends ChoiceProps {
104
84
  name: string
105
85
  }
106
86
 
107
87
  /**
108
- * @category cdk-utils.step-functions-manager
109
- * @subcategory Properties
110
88
  */
111
89
  export interface SfnWaitProps extends WaitProps {
112
90
  name: string
@@ -114,8 +92,6 @@ export interface SfnWaitProps extends WaitProps {
114
92
  }
115
93
 
116
94
  /**
117
- * @category cdk-utils.step-functions-manager
118
- * @subcategory Properties
119
95
  */
120
96
  export interface SfnLambdaInvokeProps extends LambdaInvokeProps {
121
97
  name: string
@@ -123,8 +99,6 @@ export interface SfnLambdaInvokeProps extends LambdaInvokeProps {
123
99
  }
124
100
 
125
101
  /**
126
- * @category cdk-utils.step-functions-manager
127
- * @subcategory Properties
128
102
  */
129
103
  export interface SfnCallApiGatewayRestApiEndpointProps extends CallApiGatewayRestApiEndpointProps {
130
104
  name: string
@@ -132,20 +106,14 @@ export interface SfnCallApiGatewayRestApiEndpointProps extends CallApiGatewayRes
132
106
  }
133
107
 
134
108
  /**
135
- * @category cdk-utils.step-functions-manager
136
- * @subcategory Properties
137
109
  */
138
110
  export interface SfnStateMachineProps extends StateMachineProps {}
139
111
 
140
112
  /**
141
- * @category cdk-utils.sfn-manager
142
- * @subcategory Properties
143
113
  */
144
114
  export interface SfnMapProps extends MapProps {}
145
115
 
146
116
  /**
147
- * @category cdk-utils.sfn-manager
148
- * @subcategory Properties
149
117
  */
150
118
  export interface SfnStartExecutionProps extends StepFunctionsStartExecutionProps {
151
119
  retries?: SfnRetryProps[]
@@ -5,9 +5,6 @@ import { CommonConstruct } from '../../../common'
5
5
  import { SSMParameterReaderProps } from './types'
6
6
 
7
7
  /**
8
- * @stability stable
9
- * @category cdk-utils.ssm-manager
10
- * @subcategory Construct
11
8
  * @classdesc Provides operations on AWS Systems Manager.
12
9
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
13
10
  * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
@@ -21,7 +18,6 @@ import { SSMParameterReaderProps } from './types'
21
18
  * this.acmManager.writeStringToParameters('MyParameter', this, ...props)
22
19
  * }
23
20
  * }
24
- *
25
21
  * @see [CDK Systems Manager Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ssm-readme.html}
26
22
  */
27
23
  export class SsmManager {
@@ -29,16 +25,16 @@ export class SsmManager {
29
25
 
30
26
  /**
31
27
  * Method to write a string parameter to the parameters store
32
- * @param {string} id scoped id of the resource
33
- * @param {CommonConstruct} scope scope in which this resource is defined
34
- * @param {ssm.StringParameterProps} props parameter props
28
+ * @param id scoped id of the resource
29
+ * @param scope scope in which this resource is defined
30
+ * @param props parameter props
35
31
  */
36
32
  public writeStringToParameters(id: string, scope: CommonConstruct, props: ssm.StringParameterProps) {
37
33
  if (!props) throw `Parameter props undefined for ${id}`
38
34
 
39
35
  const parameter = new ssm.StringParameter(scope, `${id}`, {
40
- parameterName: `${props.parameterName}-${scope.props.stage}`,
41
36
  description: `${props.description} - ${scope.props.stage} stage`,
37
+ parameterName: `${props.parameterName}-${scope.props.stage}`,
42
38
  stringValue: props.stringValue,
43
39
  })
44
40
 
@@ -50,9 +46,9 @@ export class SsmManager {
50
46
 
51
47
  /**
52
48
  * Method to read a string parameter from the parameters store
53
- * @param {string} id scoped id of the resource
54
- * @param {CommonConstruct} scope scope in which this resource is defined
55
- * @param {string} parameterName parameter name to lookup
49
+ * @param id scoped id of the resource
50
+ * @param scope scope in which this resource is defined
51
+ * @param parameterName parameter name to lookup
56
52
  */
57
53
  public readStringParameter(id: string, scope: CommonConstruct, parameterName: string) {
58
54
  if (!parameterName || parameterName == '') throw 'Invalid parameter name'
@@ -62,10 +58,10 @@ export class SsmManager {
62
58
 
63
59
  /**
64
60
  * Method to read a string parameter from the parameters store in a given region
65
- * @param {string} id scoped id of the resource
66
- * @param {CommonConstruct} scope scope in which this resource is defined
67
- * @param {string} parameterName parameter name to lookup
68
- * @param {string} region region name to lookup parameter
61
+ * @param id scoped id of the resource
62
+ * @param scope scope in which this resource is defined
63
+ * @param parameterName parameter name to lookup
64
+ * @param region region name to lookup parameter
69
65
  */
70
66
  public readStringParameterFromRegion(id: string, scope: CommonConstruct, parameterName: string, region: string) {
71
67
  if (!parameterName || parameterName == '') throw `Invalid parameter name for ${id}`
@@ -79,8 +75,6 @@ export class SsmManager {
79
75
  }
80
76
 
81
77
  /**
82
- * @category cdk-utils.ssm-manager
83
- * @subcategory Construct
84
78
  * @classdesc Provides utilities to read same/cross region SSM parameters
85
79
  */
86
80
  export class SSMParameterReader extends cr.AwsCustomResource {
@@ -88,13 +82,13 @@ export class SSMParameterReader extends cr.AwsCustomResource {
88
82
  const { parameterName, region } = props
89
83
 
90
84
  const ssmAwsSdkCall: cr.AwsSdkCall = {
91
- service: 'SSM',
92
85
  action: 'getParameter',
93
86
  parameters: {
94
87
  Name: `${parameterName}-${scope.props.stage}`,
95
88
  },
96
- region,
97
89
  physicalResourceId: cr.PhysicalResourceId.of(Date.now().toString()),
90
+ region,
91
+ service: 'SSM',
98
92
  }
99
93
 
100
94
  super(scope, name, {
@@ -1,6 +1,4 @@
1
1
  /**
2
- * @category cdk-utils.ssm-manager
3
- * @subcategory Properties
4
2
  */
5
3
  export interface SSMParameterReaderProps {
6
4
  parameterName: string
@@ -4,15 +4,10 @@ import * as utils from '../../../utils'
4
4
  import { CommonConstruct } from '../../../common'
5
5
 
6
6
  /**
7
- * @stability stable
8
- * @category cdk-utils.vpc-manager
9
- * @subcategory Construct
10
7
  */
11
8
  const CommonVpcIdentifier = 'CommonVpc'
12
9
 
13
10
  /**
14
- * @category cdk-utils.vpc-manager
15
- * @subcategory Construct
16
11
  * @classdesc Provides operations on AWS VPC.
17
12
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
18
13
  * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
@@ -26,21 +21,20 @@ const CommonVpcIdentifier = 'CommonVpc'
26
21
  * this.vpcManager.createVpc('MyVPC', this)
27
22
  * }
28
23
  * }
29
- *
30
24
  * @see [CDK VPC Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.@aws-cdk_aws-ec2.Vpc.html}
31
25
  */
32
26
  export class VpcManager {
33
27
  /**
34
28
  * @summary Method to create a new vpc
35
- * @param {string} id scoped id of the resource
36
- * @param {CommonConstruct} scope scope in which this resource is defined
37
- * @param {ec2.VpcProps} props
29
+ * @param id scoped id of the resource
30
+ * @param scope scope in which this resource is defined
31
+ * @param props
38
32
  */
39
33
  public createVpc(id: string, scope: CommonConstruct, props: ec2.VpcProps) {
40
34
  if (!props) throw `Vpc props undefined for ${id}`
41
35
  const vpc = new ec2.Vpc(scope, `${id}`, {
42
- maxAzs: props.maxAzs,
43
36
  ipAddresses: props.ipAddresses,
37
+ maxAzs: props.maxAzs,
44
38
  })
45
39
 
46
40
  utils.createCfnOutput(`${id}Id`, scope, vpc.vpcId)
@@ -64,9 +58,9 @@ export class VpcManager {
64
58
 
65
59
  /**
66
60
  * @summary Method to create a common vpc
67
- * @param {CommonConstruct} scope scope in which this resource is defined
68
- * @param {ec2.VpcProps} props
69
- * @param {string?} vpcIdentifier optional identifier for VPC
61
+ * @param scope scope in which this resource is defined
62
+ * @param props
63
+ * @param vpcIdentifier optional identifier for VPC
70
64
  */
71
65
  public createCommonVpc(scope: CommonConstruct, props: ec2.VpcProps, vpcIdentifier?: string) {
72
66
  const vpc = this.createVpc(CommonVpcIdentifier, scope, props)
@@ -77,9 +71,9 @@ export class VpcManager {
77
71
 
78
72
  /**
79
73
  * @summary Method to retrieve a common vpc
80
- * @param {string} id scoped id of the resource
81
- * @param {CommonConstruct} scope scope in which this resource is defined
82
- * @param {string?} vpcIdentifier optional identifier for VPC
74
+ * @param id scoped id of the resource
75
+ * @param scope scope in which this resource is defined
76
+ * @param vpcIdentifier optional identifier for VPC
83
77
  */
84
78
  public retrieveCommonVpc(id: string, scope: CommonConstruct, vpcIdentifier?: string) {
85
79
  return ec2.Vpc.fromLookup(scope, `${id}`, { vpcName: vpcIdentifier ?? CommonVpcIdentifier })
@@ -1 +1,2 @@
1
1
  export * from './main'
2
+ export * from './types'
@@ -4,9 +4,6 @@ import { CommonConstruct } from '../../../common'
4
4
  import { WafIPSetProps, WafWebACLProps } from './types'
5
5
 
6
6
  /**
7
- * @stability stable
8
- * @category cdk-utils.waf-manager
9
- * @subcategory Construct
10
7
  * @classdesc Provides operations on AWS WAF.
11
8
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
12
9
  * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
@@ -20,24 +17,23 @@ import { WafIPSetProps, WafWebACLProps } from './types'
20
17
  * this.wafManager.createWebAcl('MyWebAcl', this)
21
18
  * }
22
19
  * }
23
- *
24
20
  * @see [CDK WAF Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_waf-readme.html}
25
21
  */
26
22
  export class WafManager {
27
23
  /**
28
24
  * @summary Method to create an ip set
29
- * @param {string} id scoped id of the resource
30
- * @param {CommonConstruct} scope scope in which this resource is defined
31
- * @param {WafIPSetProps} props
25
+ * @param id scoped id of the resource
26
+ * @param scope scope in which this resource is defined
27
+ * @param props
32
28
  */
33
29
  public createIpSet(id: string, scope: CommonConstruct, props: WafIPSetProps) {
34
30
  if (!props) throw `WAF Ip Set props undefined for ${id}`
35
31
 
36
32
  const ipSet = new wafv2.CfnIPSet(scope, `${id}`, {
37
- name: scope.isProductionStage() ? props.name : `${props.name}-${scope.props.stage}`,
38
- description: `IP Set for ${id} - ${scope.props.stage} stage`,
39
33
  addresses: props.addresses,
34
+ description: `IP Set for ${id} - ${scope.props.stage} stage`,
40
35
  ipAddressVersion: props.ipAddressVersion,
36
+ name: scope.isProductionStage() ? props.name : `${props.name}-${scope.props.stage}`,
41
37
  scope: props.scope,
42
38
  })
43
39
 
@@ -49,21 +45,21 @@ export class WafManager {
49
45
 
50
46
  /**
51
47
  * @summary Method to create a web acl
52
- * @param {string} id scoped id of the resource
53
- * @param {CommonConstruct} scope scope in which this resource is defined
54
- * @param {WafWebACLProps} props
48
+ * @param id scoped id of the resource
49
+ * @param scope scope in which this resource is defined
50
+ * @param props
55
51
  */
56
52
  public createWebAcl(id: string, scope: CommonConstruct, props: WafWebACLProps) {
57
53
  if (!props) throw `WAF WebACL props undefined for ${id}`
58
54
 
59
55
  const webAcl = new wafv2.CfnWebACL(scope, `${id}`, {
60
- name: scope.isProductionStage() ? props.name : `${props.name}-${scope.props.stage}`,
61
- description: `Web Acl for ${id} - ${scope.props.stage} stage`,
62
56
  defaultAction: props.defaultAction,
63
- scope: props.scope,
64
- visibilityConfig: props.visibilityConfig,
57
+ description: `Web Acl for ${id} - ${scope.props.stage} stage`,
58
+ name: scope.isProductionStage() ? props.name : `${props.name}-${scope.props.stage}`,
65
59
  rules: props.rules,
60
+ scope: props.scope,
66
61
  tags: [{ key: 'service', value: scope.props.name }],
62
+ visibilityConfig: props.visibilityConfig,
67
63
  })
68
64
 
69
65
  utils.createCfnOutput(`${id}-webAclId`, scope, webAcl.attrId)
@@ -1,13 +1,9 @@
1
1
  import { CfnIPSetProps, CfnWebACLProps } from 'aws-cdk-lib/aws-wafv2'
2
2
 
3
3
  /**
4
- * @category cdk-utils.waf-manager
5
- * @subcategory Properties
6
4
  */
7
5
  export interface WafIPSetProps extends CfnIPSetProps {}
8
6
 
9
7
  /**
10
- * @category cdk-utils.waf-manager
11
- * @subcategory Properties
12
8
  */
13
9
  export interface WafWebACLProps extends CfnWebACLProps {}
@@ -1,6 +1,4 @@
1
1
  /**
2
- * @category cdk-utils.common-stack
3
- * @subcategory Properties
4
2
  */
5
3
  export interface TagProps {
6
4
  key: string
@@ -3,16 +3,13 @@ import * as _ from 'lodash'
3
3
  import { CommonConstruct } from '../../common'
4
4
 
5
5
  /**
6
- * @category cdk-utils.utils
7
6
  * @summary Helper method to add CloudFormation outputs from the construct
8
- * @param {string} id scoped id of the resource
9
- * @param {CommonConstruct} scope scope in which this resource is defined
10
- * @param {string} id scoped id of the resource
11
- * @param {string} value the value of the exported output
12
- * @param {string?} description optional description for the output
13
- * @param {boolean} overrideId Flag which indicates whether to override the default logical id of the output
14
- *
15
- * @return {cdk.CfnOutput} The CloudFormation output
7
+ * @param id scoped id of the resource
8
+ * @param scope scope in which this resource is defined
9
+ * @param value the value of the exported output
10
+ * @param description optional description for the output
11
+ * @param overrideId Flag which indicates whether to override the default logical id of the output
12
+ * @returns The CloudFormation output
16
13
  */
17
14
  export function createCfnOutput(
18
15
  id: string,
@@ -23,9 +20,9 @@ export function createCfnOutput(
23
20
  ): cdk.CfnOutput {
24
21
  const camelName = _.camelCase(id)
25
22
  const output = new cdk.CfnOutput(scope, id, {
23
+ description,
26
24
  exportName: `${scope.props.stackName}-${camelName}`,
27
25
  value: value ?? '',
28
- description,
29
26
  })
30
27
  if (overrideId) {
31
28
  output.overrideLogicalId(camelName)
@@ -1,19 +1,17 @@
1
1
  export * from './aws'
2
2
 
3
3
  /**
4
- * @category cdk-utils.utils
5
4
  */
6
5
  const defaultResponseObject = {
7
- statusCode: 200,
8
6
  body: '',
9
- isBase64Encoded: false,
10
7
  headers: {
11
8
  'Access-Control-Allow-Origin': '*',
12
9
  },
10
+ isBase64Encoded: false,
11
+ statusCode: 200,
13
12
  }
14
13
 
15
14
  /**
16
- * @category cdk-utils.utils
17
15
  */
18
16
  export enum LogLevel {
19
17
  DEBUG = 'DEBUG',
@@ -25,45 +23,39 @@ export enum LogLevel {
25
23
  }
26
24
 
27
25
  /**
28
- * @category cdk-utils.utils
29
26
  * @param stage
30
27
  */
31
28
  export const isDevStage = (stage: string) => stage === 'dev'
32
29
  /**
33
- * @category cdk-utils.utils
34
30
  * @param stage
35
31
  */
36
32
  export const isTestStage = (stage: string) => stage === 'tst'
37
33
  /**
38
- * @category cdk-utils.utils
39
34
  * @param stage
40
35
  */
41
36
  export const isUatStage = (stage: string) => stage === 'uat'
42
37
  /**
43
- * @category cdk-utils.utils
44
38
  * @param stage
45
39
  */
46
40
  export const isPrdStage = (stage: string) => stage === 'prd'
47
41
 
48
42
  /**
49
- * @category cdk-utils.utils
50
43
  * @param error
51
44
  */
52
45
  export function redirectError(error: any) {
53
46
  console.error(error, error.message, error.stack)
54
47
  return Object.assign({}, defaultResponseObject, {
48
+ body: JSON.stringify(Object.assign({}, { error: error.message, success: false })),
55
49
  statusCode: 500,
56
- body: JSON.stringify(Object.assign({}, { success: false, error: error.message })),
57
50
  })
58
51
  }
59
52
 
60
53
  /**
61
- * @category cdk-utils.utils
62
54
  * @param message
63
55
  */
64
56
  export function redirectSuccess(message: any) {
65
57
  return Object.assign({}, defaultResponseObject, {
58
+ body: JSON.stringify(Object.assign({}, { error: message, success: true })),
66
59
  statusCode: 200,
67
- body: JSON.stringify(Object.assign({}, { success: true, error: message })),
68
60
  })
69
61
  }