@gradientedge/cdk-utils 8.91.0 → 8.92.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/.eslintrc.json +40 -0
  2. package/app/api-destined-function/src/lib/lambda.ts +6 -6
  3. package/dist/app/api-destined-function/src/lib/lambda.d.ts +6 -6
  4. package/dist/app/api-destined-function/src/lib/lambda.js +6 -6
  5. package/dist/lib/lambda.d.ts +6 -6
  6. package/dist/lib/lambda.js +6 -6
  7. package/dist/lib/lambda.js.map +1 -1
  8. package/dist/src/lib/common/construct.d.ts +4 -7
  9. package/dist/src/lib/common/construct.js +4 -7
  10. package/dist/src/lib/common/stack.d.ts +9 -13
  11. package/dist/src/lib/common/stack.js +9 -13
  12. package/dist/src/lib/common/types.d.ts +0 -2
  13. package/dist/src/lib/construct/api-to-eventbridge-target/api.d.ts +0 -3
  14. package/dist/src/lib/construct/api-to-eventbridge-target/api.js +0 -3
  15. package/dist/src/lib/construct/api-to-eventbridge-target/event.d.ts +0 -3
  16. package/dist/src/lib/construct/api-to-eventbridge-target/event.js +0 -3
  17. package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +0 -27
  18. package/dist/src/lib/construct/api-to-eventbridge-target/main.js +41 -68
  19. package/dist/src/lib/construct/api-to-eventbridge-target/types.d.ts +13 -25
  20. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +0 -3
  21. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.js +0 -3
  22. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.d.ts +0 -37
  23. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.js +44 -81
  24. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/types.d.ts +1 -5
  25. package/dist/src/lib/construct/api-to-lambda-target/api.d.ts +0 -3
  26. package/dist/src/lib/construct/api-to-lambda-target/api.js +0 -3
  27. package/dist/src/lib/construct/api-to-lambda-target/main.d.ts +0 -14
  28. package/dist/src/lib/construct/api-to-lambda-target/main.js +7 -21
  29. package/dist/src/lib/construct/api-to-lambda-target/types.d.ts +7 -13
  30. package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +0 -18
  31. package/dist/src/lib/construct/graphql-api-lambda/main.js +1 -19
  32. package/dist/src/lib/construct/graphql-api-lambda/types.d.ts +4 -8
  33. package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.d.ts +0 -11
  34. package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.js +1 -12
  35. package/dist/src/lib/construct/graphql-api-lambda-with-cache/types.d.ts +1 -3
  36. package/dist/src/lib/construct/lambda-with-iam-access/main.d.ts +0 -12
  37. package/dist/src/lib/construct/lambda-with-iam-access/main.js +2 -14
  38. package/dist/src/lib/construct/rest-api-lambda/main.d.ts +0 -18
  39. package/dist/src/lib/construct/rest-api-lambda/main.js +1 -19
  40. package/dist/src/lib/construct/rest-api-lambda/types.d.ts +6 -10
  41. package/dist/src/lib/construct/rest-api-lambda-with-cache/main.d.ts +0 -11
  42. package/dist/src/lib/construct/rest-api-lambda-with-cache/main.js +3 -14
  43. package/dist/src/lib/construct/rest-api-lambda-with-cache/types.d.ts +1 -3
  44. package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +0 -25
  45. package/dist/src/lib/construct/site-with-ecs-backend/main.js +32 -52
  46. package/dist/src/lib/construct/site-with-ecs-backend/types.d.ts +10 -11
  47. package/dist/src/lib/construct/static-asset-deployment/main.d.ts +0 -8
  48. package/dist/src/lib/construct/static-asset-deployment/main.js +0 -8
  49. package/dist/src/lib/construct/static-asset-deployment/types.d.ts +1 -1
  50. package/dist/src/lib/construct/static-site/main.d.ts +0 -17
  51. package/dist/src/lib/construct/static-site/main.js +1 -18
  52. package/dist/src/lib/construct/static-site/types.d.ts +9 -11
  53. package/dist/src/lib/services/aws/api-gateway/main.d.ts +21 -25
  54. package/dist/src/lib/services/aws/api-gateway/main.js +42 -46
  55. package/dist/src/lib/services/aws/api-gateway/types.d.ts +0 -2
  56. package/dist/src/lib/services/aws/appconfig/constants.d.ts +0 -6
  57. package/dist/src/lib/services/aws/appconfig/constants.js +26 -32
  58. package/dist/src/lib/services/aws/appconfig/main.d.ts +16 -19
  59. package/dist/src/lib/services/aws/appconfig/main.js +19 -22
  60. package/dist/src/lib/services/aws/appconfig/types.d.ts +1 -3
  61. package/dist/src/lib/services/aws/certificate-manager/main.d.ts +5 -10
  62. package/dist/src/lib/services/aws/certificate-manager/main.js +5 -10
  63. package/dist/src/lib/services/aws/certificate-manager/types.d.ts +3 -5
  64. package/dist/src/lib/services/aws/cloudfront/main.d.ts +41 -47
  65. package/dist/src/lib/services/aws/cloudfront/main.js +56 -62
  66. package/dist/src/lib/services/aws/cloudfront/types.d.ts +1 -7
  67. package/dist/src/lib/services/aws/cloudtrail/main.d.ts +8 -12
  68. package/dist/src/lib/services/aws/cloudtrail/main.js +8 -12
  69. package/dist/src/lib/services/aws/cloudtrail/types.d.ts +0 -2
  70. package/dist/src/lib/services/aws/cloudwatch/logs.d.ts +11 -15
  71. package/dist/src/lib/services/aws/cloudwatch/logs.js +15 -19
  72. package/dist/src/lib/services/aws/cloudwatch/main.d.ts +80 -84
  73. package/dist/src/lib/services/aws/cloudwatch/main.js +116 -122
  74. package/dist/src/lib/services/aws/cloudwatch/types.d.ts +20 -42
  75. package/dist/src/lib/services/aws/codebuild/main.d.ts +0 -4
  76. package/dist/src/lib/services/aws/codebuild/main.js +3 -7
  77. package/dist/src/lib/services/aws/dynamodb/main.d.ts +3 -7
  78. package/dist/src/lib/services/aws/dynamodb/main.js +13 -17
  79. package/dist/src/lib/services/aws/dynamodb/types.d.ts +0 -2
  80. package/dist/src/lib/services/aws/elastic-container-registry/main.d.ts +3 -7
  81. package/dist/src/lib/services/aws/elastic-container-registry/main.js +3 -7
  82. package/dist/src/lib/services/aws/elastic-container-service/main.d.ts +19 -23
  83. package/dist/src/lib/services/aws/elastic-container-service/main.js +35 -39
  84. package/dist/src/lib/services/aws/elastic-container-service/types.d.ts +1 -9
  85. package/dist/src/lib/services/aws/elastic-file-system/main.d.ts +9 -13
  86. package/dist/src/lib/services/aws/elastic-file-system/main.js +14 -18
  87. package/dist/src/lib/services/aws/elastic-file-system/types.d.ts +1 -5
  88. package/dist/src/lib/services/aws/elastic-kubernetes-service/main.d.ts +5 -9
  89. package/dist/src/lib/services/aws/elastic-kubernetes-service/main.js +8 -12
  90. package/dist/src/lib/services/aws/elastic-kubernetes-service/types.d.ts +1 -3
  91. package/dist/src/lib/services/aws/elasticache/main.d.ts +14 -18
  92. package/dist/src/lib/services/aws/elasticache/main.js +35 -39
  93. package/dist/src/lib/services/aws/elasticache/types.d.ts +0 -4
  94. package/dist/src/lib/services/aws/eventbridge/main.d.ts +25 -29
  95. package/dist/src/lib/services/aws/eventbridge/main.js +34 -38
  96. package/dist/src/lib/services/aws/eventbridge/target.d.ts +6 -9
  97. package/dist/src/lib/services/aws/eventbridge/target.js +8 -10
  98. package/dist/src/lib/services/aws/eventbridge/types.d.ts +2 -10
  99. package/dist/src/lib/services/aws/evidently/main.d.ts +15 -19
  100. package/dist/src/lib/services/aws/evidently/main.js +19 -23
  101. package/dist/src/lib/services/aws/evidently/types.d.ts +0 -10
  102. package/dist/src/lib/services/aws/identity-access-management/main.d.ts +66 -70
  103. package/dist/src/lib/services/aws/identity-access-management/main.js +97 -101
  104. package/dist/src/lib/services/aws/key-management-service/main.d.ts +3 -7
  105. package/dist/src/lib/services/aws/key-management-service/main.js +6 -10
  106. package/dist/src/lib/services/aws/key-management-service/types.d.ts +0 -2
  107. package/dist/src/lib/services/aws/lambda/main.d.ts +42 -47
  108. package/dist/src/lib/services/aws/lambda/main.js +64 -69
  109. package/dist/src/lib/services/aws/lambda/types.d.ts +6 -16
  110. package/dist/src/lib/services/aws/route53/main.d.ts +17 -21
  111. package/dist/src/lib/services/aws/route53/main.js +19 -23
  112. package/dist/src/lib/services/aws/route53/types.d.ts +0 -2
  113. package/dist/src/lib/services/aws/secrets-manager/main.d.ts +6 -19
  114. package/dist/src/lib/services/aws/secrets-manager/main.js +6 -25
  115. package/dist/src/lib/services/aws/simple-notification-service/main.d.ts +8 -12
  116. package/dist/src/lib/services/aws/simple-notification-service/main.js +10 -14
  117. package/dist/src/lib/services/aws/simple-notification-service/types.d.ts +0 -2
  118. package/dist/src/lib/services/aws/simple-queue-service/main.d.ts +11 -15
  119. package/dist/src/lib/services/aws/simple-queue-service/main.js +19 -23
  120. package/dist/src/lib/services/aws/simple-queue-service/types.d.ts +4 -6
  121. package/dist/src/lib/services/aws/simple-storage-service/main.d.ts +24 -32
  122. package/dist/src/lib/services/aws/simple-storage-service/main.js +32 -40
  123. package/dist/src/lib/services/aws/simple-storage-service/types.d.ts +2 -8
  124. package/dist/src/lib/services/aws/step-function/main.d.ts +55 -59
  125. package/dist/src/lib/services/aws/step-function/main.js +91 -95
  126. package/dist/src/lib/services/aws/step-function/types.d.ts +0 -32
  127. package/dist/src/lib/services/aws/systems-manager/main.d.ts +10 -16
  128. package/dist/src/lib/services/aws/systems-manager/main.js +13 -19
  129. package/dist/src/lib/services/aws/systems-manager/types.d.ts +0 -2
  130. package/dist/src/lib/services/aws/virtual-private-cloud/main.d.ts +9 -12
  131. package/dist/src/lib/services/aws/virtual-private-cloud/main.js +10 -16
  132. package/dist/src/lib/services/aws/web-application-firewall/main.d.ts +6 -10
  133. package/dist/src/lib/services/aws/web-application-firewall/main.js +12 -16
  134. package/dist/src/lib/services/aws/web-application-firewall/types.d.ts +0 -4
  135. package/dist/src/lib/types/aws/index.d.ts +0 -2
  136. package/dist/src/lib/utils/aws/index.d.ts +6 -9
  137. package/dist/src/lib/utils/aws/index.js +7 -10
  138. package/dist/src/lib/utils/index.d.ts +6 -13
  139. package/dist/src/lib/utils/index.js +4 -12
  140. package/package.json +1 -1
  141. package/src/lib/common/construct.ts +4 -7
  142. package/src/lib/common/stack.ts +9 -13
  143. package/src/lib/common/types.ts +0 -2
  144. package/src/lib/construct/api-to-eventbridge-target/api.ts +0 -3
  145. package/src/lib/construct/api-to-eventbridge-target/event.ts +0 -3
  146. package/src/lib/construct/api-to-eventbridge-target/main.ts +41 -68
  147. package/src/lib/construct/api-to-eventbridge-target/types.ts +13 -25
  148. package/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +0 -3
  149. package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +44 -81
  150. package/src/lib/construct/api-to-eventbridge-target-with-sns/types.ts +1 -5
  151. package/src/lib/construct/api-to-lambda-target/api.ts +0 -3
  152. package/src/lib/construct/api-to-lambda-target/main.ts +7 -21
  153. package/src/lib/construct/api-to-lambda-target/types.ts +7 -13
  154. package/src/lib/construct/graphql-api-lambda/main.ts +1 -19
  155. package/src/lib/construct/graphql-api-lambda/types.ts +4 -8
  156. package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +1 -12
  157. package/src/lib/construct/graphql-api-lambda-with-cache/types.ts +1 -3
  158. package/src/lib/construct/lambda-with-iam-access/main.ts +2 -14
  159. package/src/lib/construct/rest-api-lambda/main.ts +1 -19
  160. package/src/lib/construct/rest-api-lambda/types.ts +6 -10
  161. package/src/lib/construct/rest-api-lambda-with-cache/main.ts +3 -14
  162. package/src/lib/construct/rest-api-lambda-with-cache/types.ts +1 -3
  163. package/src/lib/construct/site-with-ecs-backend/main.ts +31 -52
  164. package/src/lib/construct/site-with-ecs-backend/types.ts +10 -11
  165. package/src/lib/construct/static-asset-deployment/main.ts +0 -8
  166. package/src/lib/construct/static-asset-deployment/types.ts +1 -1
  167. package/src/lib/construct/static-site/main.ts +1 -18
  168. package/src/lib/construct/static-site/types.ts +9 -11
  169. package/src/lib/services/aws/api-gateway/main.ts +43 -47
  170. package/src/lib/services/aws/api-gateway/types.ts +0 -2
  171. package/src/lib/services/aws/appconfig/constants.ts +26 -32
  172. package/src/lib/services/aws/appconfig/main.ts +19 -22
  173. package/src/lib/services/aws/appconfig/types.ts +1 -3
  174. package/src/lib/services/aws/certificate-manager/main.ts +5 -10
  175. package/src/lib/services/aws/certificate-manager/types.ts +3 -5
  176. package/src/lib/services/aws/cloudfront/main.ts +56 -62
  177. package/src/lib/services/aws/cloudfront/types.ts +1 -7
  178. package/src/lib/services/aws/cloudtrail/main.ts +8 -12
  179. package/src/lib/services/aws/cloudtrail/types.ts +0 -2
  180. package/src/lib/services/aws/cloudwatch/logs.ts +15 -19
  181. package/src/lib/services/aws/cloudwatch/main.ts +116 -122
  182. package/src/lib/services/aws/cloudwatch/types.ts +20 -42
  183. package/src/lib/services/aws/codebuild/main.ts +3 -7
  184. package/src/lib/services/aws/dynamodb/main.ts +13 -17
  185. package/src/lib/services/aws/dynamodb/types.ts +0 -2
  186. package/src/lib/services/aws/elastic-container-registry/main.ts +3 -7
  187. package/src/lib/services/aws/elastic-container-service/main.ts +35 -39
  188. package/src/lib/services/aws/elastic-container-service/types.ts +1 -9
  189. package/src/lib/services/aws/elastic-file-system/main.ts +14 -18
  190. package/src/lib/services/aws/elastic-file-system/types.ts +1 -5
  191. package/src/lib/services/aws/elastic-kubernetes-service/main.ts +8 -12
  192. package/src/lib/services/aws/elastic-kubernetes-service/types.ts +1 -3
  193. package/src/lib/services/aws/elasticache/main.ts +35 -39
  194. package/src/lib/services/aws/elasticache/types.ts +0 -4
  195. package/src/lib/services/aws/eventbridge/main.ts +34 -38
  196. package/src/lib/services/aws/eventbridge/target.ts +8 -11
  197. package/src/lib/services/aws/eventbridge/types.ts +2 -10
  198. package/src/lib/services/aws/evidently/main.ts +19 -23
  199. package/src/lib/services/aws/evidently/types.ts +0 -10
  200. package/src/lib/services/aws/identity-access-management/main.ts +97 -101
  201. package/src/lib/services/aws/key-management-service/main.ts +6 -10
  202. package/src/lib/services/aws/key-management-service/types.ts +0 -2
  203. package/src/lib/services/aws/lambda/main.ts +64 -69
  204. package/src/lib/services/aws/lambda/types.ts +6 -16
  205. package/src/lib/services/aws/route53/main.ts +19 -23
  206. package/src/lib/services/aws/route53/types.ts +0 -2
  207. package/src/lib/services/aws/secrets-manager/main.ts +6 -28
  208. package/src/lib/services/aws/simple-notification-service/main.ts +10 -14
  209. package/src/lib/services/aws/simple-notification-service/types.ts +0 -2
  210. package/src/lib/services/aws/simple-queue-service/main.ts +19 -23
  211. package/src/lib/services/aws/simple-queue-service/types.ts +4 -6
  212. package/src/lib/services/aws/simple-storage-service/main.ts +32 -40
  213. package/src/lib/services/aws/simple-storage-service/types.ts +2 -8
  214. package/src/lib/services/aws/step-function/main.ts +91 -95
  215. package/src/lib/services/aws/step-function/types.ts +0 -32
  216. package/src/lib/services/aws/systems-manager/main.ts +13 -19
  217. package/src/lib/services/aws/systems-manager/types.ts +0 -2
  218. package/src/lib/services/aws/virtual-private-cloud/main.ts +10 -16
  219. package/src/lib/services/aws/web-application-firewall/main.ts +12 -16
  220. package/src/lib/services/aws/web-application-firewall/types.ts +0 -4
  221. package/src/lib/types/aws/index.ts +0 -2
  222. package/src/lib/utils/aws/index.ts +7 -10
  223. package/src/lib/utils/index.ts +4 -12
@@ -19,8 +19,6 @@ import { ITopic } from 'aws-cdk-lib/aws-sns'
19
19
  import { PolicyDocument, Role } from 'aws-cdk-lib/aws-iam'
20
20
 
21
21
  /**
22
- * @category cdk-utils.api-to-lambda-target
23
- * @subcategory Types
24
22
  */
25
23
  export interface ApiToLambdaTargetRestApiType {
26
24
  api: IRestApi
@@ -39,37 +37,33 @@ export interface ApiToLambdaTargetRestApiType {
39
37
  method: Method
40
38
  methodErrorResponse: MethodResponse
41
39
  methodResponse: MethodResponse
40
+ policy?: PolicyDocument
42
41
  resource: Resource
43
42
  responseModel: Model
44
- topic?: ITopic
45
43
  role?: Role
46
- policy?: PolicyDocument
44
+ topic?: ITopic
47
45
  }
48
46
 
49
47
  /**
50
- * @category cdk-utils.api-to-lambda-target
51
- * @subcategory Properties
52
48
  */
53
49
  export interface ApiToLambdaTargetRestApiProps {
54
- resource: string
55
50
  certificate: AcmProps
56
- restApi: LambdaRestApiProps
57
51
  importedRestApiRef?: string
58
52
  importedRestApiRootResourceRef?: string
59
- useExisting: boolean
60
- withResource?: boolean
61
53
  methodErrorResponse: MethodResponse
62
54
  methodResponse: MethodResponse
55
+ resource: string
56
+ restApi: LambdaRestApiProps
57
+ useExisting: boolean
58
+ withResource?: boolean
63
59
  }
64
60
 
65
61
  /**
66
- * @category cdk-utils.api-to-lambda-target
67
- * @subcategory Properties
68
62
  */
69
63
  export interface ApiToLambdaTargetProps extends CommonStackProps {
64
+ api: ApiToLambdaTargetRestApiProps
70
65
  apiRootPaths?: string[]
71
66
  apiSubDomain: string
72
- api: ApiToLambdaTargetRestApiProps
73
67
  lambdaFunctionName: string
74
68
  logLevel: string
75
69
  nodeEnv: string
@@ -10,13 +10,9 @@ import { GraphQlApiLambdaEnvironment, GraphQlApiLambdaProps } from './types'
10
10
 
11
11
  /**
12
12
  * @deprecated Use RestApiLambda instead. This will be removed in a future release.
13
- *
14
- * @category cdk-utils.graphql-api-lambda
15
- * @subcategory construct
16
13
  * @classdesc Provides a construct to create and deploy a Graphql API as Lambda
17
14
  *
18
15
  * <b>Architecture</b><br/> ![Architecture](./GraphQLApiLambda.jpg)
19
- *
20
16
  * @example
21
17
  * import { GraphQLApiLambda, GraphQlApiLambdaProps } '@gradientedge/cdk-utils'
22
18
  * import { Construct } from 'constructs'
@@ -29,7 +25,6 @@ import { GraphQlApiLambdaEnvironment, GraphQlApiLambdaProps } from './types'
29
25
  * this.initResources()
30
26
  * }
31
27
  * }
32
- * @mixin
33
28
  */
34
29
  export class GraphQLApiLambda extends CommonConstruct {
35
30
  /* graphql restApi props */
@@ -58,7 +53,6 @@ export class GraphQLApiLambda extends CommonConstruct {
58
53
 
59
54
  /**
60
55
  * @summary Initialise and provision resources
61
- * @protected
62
56
  */
63
57
  protected initResources() {
64
58
  this.resolveSecrets()
@@ -78,7 +72,6 @@ export class GraphQLApiLambda extends CommonConstruct {
78
72
  /**
79
73
  * @summary Method to resolve secrets from SecretsManager
80
74
  * - To be implemented in the overriding method in the implementation class
81
- * @protected
82
75
  */
83
76
  protected resolveSecrets() {
84
77
  this.applicationSecrets = []
@@ -86,7 +79,6 @@ export class GraphQLApiLambda extends CommonConstruct {
86
79
 
87
80
  /**
88
81
  * @summary Method to resolve a hosted zone based on domain attributes
89
- * @protected
90
82
  */
91
83
  protected resolveHostedZone() {
92
84
  this.graphQLApiHostedZone = this.route53Manager.withHostedZoneFromFullyQualifiedDomainName(
@@ -98,7 +90,6 @@ export class GraphQLApiLambda extends CommonConstruct {
98
90
 
99
91
  /**
100
92
  * @summary Method to resolve a certificate based on attributes
101
- * @protected
102
93
  */
103
94
  protected resolveCertificate() {
104
95
  if (
@@ -123,7 +114,6 @@ export class GraphQLApiLambda extends CommonConstruct {
123
114
 
124
115
  /**
125
116
  * @summary Method to create iam policy for GraphQL Lambda function
126
- * @protected
127
117
  */
128
118
  protected createLambdaPolicy() {
129
119
  this.graphQLApiLambdaPolicy = new iam.PolicyDocument({
@@ -133,7 +123,6 @@ export class GraphQLApiLambda extends CommonConstruct {
133
123
 
134
124
  /**
135
125
  * @summary Method to create iam role for GraphQL Lambda function
136
- * @protected
137
126
  */
138
127
  protected createLambdaRole() {
139
128
  this.graphQLApiLambdaRole = this.iamManager.createRoleForLambda(
@@ -145,19 +134,17 @@ export class GraphQLApiLambda extends CommonConstruct {
145
134
 
146
135
  /**
147
136
  * @summary Method to create environment variables for GraphQL Lambda function
148
- * @protected
149
137
  */
150
138
  protected createLambdaEnvironment() {
151
139
  this.graphQLApiLambdaEnvironment = {
152
- NODE_ENV: this.props.nodeEnv,
153
140
  LOG_LEVEL: this.props.logLevel,
141
+ NODE_ENV: this.props.nodeEnv,
154
142
  TZ: this.props.timezone,
155
143
  }
156
144
  }
157
145
 
158
146
  /**
159
147
  * @summary Method to create layers for GraphQL Lambda function
160
- * @protected
161
148
  */
162
149
  protected createLambdaLayers() {
163
150
  const layers: lambda.LayerVersion[] = []
@@ -173,7 +160,6 @@ export class GraphQLApiLambda extends CommonConstruct {
173
160
 
174
161
  /**
175
162
  * @summary Method to create lambda function for GraphQL
176
- * @protected
177
163
  */
178
164
  protected createLambdaFunction() {
179
165
  this.graphQLApiLambdaFunction = this.lambdaManager.createLambdaFunction(
@@ -190,7 +176,6 @@ export class GraphQLApiLambda extends CommonConstruct {
190
176
 
191
177
  /**
192
178
  * @summary Method to create rest restApi for GraphQL
193
- * @protected
194
179
  */
195
180
  protected createRestApi() {
196
181
  this.graphQLApi = this.apiManager.createLambdaRestApi(
@@ -203,7 +188,6 @@ export class GraphQLApiLambda extends CommonConstruct {
203
188
 
204
189
  /**
205
190
  * @summary Method to create custom restApi domain for GraphQL API
206
- * @protected
207
191
  */
208
192
  protected createApiDomain() {
209
193
  this.graphQLApiDomain = this.apiManager.createApiDomain(
@@ -218,7 +202,6 @@ export class GraphQLApiLambda extends CommonConstruct {
218
202
 
219
203
  /**
220
204
  * @summary Method to create base path mappings for GraphQL API
221
- * @protected
222
205
  */
223
206
  protected createApiBasePathMapping() {
224
207
  const apiRootPaths = this.props.apiRootPaths
@@ -246,7 +229,6 @@ export class GraphQLApiLambda extends CommonConstruct {
246
229
 
247
230
  /**
248
231
  * @summary Method to create route53 records for GraphQL API
249
- * @protected
250
232
  */
251
233
  protected createApiRouteAssets() {
252
234
  this.route53Manager.createApiGatewayARecord(
@@ -5,27 +5,23 @@ import { AssetCode } from 'aws-cdk-lib/aws-lambda'
5
5
 
6
6
  /**
7
7
  * @deprecated Use RestApiLambdaEnvironment instead. This will be removed in a future release.
8
- * @category cdk-utils.graphql-api-lambda
9
- * @subcategory Types
10
8
  */
11
9
  export interface GraphQlApiLambdaEnvironment extends LambdaEnvironment {}
12
10
 
13
11
  /**
14
12
  * @deprecated Use RestApiLambdaProps instead. This will be removed in a future release.
15
- * @category cdk-utils.graphql-api-lambda
16
- * @subcategory Properties
17
13
  */
18
14
  export interface GraphQlApiLambdaProps extends CommonStackProps {
19
15
  apiRootPaths?: string[]
20
16
  apiSubDomain: string
21
17
  graphQLApiCertificate: AcmProps
22
- graphqlRestApi: LambdaRestApiProps
23
- graphqlApiLambdaLayerSources?: AssetCode[]
24
18
  graphQLApiHandler: string
25
19
  graphQLApiSource: AssetCode
26
20
  graphqlApi: LambdaProps
27
- useExistingHostedZone: boolean
28
- nodeEnv: string
21
+ graphqlApiLambdaLayerSources?: AssetCode[]
22
+ graphqlRestApi: LambdaRestApiProps
29
23
  logLevel: string
24
+ nodeEnv: string
30
25
  timezone: string
26
+ useExistingHostedZone: boolean
31
27
  }
@@ -9,13 +9,9 @@ import * as utils from '../../utils'
9
9
 
10
10
  /**
11
11
  * @deprecated Use RestApiLambdaWithCache instead. This will be removed in a future release.
12
- *
13
- * @category cdk-utils.graphql-api-lambda-with-cache
14
- * @subcategory construct
15
12
  * @classdesc Provides a construct to create and deploy a Graphql API as Lambda with Caching
16
13
  *
17
14
  * <b>Architecture</b><br/> ![Architecture](./GraphQLApiLambda.jpg)
18
- *
19
15
  * @example
20
16
  * import { GraphQlApiLambdaWithCacheProps } '@gradientedge/cdk-utils'
21
17
  * import { Construct } from 'constructs'
@@ -28,7 +24,6 @@ import * as utils from '../../utils'
28
24
  * this.initResources()
29
25
  * }
30
26
  * }
31
- * @mixin
32
27
  */
33
28
  export class GraphQLApiLambdaWithCache extends GraphQLApiLambda {
34
29
  /* graphql restApi props */
@@ -57,7 +52,6 @@ export class GraphQLApiLambdaWithCache extends GraphQLApiLambda {
57
52
 
58
53
  /**
59
54
  * Create VPC
60
- * @protected
61
55
  */
62
56
  protected setVpc() {
63
57
  if (this.props.useExistingVpc) {
@@ -69,7 +63,6 @@ export class GraphQLApiLambdaWithCache extends GraphQLApiLambda {
69
63
 
70
64
  /**
71
65
  * Resolve Security Group
72
- * @protected
73
66
  */
74
67
  protected setSecurityGroup() {
75
68
  if (this.props.securityGroupExportName) {
@@ -92,7 +85,6 @@ export class GraphQLApiLambdaWithCache extends GraphQLApiLambda {
92
85
 
93
86
  /**
94
87
  * Create ElastiCache
95
- * @protected
96
88
  */
97
89
  protected createElastiCache() {
98
90
  this.graphQLElastiCache = this.elasticacheManager.createReplicatedElastiCache(
@@ -106,7 +98,6 @@ export class GraphQLApiLambdaWithCache extends GraphQLApiLambda {
106
98
 
107
99
  /**
108
100
  * Create Lambda Role
109
- * @protected
110
101
  */
111
102
  protected createLambdaRole() {
112
103
  super.createLambdaRole()
@@ -118,19 +109,17 @@ export class GraphQLApiLambdaWithCache extends GraphQLApiLambda {
118
109
 
119
110
  /**
120
111
  * @summary Method to create environment variables for GraphQL Lambda function
121
- * @protected
122
112
  */
123
113
  protected 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
  /**
132
122
  * @summary Method to create lambda function for GraphQL API
133
- * @protected
134
123
  */
135
124
  protected createLambdaFunction() {
136
125
  this.graphQLApiLambdaFunction = this.lambdaManager.createLambdaFunction(
@@ -4,12 +4,10 @@ import { ReplicatedElastiCacheProps } from '../../services'
4
4
 
5
5
  /**
6
6
  * @deprecated Use RestApiLambdaWithCacheProps instead. This will be removed in a future release.
7
- * @category cdk-utils.graphql-api-lambda-with-cache
8
- * @subcategory Properties
9
7
  */
10
8
  export interface GraphQlApiLambdaWithCacheProps extends GraphQlApiLambdaProps {
11
- graphQLVpc: VpcProps
12
9
  graphQLElastiCache: ReplicatedElastiCacheProps
10
+ graphQLVpc: VpcProps
13
11
  securityGroupExportName: string
14
12
  useExistingVpc: boolean
15
13
  vpcName?: string
@@ -6,10 +6,7 @@ import * as lambda from 'aws-cdk-lib/aws-lambda'
6
6
  import * as secretsManager from 'aws-cdk-lib/aws-secretsmanager'
7
7
 
8
8
  /**
9
- * @category cdk-utils.lambda-with-iam-access
10
- * @subcategory construct
11
9
  * @classdesc Provides a construct to create a lambda function with IAM access
12
- *
13
10
  * @example
14
11
  * import { LambdaWithIamAccess, LambdaWithIamAccessProps } '@gradientedge/cdk-utils'
15
12
  * import { Construct } from 'constructs'
@@ -22,7 +19,6 @@ import * as secretsManager from 'aws-cdk-lib/aws-secretsmanager'
22
19
  * this.initResources()
23
20
  * }
24
21
  * }
25
- * @mixin
26
22
  */
27
23
  export class LambdaWithIamAccess extends CommonConstruct {
28
24
  /* LambdaWithIamAccess props */
@@ -48,7 +44,6 @@ export class LambdaWithIamAccess extends CommonConstruct {
48
44
 
49
45
  /**
50
46
  * @summary Initialise and provision resources
51
- * @protected
52
47
  */
53
48
  public initResources() {
54
49
  this.createLambdaPolicy()
@@ -62,7 +57,6 @@ export class LambdaWithIamAccess extends CommonConstruct {
62
57
 
63
58
  /**
64
59
  * @summary Method to create iam policy for Lambda function
65
- * @protected
66
60
  */
67
61
  protected createLambdaPolicy() {
68
62
  this.lambdaPolicy = new iam.PolicyDocument({
@@ -72,7 +66,6 @@ export class LambdaWithIamAccess extends CommonConstruct {
72
66
 
73
67
  /**
74
68
  * @summary Method to create iam role for Lambda function
75
- * @protected
76
69
  */
77
70
  protected createLambdaRole() {
78
71
  this.lambdaRole = this.iamManager.createRoleForLambda(`${this.id}-lambda-role`, this, this.lambdaPolicy)
@@ -80,19 +73,17 @@ export class LambdaWithIamAccess extends CommonConstruct {
80
73
 
81
74
  /**
82
75
  * @summary Method to create environment variables for Lambda function
83
- * @protected
84
76
  */
85
77
  protected createLambdaEnvironment() {
86
78
  this.lambdaEnvironment = {
87
- NODE_ENV: this.props.nodeEnv,
88
79
  LOG_LEVEL: this.props.logLevel,
80
+ NODE_ENV: this.props.nodeEnv,
89
81
  TZ: this.props.timezone,
90
82
  }
91
83
  }
92
84
 
93
85
  /**
94
86
  * @summary Method to create layers for Lambda function
95
- * @protected
96
87
  */
97
88
  protected createLambdaLayers() {
98
89
  const layers: lambda.LayerVersion[] = []
@@ -108,7 +99,6 @@ export class LambdaWithIamAccess extends CommonConstruct {
108
99
 
109
100
  /**
110
101
  * @summary Method to create lambda function
111
- * @protected
112
102
  */
113
103
  protected createLambdaFunction() {
114
104
  this.lambdaFunction = this.lambdaManager.createLambdaFunction(
@@ -125,7 +115,6 @@ export class LambdaWithIamAccess extends CommonConstruct {
125
115
 
126
116
  /**
127
117
  * @summary Method to create iam user for the lambda function
128
- * @protected
129
118
  */
130
119
  protected createIamUserForLambdaFunction() {
131
120
  this.lambdaIamUser = new iam.User(this, `${this.id}-lambda-user`, {
@@ -136,8 +125,8 @@ export class LambdaWithIamAccess extends 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],
@@ -150,7 +139,6 @@ export class LambdaWithIamAccess extends CommonConstruct {
150
139
 
151
140
  /**
152
141
  * @summary Method to create iam secret for the lambda function
153
- * @protected
154
142
  */
155
143
  protected createIamSecretForLambdaFunction() {
156
144
  this.lambdaUserAccessSecret = new secretsManager.Secret(
@@ -9,12 +9,9 @@ import { CommonConstruct } from '../../common'
9
9
  import { RestApiLambdaEnvironment, RestApiLambdaProps } from './types'
10
10
 
11
11
  /**
12
- * @category cdk-utils.rest-api-lambda
13
- * @subcategory construct
14
12
  * @classdesc Provides a construct to create and deploy a RestApi as Lambda
15
13
  *
16
14
  * <b>Architecture</b><br/> ![Architecture](./RestApiLambda.jpg)
17
- *
18
15
  * @example
19
16
  * import { RestApiLambda, RestApiLambdaProps } '@gradientedge/cdk-utils'
20
17
  * import { Construct } from 'constructs'
@@ -27,7 +24,6 @@ import { RestApiLambdaEnvironment, RestApiLambdaProps } from './types'
27
24
  * this.initResources()
28
25
  * }
29
26
  * }
30
- * @mixin
31
27
  */
32
28
  export abstract class RestApiLambda extends CommonConstruct {
33
29
  /* restApiLambda props */
@@ -56,7 +52,6 @@ export abstract class RestApiLambda extends CommonConstruct {
56
52
 
57
53
  /**
58
54
  * @summary Initialise and provision resources
59
- * @protected
60
55
  */
61
56
  protected initResources() {
62
57
  this.resolveSecrets()
@@ -78,7 +73,6 @@ export abstract class RestApiLambda extends CommonConstruct {
78
73
  /**
79
74
  * @summary Method to resolve secrets from SecretsManager
80
75
  * - To be implemented in the overriding method in the implementation class
81
- * @protected
82
76
  */
83
77
  protected resolveSecrets() {
84
78
  this.applicationSecrets = []
@@ -86,7 +80,6 @@ export abstract class RestApiLambda extends CommonConstruct {
86
80
 
87
81
  /**
88
82
  * @summary Method to resolve a hosted zone based on domain attributes
89
- * @protected
90
83
  */
91
84
  protected resolveHostedZone() {
92
85
  this.restApiHostedZone = this.route53Manager.withHostedZoneFromFullyQualifiedDomainName(
@@ -98,7 +91,6 @@ export abstract class RestApiLambda extends CommonConstruct {
98
91
 
99
92
  /**
100
93
  * @summary Method to resolve a certificate based on attributes
101
- * @protected
102
94
  */
103
95
  protected resolveCertificate() {
104
96
  if (
@@ -123,7 +115,6 @@ export abstract class RestApiLambda extends CommonConstruct {
123
115
 
124
116
  /**
125
117
  * @summary Method to create iam policy for RestApi Lambda function
126
- * @protected
127
118
  */
128
119
  protected createLambdaPolicy() {
129
120
  this.restApiLambdaPolicy = new iam.PolicyDocument({
@@ -133,7 +124,6 @@ export abstract class RestApiLambda extends CommonConstruct {
133
124
 
134
125
  /**
135
126
  * @summary Method to create iam role for RestApi Lambda function
136
- * @protected
137
127
  */
138
128
  protected createLambdaRole() {
139
129
  this.restApiLambdaRole = this.iamManager.createRoleForLambda(
@@ -145,19 +135,17 @@ export abstract class RestApiLambda extends CommonConstruct {
145
135
 
146
136
  /**
147
137
  * @summary Method to create environment variables for RestApi Lambda function
148
- * @protected
149
138
  */
150
139
  protected createLambdaEnvironment() {
151
140
  this.restApiLambdaEnvironment = {
152
- NODE_ENV: this.props.nodeEnv,
153
141
  LOG_LEVEL: this.props.logLevel,
142
+ NODE_ENV: this.props.nodeEnv,
154
143
  TZ: this.props.timezone,
155
144
  }
156
145
  }
157
146
 
158
147
  /**
159
148
  * @summary Method to create layers for RestApi Lambda function
160
- * @protected
161
149
  */
162
150
  protected createLambdaLayers() {
163
151
  const layers: lambda.LayerVersion[] = []
@@ -173,7 +161,6 @@ export abstract class RestApiLambda extends CommonConstruct {
173
161
 
174
162
  /**
175
163
  * @summary Method to create lambda function for RestApi
176
- * @protected
177
164
  */
178
165
  protected createLambdaFunction() {
179
166
  this.restApiLambdaFunction = this.lambdaManager.createLambdaFunction(
@@ -190,7 +177,6 @@ export abstract class RestApiLambda extends CommonConstruct {
190
177
 
191
178
  /**
192
179
  * @summary Method to create rest restApiLambda for RestApi
193
- * @protected
194
180
  */
195
181
  protected createRestApi() {
196
182
  this.restApi = this.apiManager.createLambdaRestApi(
@@ -205,7 +191,6 @@ export abstract class RestApiLambda extends CommonConstruct {
205
191
 
206
192
  /**
207
193
  * @summary Method to create custom restApiLambda domain for RestApi
208
- * @protected
209
194
  */
210
195
  protected createApiDomain() {
211
196
  this.restApiDomain = this.apiManager.createApiDomain(
@@ -220,7 +205,6 @@ export abstract class RestApiLambda extends CommonConstruct {
220
205
 
221
206
  /**
222
207
  * @summary Method to create base path mappings for RestApi
223
- * @protected
224
208
  */
225
209
  protected createApiBasePathMapping() {
226
210
  const apiRootPaths = this.props.apiRootPaths
@@ -248,7 +232,6 @@ export abstract class RestApiLambda extends CommonConstruct {
248
232
 
249
233
  /**
250
234
  * @summary Method to create route53 records for RestApi
251
- * @protected
252
235
  */
253
236
  protected createApiRouteAssets() {
254
237
  this.route53Manager.createApiGatewayARecord(
@@ -263,7 +246,6 @@ export abstract class RestApiLambda extends CommonConstruct {
263
246
 
264
247
  /**
265
248
  * @summary Method to deploy the changes to the RestApi
266
- * @protected
267
249
  */
268
250
  protected createRestApiDeployment() {
269
251
  this.apiManager.createApiDeployment(`${this.id}-deployment`, this, this.restApi)
@@ -3,26 +3,22 @@ import { CommonStackProps } from '../../common'
3
3
  import { AssetCode } from 'aws-cdk-lib/aws-lambda'
4
4
 
5
5
  /**
6
- * @category cdk-utils.rest-api-lambda
7
- * @subcategory Types
8
6
  */
9
7
  export interface RestApiLambdaEnvironment extends LambdaEnvironment {}
10
8
 
11
9
  /**
12
- * @category cdk-utils.rest-api-lambda
13
- * @subcategory Properties
14
10
  */
15
11
  export interface RestApiLambdaProps extends CommonStackProps {
16
12
  apiRootPaths?: string[]
17
13
  apiSubDomain: string
18
- restApiCertificate: AcmProps
14
+ logLevel: string
15
+ nodeEnv: string
19
16
  restApi: LambdaRestApiProps
20
- restApiLambdaLayerSources?: AssetCode[]
17
+ restApiCertificate: AcmProps
21
18
  restApiHandler: string
22
- restApiSource: AssetCode
23
19
  restApiLambda: LambdaProps
24
- useExistingHostedZone: boolean
25
- nodeEnv: string
26
- logLevel: string
20
+ restApiLambdaLayerSources?: AssetCode[]
21
+ restApiSource: AssetCode
27
22
  timezone: string
23
+ useExistingHostedZone: boolean
28
24
  }
@@ -8,13 +8,9 @@ import { RestApiLambdaWithCacheProps } from './types'
8
8
  import * as utils from '../../utils'
9
9
 
10
10
  /**
11
- * @stability stable
12
- * @category cdk-utils.rest-api-lambda-with-cache
13
- * @subcategory construct
14
11
  * @classdesc Provides a construct to create and deploy a RestApi API as Lambda with Caching
15
12
  *
16
13
  * <b>Architecture</b><br/> ![Architecture](./RestApiLambda.jpg)
17
- *
18
14
  * @example
19
15
  * import { RestApiLambdaWithCacheProps } '@gradientedge/cdk-utils'
20
16
  * import { Construct } from 'constructs'
@@ -27,7 +23,6 @@ import * as utils from '../../utils'
27
23
  * this.initResources()
28
24
  * }
29
25
  * }
30
- * @mixin
31
26
  */
32
27
  export abstract class RestApiLambdaWithCache extends RestApiLambda {
33
28
  /* restApiLambdaWithCache props */
@@ -56,7 +51,6 @@ export abstract class RestApiLambdaWithCache extends RestApiLambda {
56
51
 
57
52
  /**
58
53
  * Create VPC
59
- * @protected
60
54
  */
61
55
  protected resolveVpc() {
62
56
  if (this.props.useExistingVpc) {
@@ -68,7 +62,6 @@ export abstract class RestApiLambdaWithCache extends RestApiLambda {
68
62
 
69
63
  /**
70
64
  * Resolve Security Group
71
- * @protected
72
65
  */
73
66
  protected resolveSecurityGroup() {
74
67
  if (!this.props.restApiCache) {
@@ -95,7 +88,6 @@ export abstract class RestApiLambdaWithCache extends RestApiLambda {
95
88
 
96
89
  /**
97
90
  * Create ElastiCache
98
- * @protected
99
91
  */
100
92
  protected createElastiCache() {
101
93
  if (!this.props.restApiCache) {
@@ -111,21 +103,20 @@ export abstract class RestApiLambdaWithCache extends RestApiLambda {
111
103
  )
112
104
 
113
105
  this.ssmManager.writeStringToParameters(`${this.id}-elasticache-endpoint-address`, this, {
114
- parameterName: `${this.id}-elasticache-endpoint-address`,
115
106
  description: `Elasticache address to use by applications`,
107
+ parameterName: `${this.id}-elasticache-endpoint-address`,
116
108
  stringValue: this.restApiCache.attrConfigurationEndPointAddress,
117
109
  })
118
110
 
119
111
  this.ssmManager.writeStringToParameters(`${this.id}-elasticache-endpoint-port`, this, {
120
- parameterName: `${this.id}-elasticache-endpoint-port`,
121
112
  description: `Elasticache port to use by applications`,
113
+ parameterName: `${this.id}-elasticache-endpoint-port`,
122
114
  stringValue: this.restApiCache.attrConfigurationEndPointPort,
123
115
  })
124
116
  }
125
117
 
126
118
  /**
127
119
  * Create Lambda Role
128
- * @protected
129
120
  */
130
121
  protected createLambdaRole() {
131
122
  super.createLambdaRole()
@@ -137,19 +128,17 @@ export abstract class RestApiLambdaWithCache extends RestApiLambda {
137
128
 
138
129
  /**
139
130
  * @summary Method to create environment variables for RestApi Lambda function
140
- * @protected
141
131
  */
142
132
  protected createLambdaEnvironment() {
143
133
  this.restApiLambdaEnvironment = {
144
- NODE_ENV: this.props.nodeEnv,
145
134
  LOG_LEVEL: this.props.logLevel,
135
+ NODE_ENV: this.props.nodeEnv,
146
136
  TZ: this.props.timezone,
147
137
  }
148
138
  }
149
139
 
150
140
  /**
151
141
  * @summary Method to create lambda function for RestApi API
152
- * @protected
153
142
  */
154
143
  protected createLambdaFunction() {
155
144
  this.restApiLambdaFunction = this.lambdaManager.createLambdaFunction(
@@ -3,12 +3,10 @@ import { VpcProps } from 'aws-cdk-lib/aws-ec2'
3
3
  import { ReplicatedElastiCacheProps } from '../../services'
4
4
 
5
5
  /**
6
- * @category cdk-utils.rest-api-lambda-with-cache
7
- * @subcategory Properties
8
6
  */
9
7
  export interface RestApiLambdaWithCacheProps extends RestApiLambdaProps {
10
- restApiVpc: VpcProps
11
8
  restApiCache: ReplicatedElastiCacheProps
9
+ restApiVpc: VpcProps
12
10
  securityGroupExportName: string
13
11
  useExistingVpc: boolean
14
12
  vpcName?: string