@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
@@ -7,9 +7,6 @@ import { LambdaRestApiProps } from './types'
7
7
  import { CommonConstruct } from '../../../common'
8
8
 
9
9
  /**
10
- * @stability stable
11
- * @category cdk-utils.api-manager
12
- * @subcategory Construct
13
10
  * @classdesc Provides operations on AWS API Gateway.
14
11
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
15
12
  * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
@@ -24,15 +21,14 @@ import { CommonConstruct } from '../../../common'
24
21
  * this.apiManager.createLambdaRestApi('MyCertificate', this, props, lambdaFunction)
25
22
  * }
26
23
  * }
27
- *
28
24
  * @see [CDK API Gateway Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway-readme.html}
29
25
  */
30
26
  export class ApiManager {
31
27
  /**
32
28
  * @summary Method to create a Rest API with Lambda backend/target
33
- * @param {string} id scoped id of the resource
34
- * @param {CommonConstruct} scope scope in which this resource is defined
35
- * @param {AcmProps} props lambda rest restApi props
29
+ * @param id scoped id of the resource
30
+ * @param scope scope in which this resource is defined
31
+ * @param props lambda rest restApi props
36
32
  * @param lambdaFunction
37
33
  */
38
34
  public createLambdaRestApi(
@@ -44,41 +40,41 @@ export class ApiManager {
44
40
  if (!props) throw `Api props undefined for ${id}`
45
41
  const api = new apig.LambdaRestApi(scope, `${id}`, {
46
42
  binaryMediaTypes: props.binaryMediaTypes,
47
- minCompressionSize: props.minCompressionSize,
43
+ cloudWatchRole: props.cloudWatchRole || false,
44
+ defaultCorsPreflightOptions: props.defaultCorsPreflightOptions,
48
45
  defaultMethodOptions: props.defaultMethodOptions,
49
46
  deploy: props.deploy || true,
50
47
  deployOptions: {
51
- stageName: scope.props.stage,
52
48
  accessLogDestination: props.deployOptions?.accessLogDestination,
53
49
  accessLogFormat: props.deployOptions?.accessLogFormat,
54
- tracingEnabled: props.deployOptions?.tracingEnabled,
55
50
  cacheClusterEnabled: props.deployOptions?.cacheClusterEnabled,
56
51
  cacheClusterSize: props.deployOptions?.cacheClusterSize,
52
+ cachingEnabled: props.deployOptions?.cachingEnabled,
57
53
  clientCertificateId: props.deployOptions?.clientCertificateId,
54
+ dataTraceEnabled: props.deployOptions?.dataTraceEnabled,
58
55
  description: `${id} - ${scope.props.stage} stage`,
59
56
  documentationVersion: props.deployOptions?.documentationVersion,
60
- variables: props.deployOptions?.variables,
61
- methodOptions: props.deployOptions?.methodOptions,
62
57
  loggingLevel: props.deployOptions?.loggingLevel,
63
- dataTraceEnabled: props.deployOptions?.dataTraceEnabled,
64
- cachingEnabled: props.deployOptions?.cachingEnabled,
58
+ methodOptions: props.deployOptions?.methodOptions,
65
59
  metricsEnabled: props.deployOptions?.metricsEnabled,
60
+ stageName: scope.props.stage,
61
+ tracingEnabled: props.deployOptions?.tracingEnabled,
62
+ variables: props.deployOptions?.variables,
66
63
  },
67
- retainDeployments: props.retainDeployments,
68
- parameters: props.parameters,
69
- policy: props.policy,
70
- failOnWarnings: props.failOnWarnings || false,
71
64
  domainName: props.domainName,
72
- cloudWatchRole: props.cloudWatchRole || false,
73
- endpointTypes: props.endpointTypes,
74
65
  endpointConfiguration: {
75
66
  types: props.endpointConfiguration?.types || [apig.EndpointType.REGIONAL],
76
67
  vpcEndpoints: props.endpointConfiguration?.vpcEndpoints,
77
68
  },
78
- restApiName: `${props.restApiName}-${scope.props.stage}`,
69
+ endpointTypes: props.endpointTypes,
70
+ failOnWarnings: props.failOnWarnings || false,
79
71
  handler: lambdaFunction,
80
- defaultCorsPreflightOptions: props.defaultCorsPreflightOptions,
72
+ minCompressionSize: props.minCompressionSize,
73
+ parameters: props.parameters,
74
+ policy: props.policy,
81
75
  proxy: props.proxy ?? true,
76
+ restApiName: `${props.restApiName}-${scope.props.stage}`,
77
+ retainDeployments: props.retainDeployments,
82
78
  })
83
79
 
84
80
  if (props.tags && props.tags.length > 0) {
@@ -95,15 +91,15 @@ export class ApiManager {
95
91
 
96
92
  /**
97
93
  * @summary Method to create custom restApi domain
98
- * @param {string} id scoped id of the resource
99
- * @param {CommonConstruct} scope scope in which this resource is defined
94
+ * @param id scoped id of the resource
95
+ * @param scope scope in which this resource is defined
100
96
  * @param domainName the domain name to use
101
97
  * @param certificate the certificate used for custom restApi domain
102
98
  */
103
99
  public createApiDomain(id: string, scope: CommonConstruct, domainName: string, certificate: acm.ICertificate) {
104
100
  const apiDomain = new apig.DomainName(scope, `${id}`, {
105
- domainName: domainName,
106
101
  certificate: certificate,
102
+ domainName: domainName,
107
103
  endpointType: scope.isProductionStage() ? apig.EndpointType.EDGE : apig.EndpointType.REGIONAL,
108
104
  securityPolicy: apig.SecurityPolicy.TLS_1_2,
109
105
  })
@@ -115,18 +111,18 @@ export class ApiManager {
115
111
 
116
112
  /**
117
113
  * @summary Method to create an API gateway resource
118
- * @param {string} id
119
- * @param {CommonConstruct} scope
120
- * @param {apig.IResource} parent
121
- * @param {string} path
122
- * @param {apig.Integration} integration
123
- * @param {boolean} addProxy
124
- * @param {apig.IAuthorizer} authorizer
125
- * @param {string[]?} allowedOrigins
126
- * @param {string[]?} allowedMethods
127
- * @param {string[]?} allowedHeaders
128
- * @param {{}?} methodRequestParameters
129
- * @param {apig.Integration} proxyIntegration
114
+ * @param id
115
+ * @param scope
116
+ * @param parent
117
+ * @param path
118
+ * @param integration
119
+ * @param addProxy
120
+ * @param authorizer
121
+ * @param allowedOrigins
122
+ * @param allowedMethods
123
+ * @param allowedHeaders
124
+ * @param methodRequestParameters
125
+ * @param proxyIntegration
130
126
  */
131
127
  public createApiResource(
132
128
  id: string,
@@ -139,16 +135,16 @@ export class ApiManager {
139
135
  allowedOrigins?: string[],
140
136
  allowedMethods?: string[],
141
137
  allowedHeaders?: string[],
142
- methodRequestParameters?: {},
138
+ methodRequestParameters?: any,
143
139
  proxyIntegration?: apig.Integration
144
140
  ) {
145
141
  const methods = allowedMethods ?? apig.Cors.ALL_METHODS
146
142
  const resource = parent.addResource(path, {
147
143
  defaultCorsPreflightOptions: {
148
- allowOrigins: allowedOrigins ?? apig.Cors.ALL_ORIGINS,
149
- allowMethods: [...methods, 'OPTIONS'],
150
- allowHeaders: allowedHeaders ?? apig.Cors.DEFAULT_HEADERS,
151
144
  allowCredentials: true,
145
+ allowHeaders: allowedHeaders ?? apig.Cors.DEFAULT_HEADERS,
146
+ allowMethods: [...methods, 'OPTIONS'],
147
+ allowOrigins: allowedOrigins ?? apig.Cors.ALL_ORIGINS,
152
148
  },
153
149
  })
154
150
  methods.forEach(method =>
@@ -162,10 +158,10 @@ export class ApiManager {
162
158
  if (addProxy) {
163
159
  const resourceProxy = resource.addResource(`{${path}+}`, {
164
160
  defaultCorsPreflightOptions: {
165
- allowOrigins: allowedOrigins ?? apig.Cors.ALL_ORIGINS,
166
- allowMethods: [...methods, 'OPTIONS'],
167
- allowHeaders: allowedHeaders ?? apig.Cors.DEFAULT_HEADERS,
168
161
  allowCredentials: true,
162
+ allowHeaders: allowedHeaders ?? apig.Cors.DEFAULT_HEADERS,
163
+ allowMethods: [...methods, 'OPTIONS'],
164
+ allowOrigins: allowedOrigins ?? apig.Cors.ALL_ORIGINS,
169
165
  },
170
166
  })
171
167
  methods.forEach(method =>
@@ -182,9 +178,9 @@ export class ApiManager {
182
178
 
183
179
  /**
184
180
  * @summary Method to create an api deployment
185
- * @param {string} id
186
- * @param {CommonConstruct} scope
187
- * @param {apig.IRestApi} restApi
181
+ * @param id
182
+ * @param scope
183
+ * @param restApi
188
184
  */
189
185
  public createApiDeployment(id: string, scope: CommonConstruct, restApi: apig.IRestApi) {
190
186
  new apig.Deployment(scope, `${id}`, {
@@ -2,8 +2,6 @@ import { TagProps } from '../../../types'
2
2
  import * as apig from 'aws-cdk-lib/aws-apigateway'
3
3
 
4
4
  /**
5
- * @category cdk-utils.api-manager
6
- * @subcategory Properties
7
5
  */
8
6
  export interface LambdaRestApiProps extends apig.LambdaRestApiProps {
9
7
  tags?: TagProps[]
@@ -1,58 +1,52 @@
1
1
  /**
2
- * @stability stable
3
- * @category cdk-utils.app-config-manager
4
- * @subcategory Construct
5
2
  * @returns { Map<string, string> } AppConfig extension ARN by region for x84
6
3
  */
7
4
  export const ArnsByRegionForX86_64: { [region: string]: string } = {
8
- 'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension:110',
9
- 'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension:79',
10
- 'us-west-1': 'arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension:121',
11
- 'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension:143',
12
- 'ca-central-1': 'arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension:79',
13
- 'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension:91',
14
- 'eu-central-2': 'arn:aws:lambda:eu-central-2:758369105281:layer:AWS-AppConfig-Extension:29',
15
- 'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension:108',
16
- 'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension:79',
17
- 'eu-west-3': 'arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension:80',
18
- 'eu-north-1': 'arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension:139',
19
- 'eu-south-1': 'arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension:71',
20
- 'eu-south-2': 'arn:aws:lambda:eu-south-2:586093569114:layer:AWS-AppConfig-Extension:26',
21
- 'cn-north-1': 'arn:aws-cn:lambda:cn-north-1:615057806174:layer:AWS-AppConfig-Extension:66',
22
- 'cn-northwest-1': 'arn:aws-cn:lambda:cn-northwest-1:615084187847:layer:AWS-AppConfig-Extension:66',
5
+ 'af-south-1': 'arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension:71',
23
6
  'ap-east-1': 'arn:aws:lambda:ap-east-1:630222743974:layer:AWS-AppConfig-Extension:71',
24
7
  'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension:82',
25
8
  'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:826293736237:layer:AWS-AppConfig-Extension:91',
26
9
  'ap-northeast-3': 'arn:aws:lambda:ap-northeast-3:706869817123:layer:AWS-AppConfig-Extension:84',
10
+ 'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension:92',
11
+ 'ap-south-2': 'arn:aws:lambda:ap-south-2:489524808438:layer:AWS-AppConfig-Extension:29',
27
12
  'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension:89',
28
13
  'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension:91',
29
14
  'ap-southeast-3': 'arn:aws:lambda:ap-southeast-3:418787028745:layer:AWS-AppConfig-Extension:60',
30
15
  'ap-southeast-4': 'arn:aws:lambda:ap-southeast-4:307021474294:layer:AWS-AppConfig-Extension:2',
31
- 'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension:92',
32
- 'ap-south-2': 'arn:aws:lambda:ap-south-2:489524808438:layer:AWS-AppConfig-Extension:29',
33
- 'sa-east-1': 'arn:aws:lambda:sa-east-1:000010852771:layer:AWS-AppConfig-Extension:110',
34
- 'af-south-1': 'arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension:71',
16
+ 'ca-central-1': 'arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension:79',
17
+ 'cn-north-1': 'arn:aws-cn:lambda:cn-north-1:615057806174:layer:AWS-AppConfig-Extension:66',
18
+ 'cn-northwest-1': 'arn:aws-cn:lambda:cn-northwest-1:615084187847:layer:AWS-AppConfig-Extension:66',
19
+ 'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension:91',
20
+ 'eu-central-2': 'arn:aws:lambda:eu-central-2:758369105281:layer:AWS-AppConfig-Extension:29',
21
+ 'eu-north-1': 'arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension:139',
22
+ 'eu-south-1': 'arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension:71',
23
+ 'eu-south-2': 'arn:aws:lambda:eu-south-2:586093569114:layer:AWS-AppConfig-Extension:26',
24
+ 'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension:108',
25
+ 'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension:79',
26
+ 'eu-west-3': 'arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension:80',
35
27
  'me-central-1': 'arn:aws:lambda:me-central-1:662846165436:layer:AWS-AppConfig-Extension:31',
36
28
  'me-south-1': 'arn:aws:lambda:me-south-1:559955524753:layer:AWS-AppConfig-Extension:71',
29
+ 'sa-east-1': 'arn:aws:lambda:sa-east-1:000010852771:layer:AWS-AppConfig-Extension:110',
30
+ 'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension:110',
31
+ 'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension:79',
37
32
  'us-gov-east-1': 'arn:aws-us-gov:lambda:us-gov-east-1:946561847325:layer:AWS-AppConfig-Extension:44',
38
33
  'us-gov-west-1': 'arn:aws-us-gov:lambda:us-gov-west-1:946746059096:layer:AWS-AppConfig-Extension:44',
34
+ 'us-west-1': 'arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension:121',
35
+ 'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension:143',
39
36
  }
40
37
 
41
38
  /**
42
- * @stability stable
43
- * @category cdk-utils.app-config-manager
44
- * @subcategory Construct
45
39
  * @returns { Map<string, string> } AppConfig extension ARN by region for arm64
46
40
  */
47
41
  export const ArnsByRegionForArm64: { [region: string]: string } = {
48
- 'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension-Arm64:43',
49
- 'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension-Arm64:31',
50
- 'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension-Arm64:45',
51
- 'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension-Arm64:34',
52
- 'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension-Arm64:46',
53
- 'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension-Arm64:31',
54
42
  'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension-Arm64:35',
43
+ 'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension-Arm64:34',
55
44
  'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension-Arm64:41',
56
45
  'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension-Arm64:34',
57
- 'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension-Arm64:34',
46
+ 'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension-Arm64:34',
47
+ 'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension-Arm64:46',
48
+ 'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension-Arm64:31',
49
+ 'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension-Arm64:43',
50
+ 'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension-Arm64:31',
51
+ 'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension-Arm64:45',
58
52
  }
@@ -7,8 +7,6 @@ import { ArnsByRegionForArm64, ArnsByRegionForX86_64 } from './constants'
7
7
  import { CommonConstruct } from '../../../common'
8
8
 
9
9
  /**
10
- * @category cdk-utils.app-config-manager
11
- * @subcategory Construct
12
10
  * @classdesc Provides operations on AWS AppConfig.
13
11
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
14
12
  * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
@@ -22,14 +20,13 @@ import { CommonConstruct } from '../../../common'
22
20
  * this.appConfigManager.createApplication('MyApplication', this)
23
21
  * }
24
22
  * }
25
- *
26
23
  * @see [CDK AppConfig Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig-readme.html}
27
24
  */
28
25
  export class AppConfigManager {
29
26
  /**
30
27
  * Method to get static ARNs for AppConfig extensions
31
- * @param {CommonConstruct} scope scope in which this resource is defined
32
- * @param {Architecture} type type of the architecture
28
+ * @param scope scope in which this resource is defined
29
+ * @param type type of the architecture
33
30
  */
34
31
  public getArnForAppConfigExtension(scope: CommonConstruct, type: Architecture) {
35
32
  switch (type) {
@@ -44,17 +41,17 @@ export class AppConfigManager {
44
41
 
45
42
  /**
46
43
  * @summary Method to create an AppConfig Application
47
- * @param {string} id scoped id of the resource
48
- * @param {CommonConstruct} scope scope in which this resource is defined
49
- * @param {AppConfigProps} props
50
- * @returns {appconfig.CfnApplication}
44
+ * @param id scoped id of the resource
45
+ * @param scope scope in which this resource is defined
46
+ * @param props
47
+ * @returns the appconfig application
51
48
  */
52
49
  public createApplication(id: string, scope: CommonConstruct, props: AppConfigProps): appconfig.CfnApplication {
53
50
  if (!props) throw `AppConfig props undefined for ${id}`
54
51
 
55
52
  const application = new appconfig.CfnApplication(scope, `${id}`, {
56
- name: `${props.application.name}-${scope.props.stage}`,
57
53
  description: props.application.description,
54
+ name: `${props.application.name}-${scope.props.stage}`,
58
55
  tags: props.application.tags,
59
56
  })
60
57
 
@@ -66,11 +63,11 @@ export class AppConfigManager {
66
63
 
67
64
  /**
68
65
  * @summary Method to create an AppConfig Environment for a given application
69
- * @param {string} id scoped id of the resource
70
- * @param {CommonConstruct} scope scope in which this resource is defined
71
- * @param {string} applicationId id of the application
72
- * @param {AppConfigProps} props
73
- * @returns {appconfig.CfnEnvironment}
66
+ * @param id scoped id of the resource
67
+ * @param scope scope in which this resource is defined
68
+ * @param applicationId id of the application
69
+ * @param props
70
+ * @returns the appconfig environment
74
71
  */
75
72
  public createEnvironment(
76
73
  id: string,
@@ -82,9 +79,9 @@ export class AppConfigManager {
82
79
 
83
80
  const environment = new appconfig.CfnEnvironment(scope, `${id}`, {
84
81
  applicationId: applicationId,
85
- name: props.environment.name ?? scope.props.stage,
86
82
  description: props.environment.description,
87
83
  monitors: props.environment.monitors,
84
+ name: props.environment.name ?? scope.props.stage,
88
85
  tags: props.environment.tags,
89
86
  })
90
87
 
@@ -97,11 +94,11 @@ export class AppConfigManager {
97
94
  /**
98
95
  * @summary Method to create an AppConfig Configuration Profile for a given application
99
96
  * - <p>&#9888; The <b>locationUri</b> is defaulted to <i>hosted</i> if undefined</p>
100
- * @param {string} id scoped id of the resource
101
- * @param {CommonConstruct} scope scope in which this resource is defined
102
- * @param {string} applicationId id of the application
103
- * @param {AppConfigProps} props
104
- * @returns {appconfig.CfnConfigurationProfile}
97
+ * @param id scoped id of the resource
98
+ * @param scope scope in which this resource is defined
99
+ * @param applicationId id of the application
100
+ * @param props
101
+ * @returns the appconfig configuration profile
105
102
  */
106
103
  public createConfigurationProfile(
107
104
  id: string,
@@ -113,9 +110,9 @@ export class AppConfigManager {
113
110
 
114
111
  const profile = new appconfig.CfnConfigurationProfile(scope, `${id}`, {
115
112
  applicationId: applicationId,
113
+ description: props.configurationProfile.description,
116
114
  locationUri: props.configurationProfile.locationUri || 'hosted',
117
115
  name: `${props.configurationProfile.name}-${scope.props.stage}`,
118
- description: props.configurationProfile.description,
119
116
  retrievalRoleArn: props.configurationProfile.retrievalRoleArn,
120
117
  tags: props.configurationProfile.tags,
121
118
  type: props.configurationProfile.type,
@@ -7,14 +7,12 @@ import {
7
7
  } from 'aws-cdk-lib/aws-appconfig'
8
8
 
9
9
  /**
10
- * @category cdk-utils.app-config-manager
11
- * @subcategory Properties
12
10
  */
13
11
  export interface AppConfigProps {
14
- id: string
15
12
  application: CfnApplicationProps
16
13
  configurationProfile: CfnConfigurationProfileProps
17
14
  deployment: CfnDeploymentProps
18
15
  deploymentStrategy: CfnDeploymentStrategyProps
19
16
  environment: CfnEnvironmentProps
17
+ id: string
20
18
  }
@@ -6,9 +6,6 @@ import { AcmProps } from './types'
6
6
  import { CommonConstruct } from '../../../common'
7
7
 
8
8
  /**
9
- * @stability stable
10
- * @category cdk-utils.acm-manager
11
- * @subcategory Construct
12
9
  * @classdesc Provides operations on AWS Certificates.
13
10
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
14
11
  * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
@@ -22,18 +19,16 @@ import { CommonConstruct } from '../../../common'
22
19
  * this.acmManager.createCertificate('MyCertificate', this)
23
20
  * }
24
21
  * }
25
- *
26
22
  * @see [CDK Certificate Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_certificatemanager-readme.html}
27
23
  */
28
24
  export class AcmManager {
29
25
  /**
30
26
  * @summary Method to create/import a certificate
31
- * @param {string} id scoped id of the resource
32
- * @param {CommonConstruct} scope scope in which this resource is defined
33
- * @param {AcmProps} props certificate props
34
- * @param {route53.HostedZone?} hostedZone optional hosted zone to perform DNS validation
35
- * @returns {acm.ICertificate}
36
- *
27
+ * @param id scoped id of the resource
28
+ * @param scope scope in which this resource is defined
29
+ * @param props certificate props
30
+ * @param hostedZone optional hosted zone to perform DNS validation
31
+ * @returns the resolved certificate
37
32
  * @mermaid
38
33
  * graph LR;
39
34
  * A((Start)) --> B{Valid Properties?};
@@ -1,14 +1,12 @@
1
1
  import * as acm from 'aws-cdk-lib/aws-certificatemanager'
2
2
 
3
3
  /**
4
- * @category cdk-utils.acm-manager
5
- * @subcategory Properties
6
4
  */
7
5
  export interface AcmProps extends acm.CertificateProps {
8
- certificateSsmName?: string
9
6
  certificateAccount?: string
10
- certificateRegion?: string
11
- certificateId?: string
12
7
  certificateArn?: string
8
+ certificateId?: string
9
+ certificateRegion?: string
10
+ certificateSsmName?: string
13
11
  useExistingCertificate: boolean
14
12
  }