@gradientedge/cdk-utils 8.91.0 → 8.93.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 +1 -19
  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 +1 -19
  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 +2 -20
  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 +2 -20
  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
@@ -31,7 +31,6 @@ const lambda = __importStar(require("aws-cdk-lib/aws-lambda"));
31
31
  const common_1 = require("../../common");
32
32
  const api_1 = require("./api");
33
33
  /**
34
- * @mixin
35
34
  */
36
35
  class ApiToLambdaTarget extends common_1.CommonConstruct {
37
36
  props;
@@ -70,21 +69,18 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
70
69
  /**
71
70
  * @summary Method to resolve secrets from SecretsManager
72
71
  * - To be implemented in the overriding method in the implementation class
73
- * @protected
74
72
  */
75
73
  resolveSecrets() {
76
74
  this.applicationSecrets = [];
77
75
  }
78
76
  /**
79
77
  * @summary Method to resolve a hosted zone based on domain attributes
80
- * @protected
81
78
  */
82
79
  resolveHostedZone() {
83
80
  this.apiToLambdaTargetRestApi.hostedZone = this.route53Manager.withHostedZoneFromFullyQualifiedDomainName(`${this.id}-hosted-zone`, this, this.props.useExistingHostedZone);
84
81
  }
85
82
  /**
86
83
  * @summary Method to resolve a certificate based on attributes
87
- * @protected
88
84
  */
89
85
  resolveCertificate() {
90
86
  if (this.props.api.useExisting)
@@ -98,38 +94,36 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
98
94
  }
99
95
  /**
100
96
  * @summary Method to create api integration method response
101
- * @protected
102
97
  */
103
98
  createApiToLambdaTargetMethodResponse() {
104
99
  if (!this.props.api.withResource)
105
100
  return;
106
101
  this.apiToLambdaTargetRestApi.methodResponse = {
107
102
  ...{
108
- statusCode: '200',
109
103
  responseParameters: {
110
- 'method.response.header.Content-Type': true,
111
- 'method.response.header.Access-Control-Allow-Origin': true,
112
104
  'method.response.header.Access-Control-Allow-Credentials': true,
105
+ 'method.response.header.Access-Control-Allow-Origin': true,
106
+ 'method.response.header.Content-Type': true,
113
107
  },
108
+ statusCode: '200',
114
109
  },
115
110
  ...this.props.api.methodResponse,
116
111
  };
117
112
  }
118
113
  /**
119
114
  * @summary Method to create api integration method error response
120
- * @protected
121
115
  */
122
116
  createApiToLambdaTargetMethodErrorResponse() {
123
117
  if (!this.props.api.withResource)
124
118
  return;
125
119
  this.apiToLambdaTargetRestApi.methodErrorResponse = {
126
120
  ...{
127
- statusCode: '400',
128
121
  responseParameters: {
129
- 'method.response.header.Content-Type': true,
130
- 'method.response.header.Access-Control-Allow-Origin': true,
131
122
  'method.response.header.Access-Control-Allow-Credentials': true,
123
+ 'method.response.header.Access-Control-Allow-Origin': true,
124
+ 'method.response.header.Content-Type': true,
132
125
  },
126
+ statusCode: '400',
133
127
  },
134
128
  ...this.props.api.methodErrorResponse,
135
129
  };
@@ -139,7 +133,6 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
139
133
  }
140
134
  /**
141
135
  * @summary Method to create rest restApi for Api
142
- * @protected
143
136
  */
144
137
  createApiToLambdaTargetRestApi() {
145
138
  if (this.props.api.useExisting && this.props.api.importedRestApiRef) {
@@ -170,7 +163,6 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
170
163
  }
171
164
  /**
172
165
  * @summary Method to create api integration resource
173
- * @protected
174
166
  */
175
167
  createApiToLambdaTargetResource() {
176
168
  if (!this.props.api.withResource)
@@ -178,9 +170,9 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
178
170
  let rootResource;
179
171
  if (this.props.api.withResource && this.props.api.importedRestApiRootResourceRef) {
180
172
  rootResource = apig.Resource.fromResourceAttributes(this, `${this.id}-root-resource`, {
173
+ path: '/',
181
174
  resourceId: cdk.Fn.importValue(this.props.api.importedRestApiRootResourceRef),
182
175
  restApi: this.apiToLambdaTargetRestApi.api,
183
- path: '/',
184
176
  });
185
177
  }
186
178
  else {
@@ -198,7 +190,6 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
198
190
  }
199
191
  /**
200
192
  * @summary Method to create a role for api integration
201
- * @protected
202
193
  */
203
194
  createApiToLambdaTargetRole() {
204
195
  if (!this.apiToLambdaTargetRestApi.policy)
@@ -210,7 +201,6 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
210
201
  }
211
202
  /**
212
203
  * @summary Method to create api integration resource method
213
- * @protected
214
204
  */
215
205
  createApiToLambdaTargetIntegration() {
216
206
  this.apiToLambdaTargetRestApi.integration = new apig.LambdaIntegration(this.apiToLambdaTargetRestApi.lambda, {
@@ -220,7 +210,6 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
220
210
  }
221
211
  /**
222
212
  * @summary Method to create api integration resource method
223
- * @protected
224
213
  */
225
214
  createApiToLambdaTargetResourceMethod() {
226
215
  if (!this.props.api.withResource)
@@ -235,7 +224,6 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
235
224
  }
236
225
  /**
237
226
  * @summary Method to create custom restApi domain for Api
238
- * @protected
239
227
  */
240
228
  createApiDomain() {
241
229
  if (this.props.api.useExisting)
@@ -246,7 +234,6 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
246
234
  }
247
235
  /**
248
236
  * @summary Method to create base path mappings for Api
249
- * @protected
250
237
  */
251
238
  createApiBasePathMapping() {
252
239
  if (this.props.api.useExisting)
@@ -260,7 +247,6 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
260
247
  }
261
248
  /**
262
249
  * @summary Method to create route53 records for Api
263
- * @protected
264
250
  */
265
251
  createApiRouteAssets() {
266
252
  if (this.props.api.useExisting)
@@ -7,8 +7,6 @@ import { IFunction } from 'aws-cdk-lib/aws-lambda';
7
7
  import { ITopic } from 'aws-cdk-lib/aws-sns';
8
8
  import { PolicyDocument, Role } from 'aws-cdk-lib/aws-iam';
9
9
  /**
10
- * @category cdk-utils.api-to-lambda-target
11
- * @subcategory Types
12
10
  */
13
11
  export interface ApiToLambdaTargetRestApiType {
14
12
  api: IRestApi;
@@ -31,35 +29,31 @@ export interface ApiToLambdaTargetRestApiType {
31
29
  method: Method;
32
30
  methodErrorResponse: MethodResponse;
33
31
  methodResponse: MethodResponse;
32
+ policy?: PolicyDocument;
34
33
  resource: Resource;
35
34
  responseModel: Model;
36
- topic?: ITopic;
37
35
  role?: Role;
38
- policy?: PolicyDocument;
36
+ topic?: ITopic;
39
37
  }
40
38
  /**
41
- * @category cdk-utils.api-to-lambda-target
42
- * @subcategory Properties
43
39
  */
44
40
  export interface ApiToLambdaTargetRestApiProps {
45
- resource: string;
46
41
  certificate: AcmProps;
47
- restApi: LambdaRestApiProps;
48
42
  importedRestApiRef?: string;
49
43
  importedRestApiRootResourceRef?: string;
50
- useExisting: boolean;
51
- withResource?: boolean;
52
44
  methodErrorResponse: MethodResponse;
53
45
  methodResponse: MethodResponse;
46
+ resource: string;
47
+ restApi: LambdaRestApiProps;
48
+ useExisting: boolean;
49
+ withResource?: boolean;
54
50
  }
55
51
  /**
56
- * @category cdk-utils.api-to-lambda-target
57
- * @subcategory Properties
58
52
  */
59
53
  export interface ApiToLambdaTargetProps extends CommonStackProps {
54
+ api: ApiToLambdaTargetRestApiProps;
60
55
  apiRootPaths?: string[];
61
56
  apiSubDomain: string;
62
- api: ApiToLambdaTargetRestApiProps;
63
57
  lambdaFunctionName: string;
64
58
  logLevel: string;
65
59
  nodeEnv: string;
@@ -9,13 +9,9 @@ import { CommonConstruct } from '../../common';
9
9
  import { GraphQlApiLambdaEnvironment, GraphQlApiLambdaProps } from './types';
10
10
  /**
11
11
  * @deprecated Use RestApiLambda instead. This will be removed in a future release.
12
- *
13
- * @category cdk-utils.graphql-api-lambda
14
- * @subcategory construct
15
12
  * @classdesc Provides a construct to create and deploy a Graphql API as Lambda
16
13
  *
17
14
  * <b>Architecture</b><br/> ![Architecture](./GraphQLApiLambda.jpg)
18
- *
19
15
  * @example
20
16
  * import { GraphQLApiLambda, GraphQlApiLambdaProps } '@gradientedge/cdk-utils'
21
17
  * import { Construct } from 'constructs'
@@ -28,7 +24,6 @@ import { GraphQlApiLambdaEnvironment, GraphQlApiLambdaProps } from './types';
28
24
  * this.initResources()
29
25
  * }
30
26
  * }
31
- * @mixin
32
27
  */
33
28
  export declare class GraphQLApiLambda extends CommonConstruct {
34
29
  props: GraphQlApiLambdaProps;
@@ -37,7 +32,7 @@ export declare class GraphQLApiLambda extends CommonConstruct {
37
32
  graphQLApiLambdaPolicy: iam.PolicyDocument;
38
33
  graphQLApiLambdaRole: iam.Role;
39
34
  graphQLApiLambdaEnvironment: GraphQlApiLambdaEnvironment;
40
- graphQLApiLambdaLayers: lambda.LayerVersion[];
35
+ graphQLApiLambdaLayers: lambda.ILayerVersion[];
41
36
  graphQLApiLambdaFunction: lambda.Function;
42
37
  graphQLApi: apig.RestApi;
43
38
  graphQLApiHostedZone: route53.IHostedZone;
@@ -47,68 +42,55 @@ export declare class GraphQLApiLambda extends CommonConstruct {
47
42
  constructor(parent: Construct, id: string, props: GraphQlApiLambdaProps);
48
43
  /**
49
44
  * @summary Initialise and provision resources
50
- * @protected
51
45
  */
52
46
  protected initResources(): void;
53
47
  /**
54
48
  * @summary Method to resolve secrets from SecretsManager
55
49
  * - To be implemented in the overriding method in the implementation class
56
- * @protected
57
50
  */
58
51
  protected resolveSecrets(): void;
59
52
  /**
60
53
  * @summary Method to resolve a hosted zone based on domain attributes
61
- * @protected
62
54
  */
63
55
  protected resolveHostedZone(): void;
64
56
  /**
65
57
  * @summary Method to resolve a certificate based on attributes
66
- * @protected
67
58
  */
68
59
  protected resolveCertificate(): void;
69
60
  /**
70
61
  * @summary Method to create iam policy for GraphQL Lambda function
71
- * @protected
72
62
  */
73
63
  protected createLambdaPolicy(): void;
74
64
  /**
75
65
  * @summary Method to create iam role for GraphQL Lambda function
76
- * @protected
77
66
  */
78
67
  protected createLambdaRole(): void;
79
68
  /**
80
69
  * @summary Method to create environment variables for GraphQL Lambda function
81
- * @protected
82
70
  */
83
71
  protected createLambdaEnvironment(): void;
84
72
  /**
85
73
  * @summary Method to create layers for GraphQL Lambda function
86
- * @protected
87
74
  */
88
75
  protected createLambdaLayers(): void;
89
76
  /**
90
77
  * @summary Method to create lambda function for GraphQL
91
- * @protected
92
78
  */
93
79
  protected createLambdaFunction(): void;
94
80
  /**
95
81
  * @summary Method to create rest restApi for GraphQL
96
- * @protected
97
82
  */
98
83
  protected createRestApi(): void;
99
84
  /**
100
85
  * @summary Method to create custom restApi domain for GraphQL API
101
- * @protected
102
86
  */
103
87
  protected createApiDomain(): void;
104
88
  /**
105
89
  * @summary Method to create base path mappings for GraphQL API
106
- * @protected
107
90
  */
108
91
  protected createApiBasePathMapping(): void;
109
92
  /**
110
93
  * @summary Method to create route53 records for GraphQL API
111
- * @protected
112
94
  */
113
95
  protected createApiRouteAssets(): void;
114
96
  }
@@ -29,13 +29,9 @@ const iam = __importStar(require("aws-cdk-lib/aws-iam"));
29
29
  const common_1 = require("../../common");
30
30
  /**
31
31
  * @deprecated Use RestApiLambda instead. This will be removed in a future release.
32
- *
33
- * @category cdk-utils.graphql-api-lambda
34
- * @subcategory construct
35
32
  * @classdesc Provides a construct to create and deploy a Graphql API as Lambda
36
33
  *
37
34
  * <b>Architecture</b><br/> ![Architecture](./GraphQLApiLambda.jpg)
38
- *
39
35
  * @example
40
36
  * import { GraphQLApiLambda, GraphQlApiLambdaProps } '@gradientedge/cdk-utils'
41
37
  * import { Construct } from 'constructs'
@@ -48,7 +44,6 @@ const common_1 = require("../../common");
48
44
  * this.initResources()
49
45
  * }
50
46
  * }
51
- * @mixin
52
47
  */
53
48
  class GraphQLApiLambda extends common_1.CommonConstruct {
54
49
  /* graphql restApi props */
@@ -73,7 +68,6 @@ class GraphQLApiLambda extends common_1.CommonConstruct {
73
68
  }
74
69
  /**
75
70
  * @summary Initialise and provision resources
76
- * @protected
77
71
  */
78
72
  initResources() {
79
73
  this.resolveSecrets();
@@ -92,21 +86,18 @@ class GraphQLApiLambda extends common_1.CommonConstruct {
92
86
  /**
93
87
  * @summary Method to resolve secrets from SecretsManager
94
88
  * - To be implemented in the overriding method in the implementation class
95
- * @protected
96
89
  */
97
90
  resolveSecrets() {
98
91
  this.applicationSecrets = [];
99
92
  }
100
93
  /**
101
94
  * @summary Method to resolve a hosted zone based on domain attributes
102
- * @protected
103
95
  */
104
96
  resolveHostedZone() {
105
97
  this.graphQLApiHostedZone = this.route53Manager.withHostedZoneFromFullyQualifiedDomainName(`${this.id}-hosted-zone`, this, this.props.useExistingHostedZone);
106
98
  }
107
99
  /**
108
100
  * @summary Method to resolve a certificate based on attributes
109
- * @protected
110
101
  */
111
102
  resolveCertificate() {
112
103
  if (this.props.graphQLApiCertificate.useExistingCertificate &&
@@ -118,7 +109,6 @@ class GraphQLApiLambda extends common_1.CommonConstruct {
118
109
  }
119
110
  /**
120
111
  * @summary Method to create iam policy for GraphQL Lambda function
121
- * @protected
122
112
  */
123
113
  createLambdaPolicy() {
124
114
  this.graphQLApiLambdaPolicy = new iam.PolicyDocument({
@@ -127,25 +117,22 @@ class GraphQLApiLambda extends common_1.CommonConstruct {
127
117
  }
128
118
  /**
129
119
  * @summary Method to create iam role for GraphQL Lambda function
130
- * @protected
131
120
  */
132
121
  createLambdaRole() {
133
122
  this.graphQLApiLambdaRole = this.iamManager.createRoleForLambda(`${this.id}-lambda-role`, this, this.graphQLApiLambdaPolicy);
134
123
  }
135
124
  /**
136
125
  * @summary Method to create environment variables for GraphQL Lambda function
137
- * @protected
138
126
  */
139
127
  createLambdaEnvironment() {
140
128
  this.graphQLApiLambdaEnvironment = {
141
- NODE_ENV: this.props.nodeEnv,
142
129
  LOG_LEVEL: this.props.logLevel,
130
+ NODE_ENV: this.props.nodeEnv,
143
131
  TZ: this.props.timezone,
144
132
  };
145
133
  }
146
134
  /**
147
135
  * @summary Method to create layers for GraphQL Lambda function
148
- * @protected
149
136
  */
150
137
  createLambdaLayers() {
151
138
  const layers = [];
@@ -158,21 +145,18 @@ class GraphQLApiLambda extends common_1.CommonConstruct {
158
145
  }
159
146
  /**
160
147
  * @summary Method to create lambda function for GraphQL
161
- * @protected
162
148
  */
163
149
  createLambdaFunction() {
164
150
  this.graphQLApiLambdaFunction = this.lambdaManager.createLambdaFunction(`${this.id}-graphql-server`, this, this.props.graphqlApi, this.graphQLApiLambdaRole, this.graphQLApiLambdaLayers, this.props.graphQLApiSource, this.props.graphQLApiHandler || 'index.handler', this.graphQLApiLambdaEnvironment);
165
151
  }
166
152
  /**
167
153
  * @summary Method to create rest restApi for GraphQL
168
- * @protected
169
154
  */
170
155
  createRestApi() {
171
156
  this.graphQLApi = this.apiManager.createLambdaRestApi(`${this.id}-lambda-rest-api`, this, this.props.graphqlRestApi, this.graphQLApiLambdaFunction);
172
157
  }
173
158
  /**
174
159
  * @summary Method to create custom restApi domain for GraphQL API
175
- * @protected
176
160
  */
177
161
  createApiDomain() {
178
162
  this.graphQLApiDomain = this.apiManager.createApiDomain(`${this.id}-api-domain`, this, this.isProductionStage() || this.props.skipStageForARecords
@@ -181,7 +165,6 @@ class GraphQLApiLambda extends common_1.CommonConstruct {
181
165
  }
182
166
  /**
183
167
  * @summary Method to create base path mappings for GraphQL API
184
- * @protected
185
168
  */
186
169
  createApiBasePathMapping() {
187
170
  const apiRootPaths = this.props.apiRootPaths;
@@ -205,7 +188,6 @@ class GraphQLApiLambda extends common_1.CommonConstruct {
205
188
  }
206
189
  /**
207
190
  * @summary Method to create route53 records for GraphQL API
208
- * @protected
209
191
  */
210
192
  createApiRouteAssets() {
211
193
  this.route53Manager.createApiGatewayARecord(`${this.id}-custom-domain-a-record`, this, this.props.apiSubDomain, this.graphQLApiDomain, this.graphQLApiHostedZone, this.props.skipStageForARecords);
@@ -4,27 +4,23 @@ import { LambdaRestApiProps } from 'aws-cdk-lib/aws-apigateway';
4
4
  import { AssetCode } from 'aws-cdk-lib/aws-lambda';
5
5
  /**
6
6
  * @deprecated Use RestApiLambdaEnvironment instead. This will be removed in a future release.
7
- * @category cdk-utils.graphql-api-lambda
8
- * @subcategory Types
9
7
  */
10
8
  export interface GraphQlApiLambdaEnvironment extends LambdaEnvironment {
11
9
  }
12
10
  /**
13
11
  * @deprecated Use RestApiLambdaProps instead. This will be removed in a future release.
14
- * @category cdk-utils.graphql-api-lambda
15
- * @subcategory Properties
16
12
  */
17
13
  export interface GraphQlApiLambdaProps extends CommonStackProps {
18
14
  apiRootPaths?: string[];
19
15
  apiSubDomain: string;
20
16
  graphQLApiCertificate: AcmProps;
21
- graphqlRestApi: LambdaRestApiProps;
22
- graphqlApiLambdaLayerSources?: AssetCode[];
23
17
  graphQLApiHandler: string;
24
18
  graphQLApiSource: AssetCode;
25
19
  graphqlApi: LambdaProps;
26
- useExistingHostedZone: boolean;
27
- nodeEnv: string;
20
+ graphqlApiLambdaLayerSources?: AssetCode[];
21
+ graphqlRestApi: LambdaRestApiProps;
28
22
  logLevel: string;
23
+ nodeEnv: string;
29
24
  timezone: string;
25
+ useExistingHostedZone: boolean;
30
26
  }
@@ -5,13 +5,9 @@ import { GraphQLApiLambda } from '..';
5
5
  import { GraphQlApiLambdaWithCacheProps } from './types';
6
6
  /**
7
7
  * @deprecated Use RestApiLambdaWithCache instead. This will be removed in a future release.
8
- *
9
- * @category cdk-utils.graphql-api-lambda-with-cache
10
- * @subcategory construct
11
8
  * @classdesc Provides a construct to create and deploy a Graphql API as Lambda with Caching
12
9
  *
13
10
  * <b>Architecture</b><br/> ![Architecture](./GraphQLApiLambda.jpg)
14
- *
15
11
  * @example
16
12
  * import { GraphQlApiLambdaWithCacheProps } '@gradientedge/cdk-utils'
17
13
  * import { Construct } from 'constructs'
@@ -24,7 +20,6 @@ import { GraphQlApiLambdaWithCacheProps } from './types';
24
20
  * this.initResources()
25
21
  * }
26
22
  * }
27
- * @mixin
28
23
  */
29
24
  export declare class GraphQLApiLambdaWithCache extends GraphQLApiLambda {
30
25
  props: GraphQlApiLambdaWithCacheProps;
@@ -37,32 +32,26 @@ export declare class GraphQLApiLambdaWithCache extends GraphQLApiLambda {
37
32
  protected initResources(): void;
38
33
  /**
39
34
  * Create VPC
40
- * @protected
41
35
  */
42
36
  protected setVpc(): void;
43
37
  /**
44
38
  * Resolve Security Group
45
- * @protected
46
39
  */
47
40
  protected setSecurityGroup(): void;
48
41
  /**
49
42
  * Create ElastiCache
50
- * @protected
51
43
  */
52
44
  protected createElastiCache(): void;
53
45
  /**
54
46
  * Create Lambda Role
55
- * @protected
56
47
  */
57
48
  protected createLambdaRole(): void;
58
49
  /**
59
50
  * @summary Method to create environment variables for GraphQL Lambda function
60
- * @protected
61
51
  */
62
52
  protected createLambdaEnvironment(): void;
63
53
  /**
64
54
  * @summary Method to create lambda function for GraphQL API
65
- * @protected
66
55
  */
67
56
  protected createLambdaFunction(): void;
68
57
  }
@@ -31,13 +31,9 @@ const __1 = require("..");
31
31
  const utils = __importStar(require("../../utils"));
32
32
  /**
33
33
  * @deprecated Use RestApiLambdaWithCache instead. This will be removed in a future release.
34
- *
35
- * @category cdk-utils.graphql-api-lambda-with-cache
36
- * @subcategory construct
37
34
  * @classdesc Provides a construct to create and deploy a Graphql API as Lambda with Caching
38
35
  *
39
36
  * <b>Architecture</b><br/> ![Architecture](./GraphQLApiLambda.jpg)
40
- *
41
37
  * @example
42
38
  * import { GraphQlApiLambdaWithCacheProps } '@gradientedge/cdk-utils'
43
39
  * import { Construct } from 'constructs'
@@ -50,7 +46,6 @@ const utils = __importStar(require("../../utils"));
50
46
  * this.initResources()
51
47
  * }
52
48
  * }
53
- * @mixin
54
49
  */
55
50
  class GraphQLApiLambdaWithCache extends __1.GraphQLApiLambda {
56
51
  /* graphql restApi props */
@@ -74,7 +69,6 @@ class GraphQLApiLambdaWithCache extends __1.GraphQLApiLambda {
74
69
  }
75
70
  /**
76
71
  * Create VPC
77
- * @protected
78
72
  */
79
73
  setVpc() {
80
74
  if (this.props.useExistingVpc) {
@@ -86,7 +80,6 @@ class GraphQLApiLambdaWithCache extends __1.GraphQLApiLambda {
86
80
  }
87
81
  /**
88
82
  * Resolve Security Group
89
- * @protected
90
83
  */
91
84
  setSecurityGroup() {
92
85
  if (this.props.securityGroupExportName) {
@@ -103,14 +96,12 @@ class GraphQLApiLambdaWithCache extends __1.GraphQLApiLambda {
103
96
  }
104
97
  /**
105
98
  * Create ElastiCache
106
- * @protected
107
99
  */
108
100
  createElastiCache() {
109
101
  this.graphQLElastiCache = this.elasticacheManager.createReplicatedElastiCache(`${this.id}-elasticache`, this, this.props.graphQLElastiCache, this.graphQLVpc.privateSubnets.map(subnet => subnet.subnetId), [this.graphQLSecurityGroup.securityGroupId]);
110
102
  }
111
103
  /**
112
104
  * Create Lambda Role
113
- * @protected
114
105
  */
115
106
  createLambdaRole() {
116
107
  super.createLambdaRole();
@@ -118,18 +109,16 @@ class GraphQLApiLambdaWithCache extends __1.GraphQLApiLambda {
118
109
  }
119
110
  /**
120
111
  * @summary Method to create environment variables for GraphQL Lambda function
121
- * @protected
122
112
  */
123
113
  createLambdaEnvironment() {
124
114
  this.graphQLApiLambdaEnvironment = {
125
- NODE_ENV: this.props.nodeEnv,
126
115
  LOG_LEVEL: this.props.logLevel,
116
+ NODE_ENV: this.props.nodeEnv,
127
117
  TZ: this.props.timezone,
128
118
  };
129
119
  }
130
120
  /**
131
121
  * @summary Method to create lambda function for GraphQL API
132
- * @protected
133
122
  */
134
123
  createLambdaFunction() {
135
124
  this.graphQLApiLambdaFunction = this.lambdaManager.createLambdaFunction(`${this.id}-graphql-server`, this, this.props.graphqlApi, this.graphQLApiLambdaRole, this.graphQLApiLambdaLayers, this.props.graphQLApiSource, this.props.graphQLApiHandler || 'index.handler', this.graphQLApiLambdaEnvironment, this.graphQLVpc, [this.graphQLSecurityGroup], undefined, undefined, this.graphQLVpc);
@@ -3,12 +3,10 @@ import { VpcProps } from 'aws-cdk-lib/aws-ec2';
3
3
  import { ReplicatedElastiCacheProps } from '../../services';
4
4
  /**
5
5
  * @deprecated Use RestApiLambdaWithCacheProps instead. This will be removed in a future release.
6
- * @category cdk-utils.graphql-api-lambda-with-cache
7
- * @subcategory Properties
8
6
  */
9
7
  export interface GraphQlApiLambdaWithCacheProps extends GraphQlApiLambdaProps {
10
- graphQLVpc: VpcProps;
11
8
  graphQLElastiCache: ReplicatedElastiCacheProps;
9
+ graphQLVpc: VpcProps;
12
10
  securityGroupExportName: string;
13
11
  useExistingVpc: boolean;
14
12
  vpcName?: string;
@@ -5,10 +5,7 @@ import * as iam from 'aws-cdk-lib/aws-iam';
5
5
  import * as lambda from 'aws-cdk-lib/aws-lambda';
6
6
  import * as secretsManager from 'aws-cdk-lib/aws-secretsmanager';
7
7
  /**
8
- * @category cdk-utils.lambda-with-iam-access
9
- * @subcategory construct
10
8
  * @classdesc Provides a construct to create a lambda function with IAM access
11
- *
12
9
  * @example
13
10
  * import { LambdaWithIamAccess, LambdaWithIamAccessProps } '@gradientedge/cdk-utils'
14
11
  * import { Construct } from 'constructs'
@@ -21,7 +18,6 @@ import * as secretsManager from 'aws-cdk-lib/aws-secretsmanager';
21
18
  * this.initResources()
22
19
  * }
23
20
  * }
24
- * @mixin
25
21
  */
26
22
  export declare class LambdaWithIamAccess extends CommonConstruct {
27
23
  props: LambdaWithIamAccessProps;
@@ -37,42 +33,34 @@ export declare class LambdaWithIamAccess extends CommonConstruct {
37
33
  constructor(parent: Construct, id: string, props: LambdaWithIamAccessProps);
38
34
  /**
39
35
  * @summary Initialise and provision resources
40
- * @protected
41
36
  */
42
37
  initResources(): void;
43
38
  /**
44
39
  * @summary Method to create iam policy for Lambda function
45
- * @protected
46
40
  */
47
41
  protected createLambdaPolicy(): void;
48
42
  /**
49
43
  * @summary Method to create iam role for Lambda function
50
- * @protected
51
44
  */
52
45
  protected createLambdaRole(): void;
53
46
  /**
54
47
  * @summary Method to create environment variables for Lambda function
55
- * @protected
56
48
  */
57
49
  protected createLambdaEnvironment(): void;
58
50
  /**
59
51
  * @summary Method to create layers for Lambda function
60
- * @protected
61
52
  */
62
53
  protected createLambdaLayers(): void;
63
54
  /**
64
55
  * @summary Method to create lambda function
65
- * @protected
66
56
  */
67
57
  protected createLambdaFunction(): void;
68
58
  /**
69
59
  * @summary Method to create iam user for the lambda function
70
- * @protected
71
60
  */
72
61
  protected createIamUserForLambdaFunction(): void;
73
62
  /**
74
63
  * @summary Method to create iam secret for the lambda function
75
- * @protected
76
64
  */
77
65
  protected createIamSecretForLambdaFunction(): void;
78
66
  }