@gradientedge/cdk-utils 8.118.0 → 8.120.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 (309) hide show
  1. package/app/api-destined-function/package.json +1 -1
  2. package/dist/src/lib/common/construct.d.ts +32 -32
  3. package/dist/src/lib/common/construct.js +36 -59
  4. package/dist/src/lib/common/stack.d.ts +8 -7
  5. package/dist/src/lib/common/stack.js +17 -37
  6. package/dist/src/lib/common/types.d.ts +2 -2
  7. package/dist/src/lib/construct/api-to-eventbridge-target/api.d.ts +22 -22
  8. package/dist/src/lib/construct/api-to-eventbridge-target/event.d.ts +9 -9
  9. package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +3 -3
  10. package/dist/src/lib/construct/api-to-eventbridge-target/main.js +37 -60
  11. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +9 -9
  12. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.d.ts +3 -3
  13. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.js +40 -63
  14. package/dist/src/lib/construct/api-to-lambda-target/api.d.ts +23 -23
  15. package/dist/src/lib/construct/api-to-lambda-target/main.d.ts +2 -2
  16. package/dist/src/lib/construct/api-to-lambda-target/main.js +15 -38
  17. package/dist/src/lib/construct/application-configuration/main.d.ts +7 -7
  18. package/dist/src/lib/construct/application-configuration/main.js +17 -41
  19. package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +17 -17
  20. package/dist/src/lib/construct/graphql-api-lambda/main.js +6 -29
  21. package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.d.ts +5 -5
  22. package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.js +7 -7
  23. package/dist/src/lib/construct/lambda-with-iam-access/main.d.ts +16 -16
  24. package/dist/src/lib/construct/lambda-with-iam-access/main.js +8 -31
  25. package/dist/src/lib/construct/lambda-with-iam-access/types.d.ts +4 -4
  26. package/dist/src/lib/construct/rest-api-lambda/main.d.ts +16 -16
  27. package/dist/src/lib/construct/rest-api-lambda/main.js +5 -28
  28. package/dist/src/lib/construct/rest-api-lambda-with-cache/main.d.ts +5 -5
  29. package/dist/src/lib/construct/rest-api-lambda-with-cache/main.js +9 -32
  30. package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +38 -39
  31. package/dist/src/lib/construct/site-with-ecs-backend/main.js +33 -54
  32. package/dist/src/lib/construct/static-asset-deployment/main.d.ts +4 -4
  33. package/dist/src/lib/construct/static-asset-deployment/main.js +3 -26
  34. package/dist/src/lib/construct/static-site/main.d.ts +15 -15
  35. package/dist/src/lib/construct/static-site/main.js +4 -27
  36. package/dist/src/lib/services/{aws/api-gateway → api-gateway}/main.d.ts +10 -10
  37. package/dist/src/lib/services/{aws/api-gateway → api-gateway}/main.js +21 -44
  38. package/dist/src/lib/services/api-gateway/types.d.ts +7 -0
  39. package/dist/src/lib/services/{aws/appconfig → appconfig}/main.d.ts +7 -7
  40. package/dist/src/lib/services/{aws/appconfig → appconfig}/main.js +14 -37
  41. package/dist/src/lib/services/{aws/certificate-manager → certificate-manager}/main.d.ts +5 -5
  42. package/dist/src/lib/services/{aws/certificate-manager → certificate-manager}/main.js +10 -33
  43. package/dist/src/lib/services/{aws/certificate-manager → certificate-manager}/types.d.ts +2 -2
  44. package/dist/src/lib/services/{aws/cloudfront → cloudfront}/main.d.ts +19 -19
  45. package/dist/src/lib/services/{aws/cloudfront → cloudfront}/main.js +47 -46
  46. package/dist/src/lib/services/{aws/cloudfront → cloudfront}/types.d.ts +3 -4
  47. package/dist/src/lib/services/{aws/cloudtrail → cloudtrail}/main.d.ts +6 -6
  48. package/dist/src/lib/services/{aws/cloudtrail → cloudtrail}/main.js +5 -28
  49. package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/logs.d.ts +1 -1
  50. package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/logs.js +1 -1
  51. package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/main.d.ts +1 -1
  52. package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/main.js +1 -1
  53. package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/types.d.ts +1 -1
  54. package/dist/src/lib/services/{aws/codebuild → codebuild}/main.d.ts +4 -4
  55. package/dist/src/lib/services/{aws/codebuild → codebuild}/main.js +7 -30
  56. package/dist/src/lib/services/{aws/dynamodb → dynamodb}/main.d.ts +4 -4
  57. package/dist/src/lib/services/{aws/dynamodb → dynamodb}/main.js +8 -31
  58. package/dist/src/lib/services/{aws/dynamodb → dynamodb}/types.d.ts +1 -1
  59. package/dist/src/lib/services/{aws/elastic-container-registry → elastic-container-registry}/main.d.ts +3 -3
  60. package/dist/src/lib/services/elastic-container-registry/main.js +37 -0
  61. package/dist/src/lib/services/{aws/elastic-container-service → elastic-container-service}/main.d.ts +11 -11
  62. package/dist/src/lib/services/{aws/elastic-container-service → elastic-container-service}/main.js +27 -50
  63. package/dist/src/lib/services/{aws/elastic-container-service → elastic-container-service}/types.d.ts +4 -4
  64. package/dist/src/lib/services/{aws/elastic-file-system → elastic-file-system}/main.d.ts +4 -4
  65. package/dist/src/lib/services/{aws/elastic-file-system → elastic-file-system}/main.js +12 -35
  66. package/dist/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/main.d.ts +5 -5
  67. package/dist/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/main.js +8 -31
  68. package/dist/src/lib/services/{aws/elasticache → elasticache}/main.d.ts +5 -5
  69. package/dist/src/lib/services/{aws/elasticache → elasticache}/main.js +10 -33
  70. package/dist/src/lib/services/{aws/eventbridge → eventbridge}/main.d.ts +14 -14
  71. package/dist/src/lib/services/{aws/eventbridge → eventbridge}/main.js +26 -49
  72. package/dist/src/lib/services/{aws/eventbridge → eventbridge}/target.d.ts +11 -11
  73. package/dist/src/lib/services/{aws/eventbridge → eventbridge}/target.js +6 -29
  74. package/dist/src/lib/services/{aws/eventbridge → eventbridge}/types.d.ts +1 -1
  75. package/dist/src/lib/services/{aws/evidently → evidently}/main.d.ts +8 -8
  76. package/dist/src/lib/services/{aws/evidently → evidently}/main.js +18 -41
  77. package/dist/src/lib/services/{aws/identity-access-management → identity-access-management}/main.d.ts +49 -50
  78. package/dist/src/lib/services/{aws/identity-access-management → identity-access-management}/main.js +110 -133
  79. package/dist/src/lib/services/index.d.ts +28 -1
  80. package/dist/src/lib/services/index.js +28 -1
  81. package/dist/src/lib/services/{aws/key-management-service → key-management-service}/main.d.ts +3 -3
  82. package/dist/src/lib/services/{aws/key-management-service → key-management-service}/main.js +5 -28
  83. package/dist/src/lib/services/{aws/lambda → lambda}/main.d.ts +12 -14
  84. package/dist/src/lib/services/{aws/lambda → lambda}/main.js +32 -59
  85. package/dist/src/lib/services/{aws/lambda → lambda}/types.d.ts +1 -1
  86. package/dist/src/lib/services/{aws/route53 → route53}/main.d.ts +10 -10
  87. package/dist/src/lib/services/{aws/route53 → route53}/main.js +21 -44
  88. package/dist/src/lib/services/{aws/secrets-manager → secrets-manager}/main.d.ts +6 -7
  89. package/dist/src/lib/services/{aws/secrets-manager → secrets-manager}/main.js +10 -33
  90. package/dist/src/lib/services/{aws/simple-notification-service → simple-notification-service}/main.d.ts +5 -5
  91. package/dist/src/lib/services/{aws/simple-notification-service → simple-notification-service}/main.js +11 -34
  92. package/dist/src/lib/services/{aws/simple-queue-service → simple-queue-service}/main.d.ts +7 -8
  93. package/dist/src/lib/services/{aws/simple-queue-service → simple-queue-service}/main.js +15 -38
  94. package/dist/src/lib/services/{aws/simple-queue-service → simple-queue-service}/types.d.ts +1 -1
  95. package/dist/src/lib/services/{aws/simple-storage-service → simple-storage-service}/main.d.ts +10 -11
  96. package/dist/src/lib/services/{aws/simple-storage-service → simple-storage-service}/main.js +31 -54
  97. package/dist/src/lib/services/{aws/simple-storage-service → simple-storage-service}/types.d.ts +1 -1
  98. package/dist/src/lib/services/{aws/step-function → step-function}/main.d.ts +32 -33
  99. package/dist/src/lib/services/{aws/step-function → step-function}/main.js +33 -57
  100. package/dist/src/lib/services/{aws/systems-manager → systems-manager}/main.d.ts +5 -5
  101. package/dist/src/lib/services/{aws/systems-manager → systems-manager}/main.js +10 -33
  102. package/dist/src/lib/services/{aws/virtual-private-cloud → virtual-private-cloud}/main.d.ts +6 -7
  103. package/dist/src/lib/services/virtual-private-cloud/main.js +70 -0
  104. package/dist/src/lib/services/{aws/web-application-firewall → web-application-firewall}/main.d.ts +4 -4
  105. package/dist/src/lib/services/{aws/web-application-firewall → web-application-firewall}/main.js +8 -31
  106. package/dist/src/lib/utils/aws/index.d.ts +6 -3
  107. package/dist/src/lib/utils/aws/index.js +9 -26
  108. package/package.json +15 -15
  109. package/src/lib/common/construct.ts +97 -67
  110. package/src/lib/common/stack.ts +12 -12
  111. package/src/lib/common/types.ts +2 -2
  112. package/src/lib/construct/api-to-eventbridge-target/api.ts +31 -22
  113. package/src/lib/construct/api-to-eventbridge-target/event.ts +9 -9
  114. package/src/lib/construct/api-to-eventbridge-target/main.ts +56 -41
  115. package/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +9 -9
  116. package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +62 -47
  117. package/src/lib/construct/api-to-lambda-target/api.ts +33 -23
  118. package/src/lib/construct/api-to-lambda-target/main.ts +24 -18
  119. package/src/lib/construct/application-configuration/main.ts +31 -24
  120. package/src/lib/construct/graphql-api-lambda/main.ts +22 -22
  121. package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +13 -13
  122. package/src/lib/construct/lambda-with-iam-access/main.ts +25 -25
  123. package/src/lib/construct/lambda-with-iam-access/types.ts +4 -4
  124. package/src/lib/construct/rest-api-lambda/main.ts +21 -21
  125. package/src/lib/construct/rest-api-lambda-with-cache/main.ts +14 -14
  126. package/src/lib/construct/site-with-ecs-backend/main.ts +79 -60
  127. package/src/lib/construct/static-asset-deployment/main.ts +6 -6
  128. package/src/lib/construct/static-site/main.ts +23 -17
  129. package/src/lib/services/{aws/api-gateway → api-gateway}/main.ts +42 -36
  130. package/src/lib/services/api-gateway/types.ts +8 -0
  131. package/src/lib/services/{aws/appconfig → appconfig}/main.ts +19 -19
  132. package/src/lib/services/{aws/certificate-manager → certificate-manager}/main.ts +14 -14
  133. package/src/lib/services/{aws/certificate-manager → certificate-manager}/types.ts +2 -2
  134. package/src/lib/services/{aws/cloudfront → cloudfront}/main.ts +89 -75
  135. package/src/lib/services/{aws/cloudfront → cloudfront}/types.ts +7 -4
  136. package/src/lib/services/{aws/cloudtrail → cloudtrail}/main.ts +12 -12
  137. package/src/lib/services/{aws/cloudwatch → cloudwatch}/logs.ts +2 -2
  138. package/src/lib/services/{aws/cloudwatch → cloudwatch}/main.ts +2 -2
  139. package/src/lib/services/{aws/cloudwatch → cloudwatch}/types.ts +1 -1
  140. package/src/lib/services/{aws/codebuild → codebuild}/main.ts +8 -8
  141. package/src/lib/services/{aws/dynamodb → dynamodb}/main.ts +9 -9
  142. package/src/lib/services/{aws/dynamodb → dynamodb}/types.ts +1 -1
  143. package/src/lib/services/{aws/elastic-container-registry → elastic-container-registry}/main.ts +5 -5
  144. package/src/lib/services/{aws/elastic-container-service → elastic-container-service}/main.ts +49 -38
  145. package/src/lib/services/{aws/elastic-container-service → elastic-container-service}/types.ts +4 -4
  146. package/src/lib/services/{aws/elastic-file-system → elastic-file-system}/main.ts +17 -17
  147. package/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/main.ts +12 -12
  148. package/src/lib/services/{aws/elasticache → elasticache}/main.ts +11 -11
  149. package/src/lib/services/{aws/eventbridge → eventbridge}/main.ts +38 -38
  150. package/src/lib/services/{aws/eventbridge → eventbridge}/target.ts +15 -15
  151. package/src/lib/services/{aws/eventbridge → eventbridge}/types.ts +1 -1
  152. package/src/lib/services/{aws/evidently → evidently}/main.ts +19 -19
  153. package/src/lib/services/{aws/identity-access-management → identity-access-management}/main.ts +143 -135
  154. package/src/lib/services/index.ts +28 -1
  155. package/src/lib/services/{aws/key-management-service → key-management-service}/main.ts +6 -6
  156. package/src/lib/services/{aws/lambda → lambda}/main.ts +66 -60
  157. package/src/lib/services/{aws/lambda → lambda}/types.ts +1 -1
  158. package/src/lib/services/{aws/route53 → route53}/main.ts +32 -32
  159. package/src/lib/services/{aws/secrets-manager → secrets-manager}/main.ts +12 -16
  160. package/src/lib/services/{aws/simple-notification-service → simple-notification-service}/main.ts +14 -14
  161. package/src/lib/services/{aws/simple-queue-service → simple-queue-service}/main.ts +19 -19
  162. package/src/lib/services/{aws/simple-queue-service → simple-queue-service}/types.ts +1 -1
  163. package/src/lib/services/{aws/simple-storage-service → simple-storage-service}/main.ts +40 -40
  164. package/src/lib/services/{aws/simple-storage-service → simple-storage-service}/types.ts +1 -1
  165. package/src/lib/services/{aws/step-function → step-function}/main.ts +78 -66
  166. package/src/lib/services/{aws/systems-manager → systems-manager}/main.ts +18 -13
  167. package/src/lib/services/{aws/virtual-private-cloud → virtual-private-cloud}/main.ts +17 -17
  168. package/src/lib/services/{aws/web-application-firewall → web-application-firewall}/main.ts +9 -9
  169. package/src/lib/utils/aws/index.ts +8 -5
  170. package/dist/src/lib/services/aws/api-gateway/types.d.ts +0 -7
  171. package/dist/src/lib/services/aws/elastic-container-registry/main.js +0 -60
  172. package/dist/src/lib/services/aws/index.d.ts +0 -28
  173. package/dist/src/lib/services/aws/index.js +0 -44
  174. package/dist/src/lib/services/aws/virtual-private-cloud/main.js +0 -93
  175. package/src/lib/services/aws/api-gateway/types.ts +0 -8
  176. package/src/lib/services/aws/index.ts +0 -28
  177. /package/dist/src/lib/services/{aws/api-gateway → api-gateway}/index.d.ts +0 -0
  178. /package/dist/src/lib/services/{aws/api-gateway → api-gateway}/index.js +0 -0
  179. /package/dist/src/lib/services/{aws/api-gateway → api-gateway}/types.js +0 -0
  180. /package/dist/src/lib/services/{aws/appconfig → appconfig}/constants.d.ts +0 -0
  181. /package/dist/src/lib/services/{aws/appconfig → appconfig}/constants.js +0 -0
  182. /package/dist/src/lib/services/{aws/appconfig → appconfig}/index.d.ts +0 -0
  183. /package/dist/src/lib/services/{aws/appconfig → appconfig}/index.js +0 -0
  184. /package/dist/src/lib/services/{aws/appconfig → appconfig}/types.d.ts +0 -0
  185. /package/dist/src/lib/services/{aws/appconfig → appconfig}/types.js +0 -0
  186. /package/dist/src/lib/services/{aws/certificate-manager → certificate-manager}/index.d.ts +0 -0
  187. /package/dist/src/lib/services/{aws/certificate-manager → certificate-manager}/index.js +0 -0
  188. /package/dist/src/lib/services/{aws/certificate-manager → certificate-manager}/types.js +0 -0
  189. /package/dist/src/lib/services/{aws/cloudfront → cloudfront}/index.d.ts +0 -0
  190. /package/dist/src/lib/services/{aws/cloudfront → cloudfront}/index.js +0 -0
  191. /package/dist/src/lib/services/{aws/cloudfront → cloudfront}/types.js +0 -0
  192. /package/dist/src/lib/services/{aws/cloudtrail → cloudtrail}/index.d.ts +0 -0
  193. /package/dist/src/lib/services/{aws/cloudtrail → cloudtrail}/index.js +0 -0
  194. /package/dist/src/lib/services/{aws/cloudtrail → cloudtrail}/types.d.ts +0 -0
  195. /package/dist/src/lib/services/{aws/cloudtrail → cloudtrail}/types.js +0 -0
  196. /package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/index.d.ts +0 -0
  197. /package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/index.js +0 -0
  198. /package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/types.js +0 -0
  199. /package/dist/src/lib/services/{aws/codebuild → codebuild}/index.d.ts +0 -0
  200. /package/dist/src/lib/services/{aws/codebuild → codebuild}/index.js +0 -0
  201. /package/dist/src/lib/services/{aws/constants.d.ts → constants.d.ts} +0 -0
  202. /package/dist/src/lib/services/{aws/constants.js → constants.js} +0 -0
  203. /package/dist/src/lib/services/{aws/dynamodb → dynamodb}/index.d.ts +0 -0
  204. /package/dist/src/lib/services/{aws/dynamodb → dynamodb}/index.js +0 -0
  205. /package/dist/src/lib/services/{aws/dynamodb → dynamodb}/types.js +0 -0
  206. /package/dist/src/lib/services/{aws/elastic-container-registry → elastic-container-registry}/index.d.ts +0 -0
  207. /package/dist/src/lib/services/{aws/elastic-container-registry → elastic-container-registry}/index.js +0 -0
  208. /package/dist/src/lib/services/{aws/elastic-container-service → elastic-container-service}/index.d.ts +0 -0
  209. /package/dist/src/lib/services/{aws/elastic-container-service → elastic-container-service}/index.js +0 -0
  210. /package/dist/src/lib/services/{aws/elastic-container-service → elastic-container-service}/types.js +0 -0
  211. /package/dist/src/lib/services/{aws/elastic-file-system → elastic-file-system}/index.d.ts +0 -0
  212. /package/dist/src/lib/services/{aws/elastic-file-system → elastic-file-system}/index.js +0 -0
  213. /package/dist/src/lib/services/{aws/elastic-file-system → elastic-file-system}/types.d.ts +0 -0
  214. /package/dist/src/lib/services/{aws/elastic-file-system → elastic-file-system}/types.js +0 -0
  215. /package/dist/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/index.d.ts +0 -0
  216. /package/dist/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/index.js +0 -0
  217. /package/dist/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/types.d.ts +0 -0
  218. /package/dist/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/types.js +0 -0
  219. /package/dist/src/lib/services/{aws/elasticache → elasticache}/index.d.ts +0 -0
  220. /package/dist/src/lib/services/{aws/elasticache → elasticache}/index.js +0 -0
  221. /package/dist/src/lib/services/{aws/elasticache → elasticache}/types.d.ts +0 -0
  222. /package/dist/src/lib/services/{aws/elasticache → elasticache}/types.js +0 -0
  223. /package/dist/src/lib/services/{aws/eventbridge → eventbridge}/index.d.ts +0 -0
  224. /package/dist/src/lib/services/{aws/eventbridge → eventbridge}/index.js +0 -0
  225. /package/dist/src/lib/services/{aws/eventbridge → eventbridge}/types.js +0 -0
  226. /package/dist/src/lib/services/{aws/evidently → evidently}/index.d.ts +0 -0
  227. /package/dist/src/lib/services/{aws/evidently → evidently}/index.js +0 -0
  228. /package/dist/src/lib/services/{aws/evidently → evidently}/types.d.ts +0 -0
  229. /package/dist/src/lib/services/{aws/evidently → evidently}/types.js +0 -0
  230. /package/dist/src/lib/services/{aws/identity-access-management → identity-access-management}/index.d.ts +0 -0
  231. /package/dist/src/lib/services/{aws/identity-access-management → identity-access-management}/index.js +0 -0
  232. /package/dist/src/lib/services/{aws/key-management-service → key-management-service}/index.d.ts +0 -0
  233. /package/dist/src/lib/services/{aws/key-management-service → key-management-service}/index.js +0 -0
  234. /package/dist/src/lib/services/{aws/key-management-service → key-management-service}/types.d.ts +0 -0
  235. /package/dist/src/lib/services/{aws/key-management-service → key-management-service}/types.js +0 -0
  236. /package/dist/src/lib/services/{aws/lambda → lambda}/index.d.ts +0 -0
  237. /package/dist/src/lib/services/{aws/lambda → lambda}/index.js +0 -0
  238. /package/dist/src/lib/services/{aws/lambda → lambda}/types.js +0 -0
  239. /package/dist/src/lib/services/{aws/route53 → route53}/index.d.ts +0 -0
  240. /package/dist/src/lib/services/{aws/route53 → route53}/index.js +0 -0
  241. /package/dist/src/lib/services/{aws/route53 → route53}/types.d.ts +0 -0
  242. /package/dist/src/lib/services/{aws/route53 → route53}/types.js +0 -0
  243. /package/dist/src/lib/services/{aws/secrets-manager → secrets-manager}/index.d.ts +0 -0
  244. /package/dist/src/lib/services/{aws/secrets-manager → secrets-manager}/index.js +0 -0
  245. /package/dist/src/lib/services/{aws/simple-notification-service → simple-notification-service}/index.d.ts +0 -0
  246. /package/dist/src/lib/services/{aws/simple-notification-service → simple-notification-service}/index.js +0 -0
  247. /package/dist/src/lib/services/{aws/simple-notification-service → simple-notification-service}/types.d.ts +0 -0
  248. /package/dist/src/lib/services/{aws/simple-notification-service → simple-notification-service}/types.js +0 -0
  249. /package/dist/src/lib/services/{aws/simple-queue-service → simple-queue-service}/index.d.ts +0 -0
  250. /package/dist/src/lib/services/{aws/simple-queue-service → simple-queue-service}/index.js +0 -0
  251. /package/dist/src/lib/services/{aws/simple-queue-service → simple-queue-service}/types.js +0 -0
  252. /package/dist/src/lib/services/{aws/simple-storage-service → simple-storage-service}/index.d.ts +0 -0
  253. /package/dist/src/lib/services/{aws/simple-storage-service → simple-storage-service}/index.js +0 -0
  254. /package/dist/src/lib/services/{aws/simple-storage-service → simple-storage-service}/types.js +0 -0
  255. /package/dist/src/lib/services/{aws/step-function → step-function}/index.d.ts +0 -0
  256. /package/dist/src/lib/services/{aws/step-function → step-function}/index.js +0 -0
  257. /package/dist/src/lib/services/{aws/step-function → step-function}/types.d.ts +0 -0
  258. /package/dist/src/lib/services/{aws/step-function → step-function}/types.js +0 -0
  259. /package/dist/src/lib/services/{aws/systems-manager → systems-manager}/index.d.ts +0 -0
  260. /package/dist/src/lib/services/{aws/systems-manager → systems-manager}/index.js +0 -0
  261. /package/dist/src/lib/services/{aws/systems-manager → systems-manager}/types.d.ts +0 -0
  262. /package/dist/src/lib/services/{aws/systems-manager → systems-manager}/types.js +0 -0
  263. /package/dist/src/lib/services/{aws/virtual-private-cloud → virtual-private-cloud}/index.d.ts +0 -0
  264. /package/dist/src/lib/services/{aws/virtual-private-cloud → virtual-private-cloud}/index.js +0 -0
  265. /package/dist/src/lib/services/{aws/web-application-firewall → web-application-firewall}/index.d.ts +0 -0
  266. /package/dist/src/lib/services/{aws/web-application-firewall → web-application-firewall}/index.js +0 -0
  267. /package/dist/src/lib/services/{aws/web-application-firewall → web-application-firewall}/types.d.ts +0 -0
  268. /package/dist/src/lib/services/{aws/web-application-firewall → web-application-firewall}/types.js +0 -0
  269. /package/src/lib/services/{aws/api-gateway → api-gateway}/index.ts +0 -0
  270. /package/src/lib/services/{aws/appconfig → appconfig}/constants.ts +0 -0
  271. /package/src/lib/services/{aws/appconfig → appconfig}/index.ts +0 -0
  272. /package/src/lib/services/{aws/appconfig → appconfig}/types.ts +0 -0
  273. /package/src/lib/services/{aws/certificate-manager → certificate-manager}/index.ts +0 -0
  274. /package/src/lib/services/{aws/cloudfront → cloudfront}/index.ts +0 -0
  275. /package/src/lib/services/{aws/cloudtrail → cloudtrail}/index.ts +0 -0
  276. /package/src/lib/services/{aws/cloudtrail → cloudtrail}/types.ts +0 -0
  277. /package/src/lib/services/{aws/cloudwatch → cloudwatch}/index.ts +0 -0
  278. /package/src/lib/services/{aws/codebuild → codebuild}/index.ts +0 -0
  279. /package/src/lib/services/{aws/constants.ts → constants.ts} +0 -0
  280. /package/src/lib/services/{aws/dynamodb → dynamodb}/index.ts +0 -0
  281. /package/src/lib/services/{aws/elastic-container-registry → elastic-container-registry}/index.ts +0 -0
  282. /package/src/lib/services/{aws/elastic-container-service → elastic-container-service}/index.ts +0 -0
  283. /package/src/lib/services/{aws/elastic-file-system → elastic-file-system}/index.ts +0 -0
  284. /package/src/lib/services/{aws/elastic-file-system → elastic-file-system}/types.ts +0 -0
  285. /package/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/index.ts +0 -0
  286. /package/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/types.ts +0 -0
  287. /package/src/lib/services/{aws/elasticache → elasticache}/index.ts +0 -0
  288. /package/src/lib/services/{aws/elasticache → elasticache}/types.ts +0 -0
  289. /package/src/lib/services/{aws/eventbridge → eventbridge}/index.ts +0 -0
  290. /package/src/lib/services/{aws/evidently → evidently}/index.ts +0 -0
  291. /package/src/lib/services/{aws/evidently → evidently}/types.ts +0 -0
  292. /package/src/lib/services/{aws/identity-access-management → identity-access-management}/index.ts +0 -0
  293. /package/src/lib/services/{aws/key-management-service → key-management-service}/index.ts +0 -0
  294. /package/src/lib/services/{aws/key-management-service → key-management-service}/types.ts +0 -0
  295. /package/src/lib/services/{aws/lambda → lambda}/index.ts +0 -0
  296. /package/src/lib/services/{aws/route53 → route53}/index.ts +0 -0
  297. /package/src/lib/services/{aws/route53 → route53}/types.ts +0 -0
  298. /package/src/lib/services/{aws/secrets-manager → secrets-manager}/index.ts +0 -0
  299. /package/src/lib/services/{aws/simple-notification-service → simple-notification-service}/index.ts +0 -0
  300. /package/src/lib/services/{aws/simple-notification-service → simple-notification-service}/types.ts +0 -0
  301. /package/src/lib/services/{aws/simple-queue-service → simple-queue-service}/index.ts +0 -0
  302. /package/src/lib/services/{aws/simple-storage-service → simple-storage-service}/index.ts +0 -0
  303. /package/src/lib/services/{aws/step-function → step-function}/index.ts +0 -0
  304. /package/src/lib/services/{aws/step-function → step-function}/types.ts +0 -0
  305. /package/src/lib/services/{aws/systems-manager → systems-manager}/index.ts +0 -0
  306. /package/src/lib/services/{aws/systems-manager → systems-manager}/types.ts +0 -0
  307. /package/src/lib/services/{aws/virtual-private-cloud → virtual-private-cloud}/index.ts +0 -0
  308. /package/src/lib/services/{aws/web-application-firewall → web-application-firewall}/index.ts +0 -0
  309. /package/src/lib/services/{aws/web-application-firewall → web-application-firewall}/types.ts +0 -0
@@ -1,11 +1,11 @@
1
- import * as cdk from 'aws-cdk-lib'
2
- import * as ec2 from 'aws-cdk-lib/aws-ec2'
3
- import * as elasticache from 'aws-cdk-lib/aws-elasticache'
4
- import * as iam from 'aws-cdk-lib/aws-iam'
1
+ import { Fn } from 'aws-cdk-lib'
2
+ import { ISecurityGroup, IVpc, Peer, Port, SecurityGroup } from 'aws-cdk-lib/aws-ec2'
3
+ import { CfnReplicationGroup } from 'aws-cdk-lib/aws-elasticache'
4
+ import { ManagedPolicy } from 'aws-cdk-lib/aws-iam'
5
5
  import { Construct } from 'constructs'
6
6
  import { RestApiLambda } from '..'
7
+ import { createCfnOutput } from '../../utils'
7
8
  import { RestApiLambdaWithCacheProps } from './types'
8
- import * as utils from '../../utils'
9
9
 
10
10
  /**
11
11
  * @classdesc Provides a construct to create and deploy a RestApi API as Lambda with Caching
@@ -30,9 +30,9 @@ export abstract class RestApiLambdaWithCache extends RestApiLambda {
30
30
  id: string
31
31
 
32
32
  /* restApiLambda resources */
33
- restApivpc: ec2.IVpc
34
- restApiCache: elasticache.CfnReplicationGroup
35
- restApiSecurityGroup: ec2.ISecurityGroup
33
+ restApivpc: IVpc
34
+ restApiCache: CfnReplicationGroup
35
+ restApiSecurityGroup: ISecurityGroup
36
36
  restApiSecurityGroupExportName: string
37
37
 
38
38
  protected constructor(parent: Construct, id: string, props: RestApiLambdaWithCacheProps) {
@@ -65,20 +65,20 @@ export abstract class RestApiLambdaWithCache extends RestApiLambda {
65
65
  */
66
66
  protected resolveSecurityGroup() {
67
67
  if (this.props.securityGroupExportName) {
68
- this.restApiSecurityGroup = ec2.SecurityGroup.fromSecurityGroupId(
68
+ this.restApiSecurityGroup = SecurityGroup.fromSecurityGroupId(
69
69
  this,
70
70
  `${this.id}-security-group`,
71
- cdk.Fn.importValue(this.props.securityGroupExportName)
71
+ Fn.importValue(this.props.securityGroupExportName)
72
72
  )
73
73
  } else {
74
- this.restApiSecurityGroup = new ec2.SecurityGroup(this, `${this.id}-security-group-${this.props.stage}`, {
74
+ this.restApiSecurityGroup = new SecurityGroup(this, `${this.id}-security-group-${this.props.stage}`, {
75
75
  securityGroupName: `${this.id}-security-group-${this.props.stage}`,
76
76
  vpc: this.restApivpc,
77
77
  })
78
78
 
79
- this.restApiSecurityGroup.addIngressRule(ec2.Peer.anyIpv4(), ec2.Port.allTraffic(), 'All Traffic')
79
+ this.restApiSecurityGroup.addIngressRule(Peer.anyIpv4(), Port.allTraffic(), 'All Traffic')
80
80
 
81
- utils.createCfnOutput(`${this.id}-security-group-id`, this, this.restApiSecurityGroup.securityGroupId)
81
+ createCfnOutput(`${this.id}-security-group-id`, this, this.restApiSecurityGroup.securityGroupId)
82
82
  }
83
83
  }
84
84
 
@@ -118,7 +118,7 @@ export abstract class RestApiLambdaWithCache extends RestApiLambda {
118
118
  super.createLambdaRole()
119
119
 
120
120
  this.restApiLambdaRole.addManagedPolicy(
121
- iam.ManagedPolicy.fromAwsManagedPolicyName('service-role/AWSLambdaVPCAccessExecutionRole')
121
+ ManagedPolicy.fromAwsManagedPolicyName('service-role/AWSLambdaVPCAccessExecutionRole')
122
122
  )
123
123
  }
124
124
 
@@ -1,20 +1,40 @@
1
- import * as _ from 'lodash'
2
- import * as cdk from 'aws-cdk-lib'
3
- import * as certificateManager from 'aws-cdk-lib/aws-certificatemanager'
4
- import * as cloudfront from 'aws-cdk-lib/aws-cloudfront'
5
- import * as origins from 'aws-cdk-lib/aws-cloudfront-origins'
6
- import * as ec2 from 'aws-cdk-lib/aws-ec2'
7
- import * as ecs from 'aws-cdk-lib/aws-ecs'
8
- import * as ecsPatterns from 'aws-cdk-lib/aws-ecs-patterns'
9
- import * as elb from 'aws-cdk-lib/aws-elasticloadbalancingv2'
10
- import * as iam from 'aws-cdk-lib/aws-iam'
11
- import * as logs from 'aws-cdk-lib/aws-logs'
12
- import * as route53 from 'aws-cdk-lib/aws-route53'
13
- import * as s3 from 'aws-cdk-lib/aws-s3'
14
- import * as efs from 'aws-cdk-lib/aws-efs'
1
+ import { Duration } from 'aws-cdk-lib'
2
+ import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager'
3
+ import {
4
+ CachePolicy,
5
+ Distribution,
6
+ FunctionAssociation,
7
+ FunctionEventType,
8
+ IFunction,
9
+ OriginProtocolPolicy,
10
+ OriginRequestPolicy,
11
+ ResponseHeadersPolicy,
12
+ } from 'aws-cdk-lib/aws-cloudfront'
13
+ import { HttpOrigin } from 'aws-cdk-lib/aws-cloudfront-origins'
14
+ import { IVpc } from 'aws-cdk-lib/aws-ec2'
15
+ import {
16
+ AssetImage,
17
+ Cluster,
18
+ ContainerImage,
19
+ FargateService,
20
+ FargateTaskDefinition,
21
+ LogDriver,
22
+ } from 'aws-cdk-lib/aws-ecs'
23
+ import { ApplicationLoadBalancedFargateService } from 'aws-cdk-lib/aws-ecs-patterns'
24
+ import { FileSystem } from 'aws-cdk-lib/aws-efs'
25
+ import {
26
+ ApplicationListener,
27
+ ApplicationLoadBalancer,
28
+ ApplicationTargetGroup,
29
+ } from 'aws-cdk-lib/aws-elasticloadbalancingv2'
30
+ import { PolicyDocument, PolicyStatement, Role } from 'aws-cdk-lib/aws-iam'
31
+ import { LogGroup } from 'aws-cdk-lib/aws-logs'
32
+ import { IHostedZone } from 'aws-cdk-lib/aws-route53'
33
+ import { IBucket } from 'aws-cdk-lib/aws-s3'
15
34
  import { Construct } from 'constructs'
35
+ import _ from 'lodash'
16
36
  import { CommonConstruct } from '../../common'
17
- import { SiteWithEcsBackendProps, SiteResponseHeadersPolicyProps, SiteCachePolicyProps } from './types'
37
+ import { SiteCachePolicyProps, SiteResponseHeadersPolicyProps, SiteWithEcsBackendProps } from './types'
18
38
 
19
39
  /**
20
40
  * @classdesc Provides a construct to create and deploy a site hosted with an clustered ECS/ELB backend
@@ -37,35 +57,35 @@ export class SiteWithEcsBackend extends CommonConstruct {
37
57
  id: string
38
58
 
39
59
  /* site resources */
40
- siteHostedZone: route53.IHostedZone
41
- siteCertificate: certificateManager.ICertificate
42
- siteRegionalCertificate: certificateManager.ICertificate
43
- siteEcsPolicy: iam.PolicyDocument
44
- siteEcsRole: iam.Role
60
+ siteHostedZone: IHostedZone
61
+ siteCertificate: ICertificate
62
+ siteRegionalCertificate: ICertificate
63
+ siteEcsPolicy: PolicyDocument
64
+ siteEcsRole: Role
45
65
  siteEcsEnvironment: { [key: string]: string }
46
- siteVpc: ec2.IVpc
66
+ siteVpc: IVpc
47
67
  siteSecrets: any
48
- siteEcsCluster: ecs.Cluster
49
- siteEcsLogGroup: logs.LogGroup
68
+ siteEcsCluster: Cluster
69
+ siteEcsLogGroup: LogGroup
50
70
  siteEcsBuildArgs: any = {}
51
- siteEcsContainerImage: ecs.AssetImage
52
- siteEcsService: ecs.FargateService
53
- siteEcsTaskDefinition: ecs.FargateTaskDefinition
54
- siteEcsListener: elb.ApplicationListener
55
- siteEcsLoadBalancer: elb.ApplicationLoadBalancer
56
- siteEcsTargetGroup: elb.ApplicationTargetGroup
57
- siteFileSystem: efs.FileSystem
58
- siteLogBucket: s3.IBucket
59
- siteOrigin: origins.HttpOrigin
60
- siteDistribution: cloudfront.Distribution
71
+ siteEcsContainerImage: AssetImage
72
+ siteEcsService: FargateService
73
+ siteEcsTaskDefinition: FargateTaskDefinition
74
+ siteEcsListener: ApplicationListener
75
+ siteEcsLoadBalancer: ApplicationLoadBalancer
76
+ siteEcsTargetGroup: ApplicationTargetGroup
77
+ siteFileSystem: FileSystem
78
+ siteLogBucket: IBucket
79
+ siteOrigin: HttpOrigin
80
+ siteDistribution: Distribution
61
81
  siteInternalDomainName: string
62
82
  siteExternalDomainName: string
63
83
  siteDomainNames: string[]
64
- siteCloudfrontFunction: cloudfront.Function
65
- siteFunctionAssociations: cloudfront.FunctionAssociation[]
66
- siteOriginRequestPolicy: cloudfront.OriginRequestPolicy
67
- siteOriginResponseHeadersPolicy?: cloudfront.ResponseHeadersPolicy
68
- siteCachePolicy: cloudfront.CachePolicy
84
+ siteCloudfrontFunction: IFunction
85
+ siteFunctionAssociations: FunctionAssociation[]
86
+ siteOriginRequestPolicy: OriginRequestPolicy
87
+ siteOriginResponseHeadersPolicy?: ResponseHeadersPolicy
88
+ siteCachePolicy: CachePolicy
69
89
 
70
90
  constructor(parent: Construct, id: string, props: SiteWithEcsBackendProps) {
71
91
  super(parent, id, props)
@@ -203,7 +223,7 @@ export class SiteWithEcsBackend extends CommonConstruct {
203
223
  * @summary Method to create iam policy for ECS Task
204
224
  */
205
225
  protected createEcsPolicy() {
206
- this.siteEcsPolicy = new iam.PolicyDocument({
226
+ this.siteEcsPolicy = new PolicyDocument({
207
227
  statements: [this.iamManager.statementForCreateAnyLogStream()],
208
228
  })
209
229
  }
@@ -256,16 +276,16 @@ export class SiteWithEcsBackend extends CommonConstruct {
256
276
  * Method to create container image for ECS task
257
277
  */
258
278
  protected createEcsContainerImage() {
259
- this.siteEcsContainerImage = ecs.ContainerImage.fromAsset(this.props.siteEcsContainerImagePath, {
279
+ this.siteEcsContainerImage = ContainerImage.fromAsset(this.props.siteEcsContainerImagePath, {
260
280
  buildArgs: this.siteEcsBuildArgs,
261
281
  })
262
282
  }
263
283
 
264
284
  /**
265
- * Method to create Application Loadbalanced ECS Fargate Service
285
+ * Method to create Application Load balanced ECS Fargate Service
266
286
  */
267
287
  protected createEcsService() {
268
- const fargateService = new ecsPatterns.ApplicationLoadBalancedFargateService(this, `${this.id}-ecs-service`, {
288
+ const fargateService = new ApplicationLoadBalancedFargateService(this, `${this.id}-ecs-service`, {
269
289
  assignPublicIp: true,
270
290
  certificate: this.siteRegionalCertificate,
271
291
  cluster: this.siteEcsCluster,
@@ -274,7 +294,7 @@ export class SiteWithEcsBackend extends CommonConstruct {
274
294
  domainName: this.siteInternalDomainName,
275
295
  domainZone: this.siteHostedZone,
276
296
  enableECSManagedTags: true,
277
- healthCheckGracePeriod: cdk.Duration.seconds(60),
297
+ healthCheckGracePeriod: Duration.seconds(60),
278
298
  listenerPort: this.props.siteTask.listenerPort,
279
299
  loadBalancerName: this.props.siteTask.loadBalancerName
280
300
  ? `${this.props.siteTask.loadBalancerName}-${this.props.stage}`
@@ -290,7 +310,7 @@ export class SiteWithEcsBackend extends CommonConstruct {
290
310
  environment: this.siteEcsEnvironment,
291
311
  executionRole: this.siteEcsRole,
292
312
  image: this.siteEcsContainerImage,
293
- logDriver: ecs.LogDriver.awsLogs({
313
+ logDriver: LogDriver.awsLogs({
294
314
  logGroup: this.siteEcsLogGroup,
295
315
  logRetention: this.props.siteTask.logging?.logRetention,
296
316
  multilinePattern: this.props.siteTask.logging?.multilinePattern,
@@ -307,11 +327,11 @@ export class SiteWithEcsBackend extends CommonConstruct {
307
327
  healthyGrpcCodes: this.props.siteHealthCheck.healthyGrpcCodes,
308
328
  healthyHttpCodes: this.props.siteHealthCheck.healthyHttpCodes,
309
329
  healthyThresholdCount: this.props.siteHealthCheck.healthyThresholdCount,
310
- interval: cdk.Duration.seconds(this.props.siteHealthCheck.intervalInSecs),
330
+ interval: Duration.seconds(this.props.siteHealthCheck.intervalInSecs),
311
331
  path: this.props.siteHealthCheck.path ?? '/',
312
332
  port: this.props.siteHealthCheck.port,
313
333
  protocol: this.props.siteHealthCheck.protocol,
314
- timeout: cdk.Duration.seconds(this.props.siteHealthCheck.timeoutInSecs),
334
+ timeout: Duration.seconds(this.props.siteHealthCheck.timeoutInSecs),
315
335
  unhealthyThresholdCount: this.props.siteHealthCheck.unhealthyThresholdCount,
316
336
  })
317
337
  }
@@ -370,7 +390,7 @@ export class SiteWithEcsBackend extends CommonConstruct {
370
390
 
371
391
  /* add EFS permissions to ECS Role */
372
392
  this.siteEcsRole.addToPolicy(
373
- new iam.PolicyStatement(this.iamManager.statementForWriteEfs([this.siteFileSystem.fileSystemArn]))
393
+ new PolicyStatement(this.iamManager.statementForWriteEfs([this.siteFileSystem.fileSystemArn]))
374
394
  )
375
395
 
376
396
  /* add the efs volume to ecs task definition */
@@ -411,17 +431,16 @@ export class SiteWithEcsBackend extends CommonConstruct {
411
431
  }
412
432
 
413
433
  protected createSiteCachePolicy(id: string, siteCachePolicy: SiteCachePolicyProps) {
414
- return new cloudfront.CachePolicy(this, `${id}`, {
434
+ return new CachePolicy(this, `${id}`, {
415
435
  cachePolicyName: `${this.id}-${siteCachePolicy.cachePolicyName}`,
416
436
  comment: `Policy for ${this.id}-distribution - ${this.props.stage} stage`,
417
- defaultTtl: cdk.Duration.seconds(siteCachePolicy.defaultTtlInSeconds),
418
- minTtl: cdk.Duration.seconds(siteCachePolicy.minTtlInSeconds),
419
- maxTtl: cdk.Duration.seconds(siteCachePolicy.maxTtlInSeconds),
420
- enableAcceptEncodingGzip: siteCachePolicy.enableAcceptEncodingGzip,
437
+ cookieBehavior: siteCachePolicy.cookieBehavior,
421
438
  enableAcceptEncodingBrotli: siteCachePolicy.enableAcceptEncodingBrotli,
422
- queryStringBehavior: siteCachePolicy.queryStringBehavior,
439
+ enableAcceptEncodingGzip: siteCachePolicy.enableAcceptEncodingGzip,
423
440
  headerBehavior: siteCachePolicy.headerBehavior,
424
- cookieBehavior: siteCachePolicy.cookieBehavior,
441
+ maxTtl: Duration.seconds(siteCachePolicy.maxTtlInSeconds),
442
+ minTtl: Duration.seconds(siteCachePolicy.minTtlInSeconds),
443
+ queryStringBehavior: siteCachePolicy.queryStringBehavior,
425
444
  })
426
445
  }
427
446
 
@@ -435,7 +454,7 @@ export class SiteWithEcsBackend extends CommonConstruct {
435
454
 
436
455
  protected createSiteOriginRequestPolicy() {
437
456
  if (!this.props.siteOriginRequestPolicy) return
438
- this.siteOriginRequestPolicy = new cloudfront.OriginRequestPolicy(this, `${this.id}-sorp`, {
457
+ this.siteOriginRequestPolicy = new OriginRequestPolicy(this, `${this.id}-sorp`, {
439
458
  comment: `Request Policy for ${this.id}-distribution - ${this.props.stage} stage`,
440
459
  cookieBehavior: this.props.siteOriginRequestPolicy.cookieBehavior,
441
460
  headerBehavior: this.props.siteOriginRequestPolicy.headerBehavior,
@@ -450,7 +469,7 @@ export class SiteWithEcsBackend extends CommonConstruct {
450
469
 
451
470
  protected createResponseHeaderPolicy(props: SiteResponseHeadersPolicyProps) {
452
471
  if (!props) return undefined
453
- return new cloudfront.ResponseHeadersPolicy(this, `${this.id}-${props.type}-srhp`, {
472
+ return new ResponseHeadersPolicy(this, `${this.id}-${props.type}-srhp`, {
454
473
  ...props,
455
474
  comment: `Response Header Policy for ${props.type} for ${this.id}-distribution - ${this.props.stage} stage`,
456
475
  responseHeadersPolicyName: `${this.id}-${props.type}-response`,
@@ -458,7 +477,7 @@ export class SiteWithEcsBackend extends CommonConstruct {
458
477
  ...props.securityHeadersBehavior,
459
478
  strictTransportSecurity: {
460
479
  ...props.securityHeadersBehavior?.strictTransportSecurity,
461
- accessControlMaxAge: cdk.Duration.seconds(
480
+ accessControlMaxAge: Duration.seconds(
462
481
  props.securityHeadersBehavior?.strictTransportSecurity?.accessControlMaxAgeInSeconds
463
482
  ),
464
483
  },
@@ -475,10 +494,10 @@ export class SiteWithEcsBackend extends CommonConstruct {
475
494
  }
476
495
 
477
496
  protected createSiteOrigin() {
478
- this.siteOrigin = new origins.HttpOrigin(this.siteInternalDomainName, {
497
+ this.siteOrigin = new HttpOrigin(this.siteInternalDomainName, {
479
498
  httpPort: this.props.siteTask.listenerPort,
480
499
  originId: `${this.id}-server`,
481
- protocolPolicy: cloudfront.OriginProtocolPolicy.HTTPS_ONLY,
500
+ protocolPolicy: OriginProtocolPolicy.HTTPS_ONLY,
482
501
  })
483
502
  }
484
503
 
@@ -502,7 +521,7 @@ export class SiteWithEcsBackend extends CommonConstruct {
502
521
  if (this.props.siteCloudfrontFunctionProps) {
503
522
  this.siteFunctionAssociations = [
504
523
  {
505
- eventType: cloudfront.FunctionEventType.VIEWER_REQUEST,
524
+ eventType: FunctionEventType.VIEWER_REQUEST,
506
525
  function: this.siteCloudfrontFunction,
507
526
  },
508
527
  ]
@@ -1,7 +1,7 @@
1
- import { CommonConstruct } from '../../common'
1
+ import { IBucket } from 'aws-cdk-lib/aws-s3'
2
+ import { BucketDeployment } from 'aws-cdk-lib/aws-s3-deployment'
2
3
  import { Construct } from 'constructs'
3
- import * as s3 from 'aws-cdk-lib/aws-s3'
4
- import * as s3deploy from 'aws-cdk-lib/aws-s3-deployment'
4
+ import { CommonConstruct } from '../../common'
5
5
  import { StaticAssetDeploymentProps } from './types'
6
6
 
7
7
  /**
@@ -25,7 +25,7 @@ export class StaticAssetDeployment extends CommonConstruct {
25
25
  id: string
26
26
 
27
27
  /* construct resources */
28
- staticAssetBucket: s3.IBucket
28
+ staticAssetBucket: IBucket
29
29
 
30
30
  constructor(parent: Construct, id: string, props: StaticAssetDeploymentProps) {
31
31
  super(parent, id, props)
@@ -49,10 +49,10 @@ export class StaticAssetDeployment extends CommonConstruct {
49
49
  }
50
50
 
51
51
  /**
52
- * @summary Deploy the static assests into the static asset bucket
52
+ * @summary Deploy the static assets into the static asset bucket
53
53
  */
54
54
  protected deployStaticAssets() {
55
- new s3deploy.BucketDeployment(this, `${this.id}-static-deployment`, {
55
+ new BucketDeployment(this, `${this.id}-static-deployment`, {
56
56
  ...this.props.staticAssetDeployment,
57
57
  destinationBucket: this.staticAssetBucket,
58
58
  sources: this.props.staticAssetSources,
@@ -1,8 +1,14 @@
1
- import * as certificateManager from 'aws-cdk-lib/aws-certificatemanager'
2
- import * as cloudfront from 'aws-cdk-lib/aws-cloudfront'
3
- import * as origins from 'aws-cdk-lib/aws-cloudfront-origins'
4
- import * as route53 from 'aws-cdk-lib/aws-route53'
5
- import * as s3 from 'aws-cdk-lib/aws-s3'
1
+ import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager'
2
+ import {
3
+ FunctionAssociation,
4
+ FunctionEventType,
5
+ IDistribution,
6
+ IFunction,
7
+ OriginAccessIdentity,
8
+ } from 'aws-cdk-lib/aws-cloudfront'
9
+ import { S3Origin } from 'aws-cdk-lib/aws-cloudfront-origins'
10
+ import { ARecord, IHostedZone } from 'aws-cdk-lib/aws-route53'
11
+ import { IBucket } from 'aws-cdk-lib/aws-s3'
6
12
  import { Construct } from 'constructs'
7
13
  import { CommonConstruct } from '../../common'
8
14
  import { StaticSiteProps } from './types'
@@ -28,16 +34,16 @@ export class StaticSite extends CommonConstruct {
28
34
  id: string
29
35
 
30
36
  /* static site resources */
31
- siteHostedZone: route53.IHostedZone
32
- siteCertificate: certificateManager.ICertificate
33
- siteARecord: route53.ARecord
34
- siteBucket: s3.IBucket
35
- siteOrigin: origins.S3Origin
36
- siteDistribution: cloudfront.IDistribution
37
- siteLogBucket: s3.IBucket
38
- siteOriginAccessIdentity: cloudfront.OriginAccessIdentity
39
- siteCloudfrontFunction: cloudfront.Function
40
- siteFunctionAssociations: cloudfront.FunctionAssociation[]
37
+ siteHostedZone: IHostedZone
38
+ siteCertificate: ICertificate
39
+ siteARecord: ARecord
40
+ siteBucket: IBucket
41
+ siteOrigin: S3Origin
42
+ siteDistribution: IDistribution
43
+ siteLogBucket: IBucket
44
+ siteOriginAccessIdentity: OriginAccessIdentity
45
+ siteCloudfrontFunction: IFunction
46
+ siteFunctionAssociations: FunctionAssociation[]
41
47
 
42
48
  constructor(parent: Construct, id: string, props: StaticSiteProps) {
43
49
  super(parent, id, props)
@@ -113,7 +119,7 @@ export class StaticSite extends CommonConstruct {
113
119
  }
114
120
 
115
121
  protected createSiteOrigin() {
116
- this.siteOrigin = new origins.S3Origin(this.siteBucket)
122
+ this.siteOrigin = new S3Origin(this.siteBucket)
117
123
  }
118
124
 
119
125
  /**
@@ -136,7 +142,7 @@ export class StaticSite extends CommonConstruct {
136
142
  if (this.props.siteCloudfrontFunctionProps) {
137
143
  this.siteFunctionAssociations = [
138
144
  {
139
- eventType: cloudfront.FunctionEventType.VIEWER_REQUEST,
145
+ eventType: FunctionEventType.VIEWER_REQUEST,
140
146
  function: this.siteCloudfrontFunction,
141
147
  },
142
148
  ]
@@ -1,10 +1,21 @@
1
- import * as apig from 'aws-cdk-lib/aws-apigateway'
2
- import * as acm from 'aws-cdk-lib/aws-certificatemanager'
3
- import * as lambda from 'aws-cdk-lib/aws-lambda'
4
- import * as utils from '../../../utils'
5
- import * as cdk from 'aws-cdk-lib'
1
+ import { Tags } from 'aws-cdk-lib'
2
+ import {
3
+ Cors,
4
+ Deployment,
5
+ DomainName,
6
+ EndpointType,
7
+ IAuthorizer,
8
+ IResource,
9
+ IRestApi,
10
+ Integration,
11
+ LambdaRestApi,
12
+ SecurityPolicy,
13
+ } from 'aws-cdk-lib/aws-apigateway'
14
+ import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager'
15
+ import { IFunction } from 'aws-cdk-lib/aws-lambda'
16
+ import { CommonConstruct } from '../../common'
17
+ import { createCfnOutput } from '../../utils'
6
18
  import { LambdaRestApiProps } from './types'
7
- import { CommonConstruct } from '../../../common'
8
19
 
9
20
  /**
10
21
  * @classdesc Provides operations on AWS API Gateway.
@@ -14,7 +25,7 @@ import { CommonConstruct } from '../../../common'
14
25
  * import { CommonConstruct } from '@gradientedge/cdk-utils'
15
26
  *
16
27
  * class CustomConstruct extends CommonConstruct {
17
- * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
28
+ * constructor(parent: Construct, id: string, props: common.CommonStackProps) {
18
29
  * super(parent, id, props)
19
30
  * this.props = props
20
31
  * const lambdaFunction = this.lambdaManager.createLambdaFunction('MyFunction', this, role, layers, code)
@@ -31,14 +42,9 @@ export class ApiManager {
31
42
  * @param props lambda rest restApi props
32
43
  * @param lambdaFunction
33
44
  */
34
- public createLambdaRestApi(
35
- id: string,
36
- scope: CommonConstruct,
37
- props: LambdaRestApiProps,
38
- lambdaFunction: lambda.IFunction
39
- ) {
45
+ public createLambdaRestApi(id: string, scope: CommonConstruct, props: LambdaRestApiProps, lambdaFunction: IFunction) {
40
46
  if (!props) throw `Api props undefined for ${id}`
41
- const api = new apig.LambdaRestApi(scope, `${id}`, {
47
+ const api = new LambdaRestApi(scope, `${id}`, {
42
48
  binaryMediaTypes: props.binaryMediaTypes,
43
49
  cloudWatchRole: props.cloudWatchRole || false,
44
50
  defaultCorsPreflightOptions: props.defaultCorsPreflightOptions,
@@ -63,7 +69,7 @@ export class ApiManager {
63
69
  },
64
70
  domainName: props.domainName,
65
71
  endpointConfiguration: {
66
- types: props.endpointConfiguration?.types || [apig.EndpointType.REGIONAL],
72
+ types: props.endpointConfiguration?.types || [EndpointType.REGIONAL],
67
73
  vpcEndpoints: props.endpointConfiguration?.vpcEndpoints,
68
74
  },
69
75
  endpointTypes: props.endpointTypes,
@@ -79,12 +85,12 @@ export class ApiManager {
79
85
 
80
86
  if (props.tags && props.tags.length > 0) {
81
87
  props.tags.forEach(tag => {
82
- cdk.Tags.of(api).add(tag.key, tag.value)
88
+ Tags.of(api).add(tag.key, tag.value)
83
89
  })
84
90
  }
85
91
 
86
- utils.createCfnOutput(`${id}-restApiId`, scope, api.restApiId)
87
- utils.createCfnOutput(`${id}-restApiName`, scope, api.restApiName)
92
+ createCfnOutput(`${id}-restApiId`, scope, api.restApiId)
93
+ createCfnOutput(`${id}-restApiName`, scope, api.restApiName)
88
94
 
89
95
  return api
90
96
  }
@@ -96,15 +102,15 @@ export class ApiManager {
96
102
  * @param domainName the domain name to use
97
103
  * @param certificate the certificate used for custom restApi domain
98
104
  */
99
- public createApiDomain(id: string, scope: CommonConstruct, domainName: string, certificate: acm.ICertificate) {
100
- const apiDomain = new apig.DomainName(scope, `${id}`, {
105
+ public createApiDomain(id: string, scope: CommonConstruct, domainName: string, certificate: ICertificate) {
106
+ const apiDomain = new DomainName(scope, `${id}`, {
101
107
  certificate: certificate,
102
108
  domainName: domainName,
103
- endpointType: scope.isProductionStage() ? apig.EndpointType.EDGE : apig.EndpointType.REGIONAL,
104
- securityPolicy: apig.SecurityPolicy.TLS_1_2,
109
+ endpointType: scope.isProductionStage() ? EndpointType.EDGE : EndpointType.REGIONAL,
110
+ securityPolicy: SecurityPolicy.TLS_1_2,
105
111
  })
106
112
 
107
- utils.createCfnOutput(`${id}-customDomainName`, scope, apiDomain.domainName)
113
+ createCfnOutput(`${id}-customDomainName`, scope, apiDomain.domainName)
108
114
 
109
115
  return apiDomain
110
116
  }
@@ -127,24 +133,24 @@ export class ApiManager {
127
133
  public createApiResource(
128
134
  id: string,
129
135
  scope: CommonConstruct,
130
- parent: apig.IResource,
136
+ parent: IResource,
131
137
  path: string,
132
- integration: apig.Integration,
138
+ integration: Integration,
133
139
  addProxy: boolean,
134
- authorizer?: apig.IAuthorizer,
140
+ authorizer?: IAuthorizer,
135
141
  allowedOrigins?: string[],
136
142
  allowedMethods?: string[],
137
143
  allowedHeaders?: string[],
138
144
  methodRequestParameters?: { [param: string]: boolean },
139
- proxyIntegration?: apig.Integration
145
+ proxyIntegration?: Integration
140
146
  ) {
141
- const methods = allowedMethods ?? apig.Cors.ALL_METHODS
147
+ const methods = allowedMethods ?? Cors.ALL_METHODS
142
148
  const resource = parent.addResource(path, {
143
149
  defaultCorsPreflightOptions: {
144
150
  allowCredentials: true,
145
- allowHeaders: allowedHeaders ?? apig.Cors.DEFAULT_HEADERS,
151
+ allowHeaders: allowedHeaders ?? Cors.DEFAULT_HEADERS,
146
152
  allowMethods: [...methods, 'OPTIONS'],
147
- allowOrigins: allowedOrigins ?? apig.Cors.ALL_ORIGINS,
153
+ allowOrigins: allowedOrigins ?? Cors.ALL_ORIGINS,
148
154
  },
149
155
  })
150
156
  methods.forEach(method =>
@@ -153,15 +159,15 @@ export class ApiManager {
153
159
  requestParameters: methodRequestParameters,
154
160
  })
155
161
  )
156
- utils.createCfnOutput(`${id}-${path}ResourceId`, scope, resource.resourceId)
162
+ createCfnOutput(`${id}-${path}ResourceId`, scope, resource.resourceId)
157
163
 
158
164
  if (addProxy) {
159
165
  const resourceProxy = resource.addResource(`{${path}+}`, {
160
166
  defaultCorsPreflightOptions: {
161
167
  allowCredentials: true,
162
- allowHeaders: allowedHeaders ?? apig.Cors.DEFAULT_HEADERS,
168
+ allowHeaders: allowedHeaders ?? Cors.DEFAULT_HEADERS,
163
169
  allowMethods: [...methods, 'OPTIONS'],
164
- allowOrigins: allowedOrigins ?? apig.Cors.ALL_ORIGINS,
170
+ allowOrigins: allowedOrigins ?? Cors.ALL_ORIGINS,
165
171
  },
166
172
  })
167
173
  methods.forEach(method =>
@@ -170,7 +176,7 @@ export class ApiManager {
170
176
  requestParameters: methodRequestParameters,
171
177
  })
172
178
  )
173
- utils.createCfnOutput(`${id}-${path}ProxyResourceId`, scope, resourceProxy.resourceId)
179
+ createCfnOutput(`${id}-${path}ProxyResourceId`, scope, resourceProxy.resourceId)
174
180
  }
175
181
 
176
182
  return resource
@@ -182,8 +188,8 @@ export class ApiManager {
182
188
  * @param scope
183
189
  * @param restApi
184
190
  */
185
- public createApiDeployment(id: string, scope: CommonConstruct, restApi: apig.IRestApi) {
186
- new apig.Deployment(scope, `${id}`, {
191
+ public createApiDeployment(id: string, scope: CommonConstruct, restApi: IRestApi) {
192
+ new Deployment(scope, `${id}`, {
187
193
  api: restApi,
188
194
  retainDeployments: false,
189
195
  })
@@ -0,0 +1,8 @@
1
+ import { LambdaRestApiProps as LambdaRestApigProps } from 'aws-cdk-lib/aws-apigateway'
2
+ import { TagProps } from '../../types'
3
+
4
+ /**
5
+ */
6
+ export interface LambdaRestApiProps extends LambdaRestApigProps {
7
+ tags?: TagProps[]
8
+ }