@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
@@ -28,10 +28,7 @@ const common_1 = require("../../common");
28
28
  const iam = __importStar(require("aws-cdk-lib/aws-iam"));
29
29
  const secretsManager = __importStar(require("aws-cdk-lib/aws-secretsmanager"));
30
30
  /**
31
- * @category cdk-utils.lambda-with-iam-access
32
- * @subcategory construct
33
31
  * @classdesc Provides a construct to create a lambda function with IAM access
34
- *
35
32
  * @example
36
33
  * import { LambdaWithIamAccess, LambdaWithIamAccessProps } '@gradientedge/cdk-utils'
37
34
  * import { Construct } from 'constructs'
@@ -44,7 +41,6 @@ const secretsManager = __importStar(require("aws-cdk-lib/aws-secretsmanager"));
44
41
  * this.initResources()
45
42
  * }
46
43
  * }
47
- * @mixin
48
44
  */
49
45
  class LambdaWithIamAccess extends common_1.CommonConstruct {
50
46
  /* LambdaWithIamAccess props */
@@ -66,7 +62,6 @@ class LambdaWithIamAccess extends common_1.CommonConstruct {
66
62
  }
67
63
  /**
68
64
  * @summary Initialise and provision resources
69
- * @protected
70
65
  */
71
66
  initResources() {
72
67
  this.createLambdaPolicy();
@@ -79,7 +74,6 @@ class LambdaWithIamAccess extends common_1.CommonConstruct {
79
74
  }
80
75
  /**
81
76
  * @summary Method to create iam policy for Lambda function
82
- * @protected
83
77
  */
84
78
  createLambdaPolicy() {
85
79
  this.lambdaPolicy = new iam.PolicyDocument({
@@ -88,25 +82,22 @@ class LambdaWithIamAccess extends common_1.CommonConstruct {
88
82
  }
89
83
  /**
90
84
  * @summary Method to create iam role for Lambda function
91
- * @protected
92
85
  */
93
86
  createLambdaRole() {
94
87
  this.lambdaRole = this.iamManager.createRoleForLambda(`${this.id}-lambda-role`, this, this.lambdaPolicy);
95
88
  }
96
89
  /**
97
90
  * @summary Method to create environment variables for Lambda function
98
- * @protected
99
91
  */
100
92
  createLambdaEnvironment() {
101
93
  this.lambdaEnvironment = {
102
- NODE_ENV: this.props.nodeEnv,
103
94
  LOG_LEVEL: this.props.logLevel,
95
+ NODE_ENV: this.props.nodeEnv,
104
96
  TZ: this.props.timezone,
105
97
  };
106
98
  }
107
99
  /**
108
100
  * @summary Method to create layers for Lambda function
109
- * @protected
110
101
  */
111
102
  createLambdaLayers() {
112
103
  const layers = [];
@@ -119,14 +110,12 @@ class LambdaWithIamAccess extends common_1.CommonConstruct {
119
110
  }
120
111
  /**
121
112
  * @summary Method to create lambda function
122
- * @protected
123
113
  */
124
114
  createLambdaFunction() {
125
115
  this.lambdaFunction = this.lambdaManager.createLambdaFunction(`${this.id}-lambda`, this, this.props.lambda, this.lambdaRole, this.lambdaLayers, this.props.lambdaSource, this.props.lambdaHandler || 'index.handler', this.lambdaEnvironment);
126
116
  }
127
117
  /**
128
118
  * @summary Method to create iam user for the lambda function
129
- * @protected
130
119
  */
131
120
  createIamUserForLambdaFunction() {
132
121
  this.lambdaIamUser = new iam.User(this, `${this.id}-lambda-user`, {
@@ -136,8 +125,8 @@ class LambdaWithIamAccess extends common_1.CommonConstruct {
136
125
  policyName: `${this.id}-policy-${this.props.stage}`,
137
126
  statements: [
138
127
  new iam.PolicyStatement({
139
- resources: [this.lambdaFunction.functionArn],
140
128
  actions: ['lambda:InvokeFunction'],
129
+ resources: [this.lambdaFunction.functionArn],
141
130
  }),
142
131
  ],
143
132
  users: [this.lambdaIamUser],
@@ -148,7 +137,6 @@ class LambdaWithIamAccess extends common_1.CommonConstruct {
148
137
  }
149
138
  /**
150
139
  * @summary Method to create iam secret for the lambda function
151
- * @protected
152
140
  */
153
141
  createIamSecretForLambdaFunction() {
154
142
  this.lambdaUserAccessSecret = new secretsManager.Secret(this, `${this.id}-lambda-user-secret-${this.props.stage}`, this.props.lambdaSecret);
@@ -8,12 +8,9 @@ import { Construct } from 'constructs';
8
8
  import { CommonConstruct } from '../../common';
9
9
  import { RestApiLambdaEnvironment, RestApiLambdaProps } from './types';
10
10
  /**
11
- * @category cdk-utils.rest-api-lambda
12
- * @subcategory construct
13
11
  * @classdesc Provides a construct to create and deploy a RestApi as Lambda
14
12
  *
15
13
  * <b>Architecture</b><br/> ![Architecture](./RestApiLambda.jpg)
16
- *
17
14
  * @example
18
15
  * import { RestApiLambda, RestApiLambdaProps } '@gradientedge/cdk-utils'
19
16
  * import { Construct } from 'constructs'
@@ -26,7 +23,6 @@ import { RestApiLambdaEnvironment, RestApiLambdaProps } from './types';
26
23
  * this.initResources()
27
24
  * }
28
25
  * }
29
- * @mixin
30
26
  */
31
27
  export declare abstract class RestApiLambda extends CommonConstruct {
32
28
  props: RestApiLambdaProps;
@@ -45,74 +41,60 @@ export declare abstract class RestApiLambda extends CommonConstruct {
45
41
  protected constructor(parent: Construct, id: string, props: RestApiLambdaProps);
46
42
  /**
47
43
  * @summary Initialise and provision resources
48
- * @protected
49
44
  */
50
45
  protected initResources(): void;
51
46
  /**
52
47
  * @summary Method to resolve secrets from SecretsManager
53
48
  * - To be implemented in the overriding method in the implementation class
54
- * @protected
55
49
  */
56
50
  protected resolveSecrets(): void;
57
51
  /**
58
52
  * @summary Method to resolve a hosted zone based on domain attributes
59
- * @protected
60
53
  */
61
54
  protected resolveHostedZone(): void;
62
55
  /**
63
56
  * @summary Method to resolve a certificate based on attributes
64
- * @protected
65
57
  */
66
58
  protected resolveCertificate(): void;
67
59
  /**
68
60
  * @summary Method to create iam policy for RestApi Lambda function
69
- * @protected
70
61
  */
71
62
  protected createLambdaPolicy(): void;
72
63
  /**
73
64
  * @summary Method to create iam role for RestApi Lambda function
74
- * @protected
75
65
  */
76
66
  protected createLambdaRole(): void;
77
67
  /**
78
68
  * @summary Method to create environment variables for RestApi Lambda function
79
- * @protected
80
69
  */
81
70
  protected createLambdaEnvironment(): void;
82
71
  /**
83
72
  * @summary Method to create layers for RestApi Lambda function
84
- * @protected
85
73
  */
86
74
  protected createLambdaLayers(): void;
87
75
  /**
88
76
  * @summary Method to create lambda function for RestApi
89
- * @protected
90
77
  */
91
78
  protected createLambdaFunction(): void;
92
79
  /**
93
80
  * @summary Method to create rest restApiLambda for RestApi
94
- * @protected
95
81
  */
96
82
  protected createRestApi(): void;
97
83
  protected abstract createRestApiResources(): void;
98
84
  /**
99
85
  * @summary Method to create custom restApiLambda domain for RestApi
100
- * @protected
101
86
  */
102
87
  protected createApiDomain(): void;
103
88
  /**
104
89
  * @summary Method to create base path mappings for RestApi
105
- * @protected
106
90
  */
107
91
  protected createApiBasePathMapping(): void;
108
92
  /**
109
93
  * @summary Method to create route53 records for RestApi
110
- * @protected
111
94
  */
112
95
  protected createApiRouteAssets(): void;
113
96
  /**
114
97
  * @summary Method to deploy the changes to the RestApi
115
- * @protected
116
98
  */
117
99
  protected createRestApiDeployment(): void;
118
100
  }
@@ -28,12 +28,9 @@ const apig = __importStar(require("aws-cdk-lib/aws-apigateway"));
28
28
  const iam = __importStar(require("aws-cdk-lib/aws-iam"));
29
29
  const common_1 = require("../../common");
30
30
  /**
31
- * @category cdk-utils.rest-api-lambda
32
- * @subcategory construct
33
31
  * @classdesc Provides a construct to create and deploy a RestApi as Lambda
34
32
  *
35
33
  * <b>Architecture</b><br/> ![Architecture](./RestApiLambda.jpg)
36
- *
37
34
  * @example
38
35
  * import { RestApiLambda, RestApiLambdaProps } '@gradientedge/cdk-utils'
39
36
  * import { Construct } from 'constructs'
@@ -46,7 +43,6 @@ const common_1 = require("../../common");
46
43
  * this.initResources()
47
44
  * }
48
45
  * }
49
- * @mixin
50
46
  */
51
47
  class RestApiLambda extends common_1.CommonConstruct {
52
48
  /* restApiLambda props */
@@ -71,7 +67,6 @@ class RestApiLambda extends common_1.CommonConstruct {
71
67
  }
72
68
  /**
73
69
  * @summary Initialise and provision resources
74
- * @protected
75
70
  */
76
71
  initResources() {
77
72
  this.resolveSecrets();
@@ -92,21 +87,18 @@ class RestApiLambda extends common_1.CommonConstruct {
92
87
  /**
93
88
  * @summary Method to resolve secrets from SecretsManager
94
89
  * - To be implemented in the overriding method in the implementation class
95
- * @protected
96
90
  */
97
91
  resolveSecrets() {
98
92
  this.applicationSecrets = [];
99
93
  }
100
94
  /**
101
95
  * @summary Method to resolve a hosted zone based on domain attributes
102
- * @protected
103
96
  */
104
97
  resolveHostedZone() {
105
98
  this.restApiHostedZone = this.route53Manager.withHostedZoneFromFullyQualifiedDomainName(`${this.id}-hosted-zone`, this, this.props.useExistingHostedZone);
106
99
  }
107
100
  /**
108
101
  * @summary Method to resolve a certificate based on attributes
109
- * @protected
110
102
  */
111
103
  resolveCertificate() {
112
104
  if (this.props.restApiCertificate.useExistingCertificate &&
@@ -118,7 +110,6 @@ class RestApiLambda extends common_1.CommonConstruct {
118
110
  }
119
111
  /**
120
112
  * @summary Method to create iam policy for RestApi Lambda function
121
- * @protected
122
113
  */
123
114
  createLambdaPolicy() {
124
115
  this.restApiLambdaPolicy = new iam.PolicyDocument({
@@ -127,25 +118,22 @@ class RestApiLambda extends common_1.CommonConstruct {
127
118
  }
128
119
  /**
129
120
  * @summary Method to create iam role for RestApi Lambda function
130
- * @protected
131
121
  */
132
122
  createLambdaRole() {
133
123
  this.restApiLambdaRole = this.iamManager.createRoleForLambda(`${this.id}-lambda-role`, this, this.restApiLambdaPolicy);
134
124
  }
135
125
  /**
136
126
  * @summary Method to create environment variables for RestApi Lambda function
137
- * @protected
138
127
  */
139
128
  createLambdaEnvironment() {
140
129
  this.restApiLambdaEnvironment = {
141
- NODE_ENV: this.props.nodeEnv,
142
130
  LOG_LEVEL: this.props.logLevel,
131
+ NODE_ENV: this.props.nodeEnv,
143
132
  TZ: this.props.timezone,
144
133
  };
145
134
  }
146
135
  /**
147
136
  * @summary Method to create layers for RestApi Lambda function
148
- * @protected
149
137
  */
150
138
  createLambdaLayers() {
151
139
  const layers = [];
@@ -158,21 +146,18 @@ class RestApiLambda extends common_1.CommonConstruct {
158
146
  }
159
147
  /**
160
148
  * @summary Method to create lambda function for RestApi
161
- * @protected
162
149
  */
163
150
  createLambdaFunction() {
164
151
  this.restApiLambdaFunction = this.lambdaManager.createLambdaFunction(`${this.id}-restapi-server`, this, this.props.restApiLambda, this.restApiLambdaRole, this.restApiLambdaLayers, this.props.restApiSource, this.props.restApiHandler || 'index.handler', this.restApiLambdaEnvironment);
165
152
  }
166
153
  /**
167
154
  * @summary Method to create rest restApiLambda for RestApi
168
- * @protected
169
155
  */
170
156
  createRestApi() {
171
157
  this.restApi = this.apiManager.createLambdaRestApi(`${this.id}-lambda-rest-api`, this, this.props.restApi, this.restApiLambdaFunction);
172
158
  }
173
159
  /**
174
160
  * @summary Method to create custom restApiLambda domain for RestApi
175
- * @protected
176
161
  */
177
162
  createApiDomain() {
178
163
  this.restApiDomain = this.apiManager.createApiDomain(`${this.id}-api-domain`, this, this.isProductionStage() || this.props.skipStageForARecords
@@ -181,7 +166,6 @@ class RestApiLambda extends common_1.CommonConstruct {
181
166
  }
182
167
  /**
183
168
  * @summary Method to create base path mappings for RestApi
184
- * @protected
185
169
  */
186
170
  createApiBasePathMapping() {
187
171
  const apiRootPaths = this.props.apiRootPaths;
@@ -205,14 +189,12 @@ class RestApiLambda extends common_1.CommonConstruct {
205
189
  }
206
190
  /**
207
191
  * @summary Method to create route53 records for RestApi
208
- * @protected
209
192
  */
210
193
  createApiRouteAssets() {
211
194
  this.route53Manager.createApiGatewayARecord(`${this.id}-custom-domain-a-record`, this, this.props.apiSubDomain, this.restApiDomain, this.restApiHostedZone, this.props.skipStageForARecords);
212
195
  }
213
196
  /**
214
197
  * @summary Method to deploy the changes to the RestApi
215
- * @protected
216
198
  */
217
199
  createRestApiDeployment() {
218
200
  this.apiManager.createApiDeployment(`${this.id}-deployment`, this, this.restApi);
@@ -1,28 +1,23 @@
1
- import { AcmProps, LambdaEnvironment, LambdaProps } from '../../services';
1
+ import { AcmProps, LambdaEnvironment, LambdaProps, LambdaRestApiProps } from '../../services';
2
2
  import { CommonStackProps } from '../../common';
3
- import { LambdaRestApiProps } from 'aws-cdk-lib/aws-apigateway';
4
3
  import { AssetCode } from 'aws-cdk-lib/aws-lambda';
5
4
  /**
6
- * @category cdk-utils.rest-api-lambda
7
- * @subcategory Types
8
5
  */
9
6
  export interface RestApiLambdaEnvironment extends LambdaEnvironment {
10
7
  }
11
8
  /**
12
- * @category cdk-utils.rest-api-lambda
13
- * @subcategory Properties
14
9
  */
15
10
  export interface RestApiLambdaProps extends CommonStackProps {
16
11
  apiRootPaths?: string[];
17
12
  apiSubDomain: string;
18
- restApiCertificate: AcmProps;
13
+ logLevel: string;
14
+ nodeEnv: string;
19
15
  restApi: LambdaRestApiProps;
20
- restApiLambdaLayerSources?: AssetCode[];
16
+ restApiCertificate: AcmProps;
21
17
  restApiHandler: string;
22
- restApiSource: AssetCode;
23
18
  restApiLambda: LambdaProps;
24
- useExistingHostedZone: boolean;
25
- nodeEnv: string;
26
- logLevel: string;
19
+ restApiLambdaLayerSources?: AssetCode[];
20
+ restApiSource: AssetCode;
27
21
  timezone: string;
22
+ useExistingHostedZone: boolean;
28
23
  }
@@ -4,13 +4,9 @@ import { Construct } from 'constructs';
4
4
  import { RestApiLambda } from '..';
5
5
  import { RestApiLambdaWithCacheProps } from './types';
6
6
  /**
7
- * @stability stable
8
- * @category cdk-utils.rest-api-lambda-with-cache
9
- * @subcategory construct
10
7
  * @classdesc Provides a construct to create and deploy a RestApi API as Lambda with Caching
11
8
  *
12
9
  * <b>Architecture</b><br/> ![Architecture](./RestApiLambda.jpg)
13
- *
14
10
  * @example
15
11
  * import { RestApiLambdaWithCacheProps } '@gradientedge/cdk-utils'
16
12
  * import { Construct } from 'constructs'
@@ -23,7 +19,6 @@ import { RestApiLambdaWithCacheProps } from './types';
23
19
  * this.initResources()
24
20
  * }
25
21
  * }
26
- * @mixin
27
22
  */
28
23
  export declare abstract class RestApiLambdaWithCache extends RestApiLambda {
29
24
  props: RestApiLambdaWithCacheProps;
@@ -36,32 +31,26 @@ export declare abstract class RestApiLambdaWithCache extends RestApiLambda {
36
31
  protected initResources(): void;
37
32
  /**
38
33
  * Create VPC
39
- * @protected
40
34
  */
41
35
  protected resolveVpc(): void;
42
36
  /**
43
37
  * Resolve Security Group
44
- * @protected
45
38
  */
46
39
  protected resolveSecurityGroup(): void;
47
40
  /**
48
41
  * Create ElastiCache
49
- * @protected
50
42
  */
51
43
  protected createElastiCache(): void;
52
44
  /**
53
45
  * Create Lambda Role
54
- * @protected
55
46
  */
56
47
  protected createLambdaRole(): void;
57
48
  /**
58
49
  * @summary Method to create environment variables for RestApi Lambda function
59
- * @protected
60
50
  */
61
51
  protected createLambdaEnvironment(): void;
62
52
  /**
63
53
  * @summary Method to create lambda function for RestApi API
64
- * @protected
65
54
  */
66
55
  protected createLambdaFunction(): void;
67
56
  }
@@ -30,13 +30,9 @@ const iam = __importStar(require("aws-cdk-lib/aws-iam"));
30
30
  const __1 = require("..");
31
31
  const utils = __importStar(require("../../utils"));
32
32
  /**
33
- * @stability stable
34
- * @category cdk-utils.rest-api-lambda-with-cache
35
- * @subcategory construct
36
33
  * @classdesc Provides a construct to create and deploy a RestApi API as Lambda with Caching
37
34
  *
38
35
  * <b>Architecture</b><br/> ![Architecture](./RestApiLambda.jpg)
39
- *
40
36
  * @example
41
37
  * import { RestApiLambdaWithCacheProps } '@gradientedge/cdk-utils'
42
38
  * import { Construct } from 'constructs'
@@ -49,7 +45,6 @@ const utils = __importStar(require("../../utils"));
49
45
  * this.initResources()
50
46
  * }
51
47
  * }
52
- * @mixin
53
48
  */
54
49
  class RestApiLambdaWithCache extends __1.RestApiLambda {
55
50
  /* restApiLambdaWithCache props */
@@ -73,7 +68,6 @@ class RestApiLambdaWithCache extends __1.RestApiLambda {
73
68
  }
74
69
  /**
75
70
  * Create VPC
76
- * @protected
77
71
  */
78
72
  resolveVpc() {
79
73
  if (this.props.useExistingVpc) {
@@ -85,7 +79,6 @@ class RestApiLambdaWithCache extends __1.RestApiLambda {
85
79
  }
86
80
  /**
87
81
  * Resolve Security Group
88
- * @protected
89
82
  */
90
83
  resolveSecurityGroup() {
91
84
  if (!this.props.restApiCache) {
@@ -105,7 +98,6 @@ class RestApiLambdaWithCache extends __1.RestApiLambda {
105
98
  }
106
99
  /**
107
100
  * Create ElastiCache
108
- * @protected
109
101
  */
110
102
  createElastiCache() {
111
103
  if (!this.props.restApiCache) {
@@ -113,19 +105,18 @@ class RestApiLambdaWithCache extends __1.RestApiLambda {
113
105
  }
114
106
  this.restApiCache = this.elasticacheManager.createReplicatedElastiCache(`${this.id}-elasticache`, this, this.props.restApiCache, this.restApivpc.privateSubnets.map(subnet => subnet.subnetId), [this.restApiSecurityGroup.securityGroupId]);
115
107
  this.ssmManager.writeStringToParameters(`${this.id}-elasticache-endpoint-address`, this, {
116
- parameterName: `${this.id}-elasticache-endpoint-address`,
117
108
  description: `Elasticache address to use by applications`,
109
+ parameterName: `${this.id}-elasticache-endpoint-address`,
118
110
  stringValue: this.restApiCache.attrConfigurationEndPointAddress,
119
111
  });
120
112
  this.ssmManager.writeStringToParameters(`${this.id}-elasticache-endpoint-port`, this, {
121
- parameterName: `${this.id}-elasticache-endpoint-port`,
122
113
  description: `Elasticache port to use by applications`,
114
+ parameterName: `${this.id}-elasticache-endpoint-port`,
123
115
  stringValue: this.restApiCache.attrConfigurationEndPointPort,
124
116
  });
125
117
  }
126
118
  /**
127
119
  * Create Lambda Role
128
- * @protected
129
120
  */
130
121
  createLambdaRole() {
131
122
  super.createLambdaRole();
@@ -133,18 +124,16 @@ class RestApiLambdaWithCache extends __1.RestApiLambda {
133
124
  }
134
125
  /**
135
126
  * @summary Method to create environment variables for RestApi Lambda function
136
- * @protected
137
127
  */
138
128
  createLambdaEnvironment() {
139
129
  this.restApiLambdaEnvironment = {
140
- NODE_ENV: this.props.nodeEnv,
141
130
  LOG_LEVEL: this.props.logLevel,
131
+ NODE_ENV: this.props.nodeEnv,
142
132
  TZ: this.props.timezone,
143
133
  };
144
134
  }
145
135
  /**
146
136
  * @summary Method to create lambda function for RestApi API
147
- * @protected
148
137
  */
149
138
  createLambdaFunction() {
150
139
  this.restApiLambdaFunction = this.lambdaManager.createLambdaFunction(`${this.id}-restapi-server`, this, this.props.restApiLambda, this.restApiLambdaRole, this.restApiLambdaLayers, this.props.restApiSource, this.props.restApiHandler || 'index.handler', this.restApiLambdaEnvironment, this.restApivpc, [this.restApiSecurityGroup], undefined, undefined, this.restApivpc);
@@ -2,12 +2,10 @@ import { RestApiLambdaProps } from '../rest-api-lambda';
2
2
  import { VpcProps } from 'aws-cdk-lib/aws-ec2';
3
3
  import { ReplicatedElastiCacheProps } from '../../services';
4
4
  /**
5
- * @category cdk-utils.rest-api-lambda-with-cache
6
- * @subcategory Properties
7
5
  */
8
6
  export interface RestApiLambdaWithCacheProps extends RestApiLambdaProps {
9
- restApiVpc: VpcProps;
10
7
  restApiCache: ReplicatedElastiCacheProps;
8
+ restApiVpc: VpcProps;
11
9
  securityGroupExportName: string;
12
10
  useExistingVpc: boolean;
13
11
  vpcName?: string;
@@ -13,11 +13,7 @@ import { Construct } from 'constructs';
13
13
  import { CommonConstruct } from '../../common';
14
14
  import { SiteWithEcsBackendProps } from './types';
15
15
  /**
16
- * @stability stable
17
- * @category cdk-utils.site-with-ecs-backend
18
- * @subcategory construct
19
16
  * @classdesc Provides a construct to create and deploy a site hosted with an clustered ECS/ELB backend
20
- *
21
17
  * @example
22
18
  * import { SiteWithEcsBackend, SiteWithEcsBackendProps } '@gradientedge/cdk-utils'
23
19
  * import { Construct } from 'constructs'
@@ -30,7 +26,6 @@ import { SiteWithEcsBackendProps } from './types';
30
26
  * this.initResources()
31
27
  * }
32
28
  * }
33
- * @mixin
34
29
  */
35
30
  export declare class SiteWithEcsBackend extends CommonConstruct {
36
31
  props: SiteWithEcsBackendProps;
@@ -66,104 +61,84 @@ export declare class SiteWithEcsBackend extends CommonConstruct {
66
61
  constructor(parent: Construct, id: string, props: SiteWithEcsBackendProps);
67
62
  /**
68
63
  * @summary Initialise and provision resources
69
- * @protected
70
64
  */
71
65
  protected initResources(): void;
72
66
  /**
73
67
  * @summary Method to resolve a hosted zone based on domain attributes
74
- * @protected
75
68
  */
76
69
  protected resolveHostedZone(): void;
77
70
  /**
78
71
  * @summary Method to resolve a certificate based on attributes
79
- * @protected
80
72
  */
81
73
  protected resolveCertificate(): void;
82
74
  /**
83
75
  * @summary Method to resolve secrets from SecretsManager
84
76
  * - To be implemented in the overriding method in the implementation class
85
- * @protected
86
77
  */
87
78
  protected resolveSiteSecrets(): void;
88
79
  /**
89
80
  * @summary Method to resolve site domain names
90
- * @protected
91
81
  */
92
82
  protected resolveSiteDomainNames(): void;
93
83
  /**
94
84
  * Create VPC
95
- * @protected
96
85
  */
97
86
  protected createVpc(): void;
98
87
  /**
99
88
  * @summary Method to create iam policy for ECS Task
100
- * @protected
101
89
  */
102
90
  protected createEcsPolicy(): void;
103
91
  /**
104
92
  * @summary Method to create iam role for ECS Task
105
- * @protected
106
93
  */
107
94
  protected createEcsRole(): void;
108
95
  /**
109
96
  * @summary Method to create environment variables used by ECS task
110
- * @protected
111
97
  */
112
98
  protected createEcsEnvironment(): void;
113
99
  /**
114
100
  * Method to create an ECS cluster
115
- * @protected
116
101
  */
117
102
  protected createEcsCluster(): void;
118
103
  /**
119
104
  * Method to create log group used by ECS task
120
- * @protected
121
105
  */
122
106
  protected createEcsLogGroup(): void;
123
107
  /**
124
108
  * Method to create docker build arguments for ECS Image step
125
- * @protected
126
109
  */
127
110
  protected createEcsBuildArgs(): void;
128
111
  /**
129
112
  * Method to create container image for ECS task
130
- * @protected
131
113
  */
132
114
  protected createEcsContainerImage(): void;
133
115
  /**
134
116
  * Method to create Application Loadbalanced ECS Fargate Service
135
- * @protected
136
117
  */
137
118
  protected createEcsService(): void;
138
119
  /**
139
120
  * Method to create log bucket for site distribution
140
- * @protected
141
121
  */
142
122
  protected createSiteLogBucket(): void;
143
123
  protected createSiteOrigin(): void;
144
124
  /**
145
125
  * @summary Method to create a site cloudfront function
146
- * @protected
147
126
  */
148
127
  protected createSiteCloudfrontFunction(): void;
149
128
  /**
150
129
  * @summary Method to create a site cloudfront function associations
151
- * @protected
152
130
  */
153
131
  protected resolveSiteFunctionAssociations(): void;
154
132
  /**
155
133
  * Method to create Site distribution
156
- * @protected
157
134
  */
158
135
  protected createDistribution(): void;
159
136
  /**
160
137
  * Method to create Route53 records for distribution
161
- * @protected
162
138
  */
163
139
  protected createNetworkMappings(): void;
164
140
  /**
165
141
  * Method to invalidation the cloudfront distribution cache after a deployment
166
- * @protected
167
142
  */
168
143
  protected invalidateDistributionCache(): void;
169
144
  }