@gradientedge/cdk-utils 8.120.0 → 8.122.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 (464) hide show
  1. package/README.md +2 -1
  2. package/dist/index.d.ts +1 -5
  3. package/dist/index.js +1 -5
  4. package/dist/src/lib/aws/common/construct.d.ts +83 -0
  5. package/dist/src/lib/aws/common/construct.js +126 -0
  6. package/dist/src/lib/aws/common/index.d.ts +3 -0
  7. package/dist/src/lib/aws/common/index.js +19 -0
  8. package/dist/src/lib/aws/common/stack.d.ts +56 -0
  9. package/dist/src/lib/aws/common/stack.js +141 -0
  10. package/dist/src/lib/aws/common/types.d.ts +14 -0
  11. package/dist/src/lib/aws/index.d.ts +5 -0
  12. package/dist/src/lib/aws/index.js +21 -0
  13. package/dist/src/lib/aws/types/index.js +2 -0
  14. package/dist/src/lib/{utils/aws → aws/utils}/index.d.ts +29 -1
  15. package/dist/src/lib/{utils/aws → aws/utils}/index.js +32 -1
  16. package/dist/src/lib/azure/common/construct.d.ts +35 -0
  17. package/dist/src/lib/azure/common/construct.js +49 -0
  18. package/dist/src/lib/azure/common/index.d.ts +3 -0
  19. package/dist/src/lib/azure/common/index.js +19 -0
  20. package/dist/src/lib/azure/common/stack.d.ts +52 -0
  21. package/dist/src/lib/azure/common/stack.js +136 -0
  22. package/dist/src/lib/azure/common/types.d.ts +7 -0
  23. package/dist/src/lib/azure/common/types.js +2 -0
  24. package/dist/src/lib/azure/index.d.ts +4 -0
  25. package/dist/src/lib/azure/index.js +20 -0
  26. package/dist/src/lib/azure/services/index.d.ts +1 -0
  27. package/dist/src/lib/azure/services/index.js +17 -0
  28. package/dist/src/lib/azure/services/storage/index.d.ts +2 -0
  29. package/dist/src/lib/azure/services/storage/index.js +18 -0
  30. package/dist/src/lib/azure/services/storage/main.d.ts +43 -0
  31. package/dist/src/lib/azure/services/storage/main.js +124 -0
  32. package/dist/src/lib/azure/services/storage/types.d.ts +10 -0
  33. package/dist/src/lib/azure/services/storage/types.js +2 -0
  34. package/dist/src/lib/azure/types/index.d.ts +3 -0
  35. package/dist/src/lib/azure/types/index.js +2 -0
  36. package/dist/src/lib/azure/utils/index.d.ts +3 -0
  37. package/dist/src/lib/azure/utils/index.js +20 -0
  38. package/dist/src/lib/common/construct.d.ts +8 -63
  39. package/dist/src/lib/common/construct.js +3 -128
  40. package/dist/src/lib/common/index.d.ts +2 -0
  41. package/dist/src/lib/common/index.js +10 -0
  42. package/dist/src/lib/common/stack.d.ts +11 -46
  43. package/dist/src/lib/common/stack.js +4 -137
  44. package/dist/src/lib/common/types.d.ts +5 -16
  45. package/dist/src/lib/common/utils.d.ts +26 -0
  46. package/dist/src/lib/common/utils.js +34 -0
  47. package/dist/src/lib/index.d.ts +2 -4
  48. package/dist/src/lib/index.js +2 -4
  49. package/index.ts +1 -5
  50. package/package.json +3 -1
  51. package/setup.js +2 -0
  52. package/src/lib/aws/common/construct.ts +164 -0
  53. package/src/lib/aws/common/index.ts +3 -0
  54. package/src/lib/aws/common/stack.ts +150 -0
  55. package/src/lib/aws/common/types.ts +15 -0
  56. package/src/lib/aws/index.ts +5 -0
  57. package/src/lib/{utils/aws → aws/utils}/index.ts +33 -1
  58. package/src/lib/azure/common/construct.ts +57 -0
  59. package/src/lib/azure/common/index.ts +3 -0
  60. package/src/lib/azure/common/stack.ts +145 -0
  61. package/src/lib/azure/common/types.ts +8 -0
  62. package/src/lib/azure/index.ts +4 -0
  63. package/src/lib/azure/services/index.ts +1 -0
  64. package/src/lib/azure/services/storage/index.ts +2 -0
  65. package/src/lib/azure/services/storage/main.ts +134 -0
  66. package/src/lib/azure/services/storage/types.ts +10 -0
  67. package/src/lib/azure/types/index.ts +3 -0
  68. package/src/lib/azure/utils/index.ts +23 -0
  69. package/src/lib/common/construct.ts +8 -148
  70. package/src/lib/common/index.ts +13 -0
  71. package/src/lib/common/stack.ts +11 -135
  72. package/src/lib/common/types.ts +5 -17
  73. package/src/lib/common/utils.ts +27 -0
  74. package/src/lib/index.ts +2 -4
  75. package/dist/src/lib/types/index.d.ts +0 -1
  76. package/dist/src/lib/types/index.js +0 -17
  77. package/dist/src/lib/utils/index.d.ts +0 -55
  78. package/dist/src/lib/utils/index.js +0 -80
  79. package/src/lib/types/index.ts +0 -1
  80. package/src/lib/utils/index.ts +0 -61
  81. /package/dist/src/lib/{construct/api-to-any-target → aws/common}/types.js +0 -0
  82. /package/dist/src/lib/{construct → aws/construct}/api-to-any-target/index.d.ts +0 -0
  83. /package/dist/src/lib/{construct → aws/construct}/api-to-any-target/index.js +0 -0
  84. /package/dist/src/lib/{construct → aws/construct}/api-to-any-target/main.d.ts +0 -0
  85. /package/dist/src/lib/{construct → aws/construct}/api-to-any-target/main.js +0 -0
  86. /package/dist/src/lib/{construct → aws/construct}/api-to-any-target/target.d.ts +0 -0
  87. /package/dist/src/lib/{construct → aws/construct}/api-to-any-target/target.js +0 -0
  88. /package/dist/src/lib/{construct → aws/construct}/api-to-any-target/types.d.ts +0 -0
  89. /package/dist/src/lib/{construct/api-to-eventbridge-target-with-sns → aws/construct/api-to-any-target}/types.js +0 -0
  90. /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target/api.d.ts +0 -0
  91. /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target/api.js +0 -0
  92. /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target/event.d.ts +0 -0
  93. /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target/event.js +0 -0
  94. /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target/index.d.ts +0 -0
  95. /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target/index.js +0 -0
  96. /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target/main.d.ts +0 -0
  97. /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target/main.js +0 -0
  98. /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target/types.d.ts +0 -0
  99. /package/dist/src/lib/{construct/api-to-lambda-target → aws/construct/api-to-eventbridge-target}/types.js +0 -0
  100. /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +0 -0
  101. /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/api-destined-lambda.js +0 -0
  102. /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/index.d.ts +0 -0
  103. /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/index.js +0 -0
  104. /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/main.d.ts +0 -0
  105. /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/main.js +0 -0
  106. /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/types.d.ts +0 -0
  107. /package/dist/src/lib/{construct/api-to-eventbridge-target → aws/construct/api-to-eventbridge-target-with-sns}/types.js +0 -0
  108. /package/dist/src/lib/{construct → aws/construct}/api-to-lambda-target/api.d.ts +0 -0
  109. /package/dist/src/lib/{construct → aws/construct}/api-to-lambda-target/api.js +0 -0
  110. /package/dist/src/lib/{construct → aws/construct}/api-to-lambda-target/index.d.ts +0 -0
  111. /package/dist/src/lib/{construct → aws/construct}/api-to-lambda-target/index.js +0 -0
  112. /package/dist/src/lib/{construct → aws/construct}/api-to-lambda-target/main.d.ts +0 -0
  113. /package/dist/src/lib/{construct → aws/construct}/api-to-lambda-target/main.js +0 -0
  114. /package/dist/src/lib/{construct → aws/construct}/api-to-lambda-target/types.d.ts +0 -0
  115. /package/dist/src/lib/{construct/application-configuration → aws/construct/api-to-lambda-target}/types.js +0 -0
  116. /package/dist/src/lib/{construct → aws/construct}/application-configuration/index.d.ts +0 -0
  117. /package/dist/src/lib/{construct → aws/construct}/application-configuration/index.js +0 -0
  118. /package/dist/src/lib/{construct → aws/construct}/application-configuration/main.d.ts +0 -0
  119. /package/dist/src/lib/{construct → aws/construct}/application-configuration/main.js +0 -0
  120. /package/dist/src/lib/{construct → aws/construct}/application-configuration/types.d.ts +0 -0
  121. /package/dist/src/lib/{construct/graphql-api-lambda-with-cache → aws/construct/application-configuration}/types.js +0 -0
  122. /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda/index.d.ts +0 -0
  123. /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda/index.js +0 -0
  124. /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda/main.d.ts +0 -0
  125. /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda/main.js +0 -0
  126. /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda/types.d.ts +0 -0
  127. /package/dist/src/lib/{construct/lambda-with-iam-access → aws/construct/graphql-api-lambda}/types.js +0 -0
  128. /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda-with-cache/index.d.ts +0 -0
  129. /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda-with-cache/index.js +0 -0
  130. /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda-with-cache/main.d.ts +0 -0
  131. /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda-with-cache/main.js +0 -0
  132. /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda-with-cache/types.d.ts +0 -0
  133. /package/dist/src/lib/{construct/graphql-api-lambda → aws/construct/graphql-api-lambda-with-cache}/types.js +0 -0
  134. /package/dist/src/lib/{construct → aws/construct}/index.d.ts +0 -0
  135. /package/dist/src/lib/{construct → aws/construct}/index.js +0 -0
  136. /package/dist/src/lib/{construct → aws/construct}/lambda-with-iam-access/index.d.ts +0 -0
  137. /package/dist/src/lib/{construct → aws/construct}/lambda-with-iam-access/index.js +0 -0
  138. /package/dist/src/lib/{construct → aws/construct}/lambda-with-iam-access/main.d.ts +0 -0
  139. /package/dist/src/lib/{construct → aws/construct}/lambda-with-iam-access/main.js +0 -0
  140. /package/dist/src/lib/{construct → aws/construct}/lambda-with-iam-access/types.d.ts +0 -0
  141. /package/dist/src/lib/{construct/rest-api-lambda-with-cache → aws/construct/lambda-with-iam-access}/types.js +0 -0
  142. /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda/index.d.ts +0 -0
  143. /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda/index.js +0 -0
  144. /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda/main.d.ts +0 -0
  145. /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda/main.js +0 -0
  146. /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda/types.d.ts +0 -0
  147. /package/dist/src/lib/{construct/site-with-ecs-backend → aws/construct/rest-api-lambda}/types.js +0 -0
  148. /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda-with-cache/index.d.ts +0 -0
  149. /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda-with-cache/index.js +0 -0
  150. /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda-with-cache/main.d.ts +0 -0
  151. /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda-with-cache/main.js +0 -0
  152. /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda-with-cache/types.d.ts +0 -0
  153. /package/dist/src/lib/{construct/rest-api-lambda → aws/construct/rest-api-lambda-with-cache}/types.js +0 -0
  154. /package/dist/src/lib/{construct → aws/construct}/site-with-ecs-backend/constants.d.ts +0 -0
  155. /package/dist/src/lib/{construct → aws/construct}/site-with-ecs-backend/constants.js +0 -0
  156. /package/dist/src/lib/{construct → aws/construct}/site-with-ecs-backend/index.d.ts +0 -0
  157. /package/dist/src/lib/{construct → aws/construct}/site-with-ecs-backend/index.js +0 -0
  158. /package/dist/src/lib/{construct → aws/construct}/site-with-ecs-backend/main.d.ts +0 -0
  159. /package/dist/src/lib/{construct → aws/construct}/site-with-ecs-backend/main.js +0 -0
  160. /package/dist/src/lib/{construct → aws/construct}/site-with-ecs-backend/types.d.ts +0 -0
  161. /package/dist/src/lib/{construct/static-asset-deployment → aws/construct/site-with-ecs-backend}/types.js +0 -0
  162. /package/dist/src/lib/{construct → aws/construct}/static-asset-deployment/index.d.ts +0 -0
  163. /package/dist/src/lib/{construct → aws/construct}/static-asset-deployment/index.js +0 -0
  164. /package/dist/src/lib/{construct → aws/construct}/static-asset-deployment/main.d.ts +0 -0
  165. /package/dist/src/lib/{construct → aws/construct}/static-asset-deployment/main.js +0 -0
  166. /package/dist/src/lib/{construct → aws/construct}/static-asset-deployment/types.d.ts +0 -0
  167. /package/dist/src/lib/{construct/static-site → aws/construct/static-asset-deployment}/types.js +0 -0
  168. /package/dist/src/lib/{construct → aws/construct}/static-site/index.d.ts +0 -0
  169. /package/dist/src/lib/{construct → aws/construct}/static-site/index.js +0 -0
  170. /package/dist/src/lib/{construct → aws/construct}/static-site/main.d.ts +0 -0
  171. /package/dist/src/lib/{construct → aws/construct}/static-site/main.js +0 -0
  172. /package/dist/src/lib/{construct → aws/construct}/static-site/types.d.ts +0 -0
  173. /package/dist/src/lib/{services/api-gateway → aws/construct/static-site}/types.js +0 -0
  174. /package/dist/src/lib/{services → aws/services}/api-gateway/index.d.ts +0 -0
  175. /package/dist/src/lib/{services → aws/services}/api-gateway/index.js +0 -0
  176. /package/dist/src/lib/{services → aws/services}/api-gateway/main.d.ts +0 -0
  177. /package/dist/src/lib/{services → aws/services}/api-gateway/main.js +0 -0
  178. /package/dist/src/lib/{services → aws/services}/api-gateway/types.d.ts +0 -0
  179. /package/dist/src/lib/{services/appconfig → aws/services/api-gateway}/types.js +0 -0
  180. /package/dist/src/lib/{services → aws/services}/appconfig/constants.d.ts +0 -0
  181. /package/dist/src/lib/{services → aws/services}/appconfig/constants.js +0 -0
  182. /package/dist/src/lib/{services → aws/services}/appconfig/index.d.ts +0 -0
  183. /package/dist/src/lib/{services → aws/services}/appconfig/index.js +0 -0
  184. /package/dist/src/lib/{services → aws/services}/appconfig/main.d.ts +0 -0
  185. /package/dist/src/lib/{services → aws/services}/appconfig/main.js +0 -0
  186. /package/dist/src/lib/{services → aws/services}/appconfig/types.d.ts +0 -0
  187. /package/dist/src/lib/{services/certificate-manager → aws/services/appconfig}/types.js +0 -0
  188. /package/dist/src/lib/{services → aws/services}/certificate-manager/index.d.ts +0 -0
  189. /package/dist/src/lib/{services → aws/services}/certificate-manager/index.js +0 -0
  190. /package/dist/src/lib/{services → aws/services}/certificate-manager/main.d.ts +0 -0
  191. /package/dist/src/lib/{services → aws/services}/certificate-manager/main.js +0 -0
  192. /package/dist/src/lib/{services → aws/services}/certificate-manager/types.d.ts +0 -0
  193. /package/dist/src/lib/{services/cloudfront → aws/services/certificate-manager}/types.js +0 -0
  194. /package/dist/src/lib/{services → aws/services}/cloudfront/index.d.ts +0 -0
  195. /package/dist/src/lib/{services → aws/services}/cloudfront/index.js +0 -0
  196. /package/dist/src/lib/{services → aws/services}/cloudfront/main.d.ts +0 -0
  197. /package/dist/src/lib/{services → aws/services}/cloudfront/main.js +0 -0
  198. /package/dist/src/lib/{services → aws/services}/cloudfront/types.d.ts +0 -0
  199. /package/dist/src/lib/{services/cloudtrail → aws/services/cloudfront}/types.js +0 -0
  200. /package/dist/src/lib/{services → aws/services}/cloudtrail/index.d.ts +0 -0
  201. /package/dist/src/lib/{services → aws/services}/cloudtrail/index.js +0 -0
  202. /package/dist/src/lib/{services → aws/services}/cloudtrail/main.d.ts +0 -0
  203. /package/dist/src/lib/{services → aws/services}/cloudtrail/main.js +0 -0
  204. /package/dist/src/lib/{services → aws/services}/cloudtrail/types.d.ts +0 -0
  205. /package/dist/src/lib/{services/cloudwatch → aws/services/cloudtrail}/types.js +0 -0
  206. /package/dist/src/lib/{services → aws/services}/cloudwatch/index.d.ts +0 -0
  207. /package/dist/src/lib/{services → aws/services}/cloudwatch/index.js +0 -0
  208. /package/dist/src/lib/{services → aws/services}/cloudwatch/logs.d.ts +0 -0
  209. /package/dist/src/lib/{services → aws/services}/cloudwatch/logs.js +0 -0
  210. /package/dist/src/lib/{services → aws/services}/cloudwatch/main.d.ts +0 -0
  211. /package/dist/src/lib/{services → aws/services}/cloudwatch/main.js +0 -0
  212. /package/dist/src/lib/{services → aws/services}/cloudwatch/types.d.ts +0 -0
  213. /package/dist/src/lib/{services/dynamodb → aws/services/cloudwatch}/types.js +0 -0
  214. /package/dist/src/lib/{services → aws/services}/codebuild/index.d.ts +0 -0
  215. /package/dist/src/lib/{services → aws/services}/codebuild/index.js +0 -0
  216. /package/dist/src/lib/{services → aws/services}/codebuild/main.d.ts +0 -0
  217. /package/dist/src/lib/{services → aws/services}/codebuild/main.js +0 -0
  218. /package/dist/src/lib/{services → aws/services}/constants.d.ts +0 -0
  219. /package/dist/src/lib/{services → aws/services}/constants.js +0 -0
  220. /package/dist/src/lib/{services → aws/services}/dynamodb/index.d.ts +0 -0
  221. /package/dist/src/lib/{services → aws/services}/dynamodb/index.js +0 -0
  222. /package/dist/src/lib/{services → aws/services}/dynamodb/main.d.ts +0 -0
  223. /package/dist/src/lib/{services → aws/services}/dynamodb/main.js +0 -0
  224. /package/dist/src/lib/{services → aws/services}/dynamodb/types.d.ts +0 -0
  225. /package/dist/src/lib/{services/elastic-container-service → aws/services/dynamodb}/types.js +0 -0
  226. /package/dist/src/lib/{services → aws/services}/elastic-container-registry/index.d.ts +0 -0
  227. /package/dist/src/lib/{services → aws/services}/elastic-container-registry/index.js +0 -0
  228. /package/dist/src/lib/{services → aws/services}/elastic-container-registry/main.d.ts +0 -0
  229. /package/dist/src/lib/{services → aws/services}/elastic-container-registry/main.js +0 -0
  230. /package/dist/src/lib/{services → aws/services}/elastic-container-service/index.d.ts +0 -0
  231. /package/dist/src/lib/{services → aws/services}/elastic-container-service/index.js +0 -0
  232. /package/dist/src/lib/{services → aws/services}/elastic-container-service/main.d.ts +0 -0
  233. /package/dist/src/lib/{services → aws/services}/elastic-container-service/main.js +0 -0
  234. /package/dist/src/lib/{services → aws/services}/elastic-container-service/types.d.ts +0 -0
  235. /package/dist/src/lib/{services/elastic-file-system → aws/services/elastic-container-service}/types.js +0 -0
  236. /package/dist/src/lib/{services → aws/services}/elastic-file-system/index.d.ts +0 -0
  237. /package/dist/src/lib/{services → aws/services}/elastic-file-system/index.js +0 -0
  238. /package/dist/src/lib/{services → aws/services}/elastic-file-system/main.d.ts +0 -0
  239. /package/dist/src/lib/{services → aws/services}/elastic-file-system/main.js +0 -0
  240. /package/dist/src/lib/{services → aws/services}/elastic-file-system/types.d.ts +0 -0
  241. /package/dist/src/lib/{services/elastic-kubernetes-service → aws/services/elastic-file-system}/types.js +0 -0
  242. /package/dist/src/lib/{services → aws/services}/elastic-kubernetes-service/index.d.ts +0 -0
  243. /package/dist/src/lib/{services → aws/services}/elastic-kubernetes-service/index.js +0 -0
  244. /package/dist/src/lib/{services → aws/services}/elastic-kubernetes-service/main.d.ts +0 -0
  245. /package/dist/src/lib/{services → aws/services}/elastic-kubernetes-service/main.js +0 -0
  246. /package/dist/src/lib/{services → aws/services}/elastic-kubernetes-service/types.d.ts +0 -0
  247. /package/dist/src/lib/{services/elasticache → aws/services/elastic-kubernetes-service}/types.js +0 -0
  248. /package/dist/src/lib/{services → aws/services}/elasticache/index.d.ts +0 -0
  249. /package/dist/src/lib/{services → aws/services}/elasticache/index.js +0 -0
  250. /package/dist/src/lib/{services → aws/services}/elasticache/main.d.ts +0 -0
  251. /package/dist/src/lib/{services → aws/services}/elasticache/main.js +0 -0
  252. /package/dist/src/lib/{services → aws/services}/elasticache/types.d.ts +0 -0
  253. /package/dist/src/lib/{services/eventbridge → aws/services/elasticache}/types.js +0 -0
  254. /package/dist/src/lib/{services → aws/services}/eventbridge/index.d.ts +0 -0
  255. /package/dist/src/lib/{services → aws/services}/eventbridge/index.js +0 -0
  256. /package/dist/src/lib/{services → aws/services}/eventbridge/main.d.ts +0 -0
  257. /package/dist/src/lib/{services → aws/services}/eventbridge/main.js +0 -0
  258. /package/dist/src/lib/{services → aws/services}/eventbridge/target.d.ts +0 -0
  259. /package/dist/src/lib/{services → aws/services}/eventbridge/target.js +0 -0
  260. /package/dist/src/lib/{services → aws/services}/eventbridge/types.d.ts +0 -0
  261. /package/dist/src/lib/{services/evidently → aws/services/eventbridge}/types.js +0 -0
  262. /package/dist/src/lib/{services → aws/services}/evidently/index.d.ts +0 -0
  263. /package/dist/src/lib/{services → aws/services}/evidently/index.js +0 -0
  264. /package/dist/src/lib/{services → aws/services}/evidently/main.d.ts +0 -0
  265. /package/dist/src/lib/{services → aws/services}/evidently/main.js +0 -0
  266. /package/dist/src/lib/{services → aws/services}/evidently/types.d.ts +0 -0
  267. /package/dist/src/lib/{services/key-management-service → aws/services/evidently}/types.js +0 -0
  268. /package/dist/src/lib/{services → aws/services}/identity-access-management/index.d.ts +0 -0
  269. /package/dist/src/lib/{services → aws/services}/identity-access-management/index.js +0 -0
  270. /package/dist/src/lib/{services → aws/services}/identity-access-management/main.d.ts +0 -0
  271. /package/dist/src/lib/{services → aws/services}/identity-access-management/main.js +0 -0
  272. /package/dist/src/lib/{services → aws/services}/index.d.ts +0 -0
  273. /package/dist/src/lib/{services → aws/services}/index.js +0 -0
  274. /package/dist/src/lib/{services → aws/services}/key-management-service/index.d.ts +0 -0
  275. /package/dist/src/lib/{services → aws/services}/key-management-service/index.js +0 -0
  276. /package/dist/src/lib/{services → aws/services}/key-management-service/main.d.ts +0 -0
  277. /package/dist/src/lib/{services → aws/services}/key-management-service/main.js +0 -0
  278. /package/dist/src/lib/{services → aws/services}/key-management-service/types.d.ts +0 -0
  279. /package/dist/src/lib/{services/lambda → aws/services/key-management-service}/types.js +0 -0
  280. /package/dist/src/lib/{services → aws/services}/lambda/index.d.ts +0 -0
  281. /package/dist/src/lib/{services → aws/services}/lambda/index.js +0 -0
  282. /package/dist/src/lib/{services → aws/services}/lambda/main.d.ts +0 -0
  283. /package/dist/src/lib/{services → aws/services}/lambda/main.js +0 -0
  284. /package/dist/src/lib/{services → aws/services}/lambda/types.d.ts +0 -0
  285. /package/dist/src/lib/{services/route53 → aws/services/lambda}/types.js +0 -0
  286. /package/dist/src/lib/{services → aws/services}/route53/index.d.ts +0 -0
  287. /package/dist/src/lib/{services → aws/services}/route53/index.js +0 -0
  288. /package/dist/src/lib/{services → aws/services}/route53/main.d.ts +0 -0
  289. /package/dist/src/lib/{services → aws/services}/route53/main.js +0 -0
  290. /package/dist/src/lib/{services → aws/services}/route53/types.d.ts +0 -0
  291. /package/dist/src/lib/{services/simple-notification-service → aws/services/route53}/types.js +0 -0
  292. /package/dist/src/lib/{services → aws/services}/secrets-manager/index.d.ts +0 -0
  293. /package/dist/src/lib/{services → aws/services}/secrets-manager/index.js +0 -0
  294. /package/dist/src/lib/{services → aws/services}/secrets-manager/main.d.ts +0 -0
  295. /package/dist/src/lib/{services → aws/services}/secrets-manager/main.js +0 -0
  296. /package/dist/src/lib/{services → aws/services}/simple-notification-service/index.d.ts +0 -0
  297. /package/dist/src/lib/{services → aws/services}/simple-notification-service/index.js +0 -0
  298. /package/dist/src/lib/{services → aws/services}/simple-notification-service/main.d.ts +0 -0
  299. /package/dist/src/lib/{services → aws/services}/simple-notification-service/main.js +0 -0
  300. /package/dist/src/lib/{services → aws/services}/simple-notification-service/types.d.ts +0 -0
  301. /package/dist/src/lib/{services/simple-queue-service → aws/services/simple-notification-service}/types.js +0 -0
  302. /package/dist/src/lib/{services → aws/services}/simple-queue-service/index.d.ts +0 -0
  303. /package/dist/src/lib/{services → aws/services}/simple-queue-service/index.js +0 -0
  304. /package/dist/src/lib/{services → aws/services}/simple-queue-service/main.d.ts +0 -0
  305. /package/dist/src/lib/{services → aws/services}/simple-queue-service/main.js +0 -0
  306. /package/dist/src/lib/{services → aws/services}/simple-queue-service/types.d.ts +0 -0
  307. /package/dist/src/lib/{services/simple-storage-service → aws/services/simple-queue-service}/types.js +0 -0
  308. /package/dist/src/lib/{services → aws/services}/simple-storage-service/index.d.ts +0 -0
  309. /package/dist/src/lib/{services → aws/services}/simple-storage-service/index.js +0 -0
  310. /package/dist/src/lib/{services → aws/services}/simple-storage-service/main.d.ts +0 -0
  311. /package/dist/src/lib/{services → aws/services}/simple-storage-service/main.js +0 -0
  312. /package/dist/src/lib/{services → aws/services}/simple-storage-service/types.d.ts +0 -0
  313. /package/dist/src/lib/{services/step-function → aws/services/simple-storage-service}/types.js +0 -0
  314. /package/dist/src/lib/{services → aws/services}/step-function/index.d.ts +0 -0
  315. /package/dist/src/lib/{services → aws/services}/step-function/index.js +0 -0
  316. /package/dist/src/lib/{services → aws/services}/step-function/main.d.ts +0 -0
  317. /package/dist/src/lib/{services → aws/services}/step-function/main.js +0 -0
  318. /package/dist/src/lib/{services → aws/services}/step-function/types.d.ts +0 -0
  319. /package/dist/src/lib/{services/systems-manager → aws/services/step-function}/types.js +0 -0
  320. /package/dist/src/lib/{services → aws/services}/systems-manager/index.d.ts +0 -0
  321. /package/dist/src/lib/{services → aws/services}/systems-manager/index.js +0 -0
  322. /package/dist/src/lib/{services → aws/services}/systems-manager/main.d.ts +0 -0
  323. /package/dist/src/lib/{services → aws/services}/systems-manager/main.js +0 -0
  324. /package/dist/src/lib/{services → aws/services}/systems-manager/types.d.ts +0 -0
  325. /package/dist/src/lib/{services/web-application-firewall → aws/services/systems-manager}/types.js +0 -0
  326. /package/dist/src/lib/{services → aws/services}/virtual-private-cloud/index.d.ts +0 -0
  327. /package/dist/src/lib/{services → aws/services}/virtual-private-cloud/index.js +0 -0
  328. /package/dist/src/lib/{services → aws/services}/virtual-private-cloud/main.d.ts +0 -0
  329. /package/dist/src/lib/{services → aws/services}/virtual-private-cloud/main.js +0 -0
  330. /package/dist/src/lib/{services → aws/services}/web-application-firewall/index.d.ts +0 -0
  331. /package/dist/src/lib/{services → aws/services}/web-application-firewall/index.js +0 -0
  332. /package/dist/src/lib/{services → aws/services}/web-application-firewall/main.d.ts +0 -0
  333. /package/dist/src/lib/{services → aws/services}/web-application-firewall/main.js +0 -0
  334. /package/dist/src/lib/{services → aws/services}/web-application-firewall/types.d.ts +0 -0
  335. /package/dist/src/lib/{types/aws/index.js → aws/services/web-application-firewall/types.js} +0 -0
  336. /package/dist/src/lib/{types/aws → aws/types}/index.d.ts +0 -0
  337. /package/src/lib/{construct → aws/construct}/api-to-any-target/index.ts +0 -0
  338. /package/src/lib/{construct → aws/construct}/api-to-any-target/main.ts +0 -0
  339. /package/src/lib/{construct → aws/construct}/api-to-any-target/target.ts +0 -0
  340. /package/src/lib/{construct → aws/construct}/api-to-any-target/types.ts +0 -0
  341. /package/src/lib/{construct → aws/construct}/api-to-eventbridge-target/api.ts +0 -0
  342. /package/src/lib/{construct → aws/construct}/api-to-eventbridge-target/event.ts +0 -0
  343. /package/src/lib/{construct → aws/construct}/api-to-eventbridge-target/index.ts +0 -0
  344. /package/src/lib/{construct → aws/construct}/api-to-eventbridge-target/main.ts +0 -0
  345. /package/src/lib/{construct → aws/construct}/api-to-eventbridge-target/types.ts +0 -0
  346. /package/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +0 -0
  347. /package/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/index.ts +0 -0
  348. /package/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/main.ts +0 -0
  349. /package/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/types.ts +0 -0
  350. /package/src/lib/{construct → aws/construct}/api-to-lambda-target/api.ts +0 -0
  351. /package/src/lib/{construct → aws/construct}/api-to-lambda-target/index.ts +0 -0
  352. /package/src/lib/{construct → aws/construct}/api-to-lambda-target/main.ts +0 -0
  353. /package/src/lib/{construct → aws/construct}/api-to-lambda-target/types.ts +0 -0
  354. /package/src/lib/{construct → aws/construct}/application-configuration/index.ts +0 -0
  355. /package/src/lib/{construct → aws/construct}/application-configuration/main.ts +0 -0
  356. /package/src/lib/{construct → aws/construct}/application-configuration/types.ts +0 -0
  357. /package/src/lib/{construct → aws/construct}/graphql-api-lambda/index.ts +0 -0
  358. /package/src/lib/{construct → aws/construct}/graphql-api-lambda/main.ts +0 -0
  359. /package/src/lib/{construct → aws/construct}/graphql-api-lambda/types.ts +0 -0
  360. /package/src/lib/{construct → aws/construct}/graphql-api-lambda-with-cache/index.ts +0 -0
  361. /package/src/lib/{construct → aws/construct}/graphql-api-lambda-with-cache/main.ts +0 -0
  362. /package/src/lib/{construct → aws/construct}/graphql-api-lambda-with-cache/types.ts +0 -0
  363. /package/src/lib/{construct → aws/construct}/index.ts +0 -0
  364. /package/src/lib/{construct → aws/construct}/lambda-with-iam-access/index.ts +0 -0
  365. /package/src/lib/{construct → aws/construct}/lambda-with-iam-access/main.ts +0 -0
  366. /package/src/lib/{construct → aws/construct}/lambda-with-iam-access/types.ts +0 -0
  367. /package/src/lib/{construct → aws/construct}/rest-api-lambda/index.ts +0 -0
  368. /package/src/lib/{construct → aws/construct}/rest-api-lambda/main.ts +0 -0
  369. /package/src/lib/{construct → aws/construct}/rest-api-lambda/types.ts +0 -0
  370. /package/src/lib/{construct → aws/construct}/rest-api-lambda-with-cache/index.ts +0 -0
  371. /package/src/lib/{construct → aws/construct}/rest-api-lambda-with-cache/main.ts +0 -0
  372. /package/src/lib/{construct → aws/construct}/rest-api-lambda-with-cache/types.ts +0 -0
  373. /package/src/lib/{construct → aws/construct}/site-with-ecs-backend/constants.ts +0 -0
  374. /package/src/lib/{construct → aws/construct}/site-with-ecs-backend/index.ts +0 -0
  375. /package/src/lib/{construct → aws/construct}/site-with-ecs-backend/main.ts +0 -0
  376. /package/src/lib/{construct → aws/construct}/site-with-ecs-backend/types.ts +0 -0
  377. /package/src/lib/{construct → aws/construct}/static-asset-deployment/index.ts +0 -0
  378. /package/src/lib/{construct → aws/construct}/static-asset-deployment/main.ts +0 -0
  379. /package/src/lib/{construct → aws/construct}/static-asset-deployment/types.ts +0 -0
  380. /package/src/lib/{construct → aws/construct}/static-site/index.ts +0 -0
  381. /package/src/lib/{construct → aws/construct}/static-site/main.ts +0 -0
  382. /package/src/lib/{construct → aws/construct}/static-site/types.ts +0 -0
  383. /package/src/lib/{services → aws/services}/api-gateway/index.ts +0 -0
  384. /package/src/lib/{services → aws/services}/api-gateway/main.ts +0 -0
  385. /package/src/lib/{services → aws/services}/api-gateway/types.ts +0 -0
  386. /package/src/lib/{services → aws/services}/appconfig/constants.ts +0 -0
  387. /package/src/lib/{services → aws/services}/appconfig/index.ts +0 -0
  388. /package/src/lib/{services → aws/services}/appconfig/main.ts +0 -0
  389. /package/src/lib/{services → aws/services}/appconfig/types.ts +0 -0
  390. /package/src/lib/{services → aws/services}/certificate-manager/index.ts +0 -0
  391. /package/src/lib/{services → aws/services}/certificate-manager/main.ts +0 -0
  392. /package/src/lib/{services → aws/services}/certificate-manager/types.ts +0 -0
  393. /package/src/lib/{services → aws/services}/cloudfront/index.ts +0 -0
  394. /package/src/lib/{services → aws/services}/cloudfront/main.ts +0 -0
  395. /package/src/lib/{services → aws/services}/cloudfront/types.ts +0 -0
  396. /package/src/lib/{services → aws/services}/cloudtrail/index.ts +0 -0
  397. /package/src/lib/{services → aws/services}/cloudtrail/main.ts +0 -0
  398. /package/src/lib/{services → aws/services}/cloudtrail/types.ts +0 -0
  399. /package/src/lib/{services → aws/services}/cloudwatch/index.ts +0 -0
  400. /package/src/lib/{services → aws/services}/cloudwatch/logs.ts +0 -0
  401. /package/src/lib/{services → aws/services}/cloudwatch/main.ts +0 -0
  402. /package/src/lib/{services → aws/services}/cloudwatch/types.ts +0 -0
  403. /package/src/lib/{services → aws/services}/codebuild/index.ts +0 -0
  404. /package/src/lib/{services → aws/services}/codebuild/main.ts +0 -0
  405. /package/src/lib/{services → aws/services}/constants.ts +0 -0
  406. /package/src/lib/{services → aws/services}/dynamodb/index.ts +0 -0
  407. /package/src/lib/{services → aws/services}/dynamodb/main.ts +0 -0
  408. /package/src/lib/{services → aws/services}/dynamodb/types.ts +0 -0
  409. /package/src/lib/{services → aws/services}/elastic-container-registry/index.ts +0 -0
  410. /package/src/lib/{services → aws/services}/elastic-container-registry/main.ts +0 -0
  411. /package/src/lib/{services → aws/services}/elastic-container-service/index.ts +0 -0
  412. /package/src/lib/{services → aws/services}/elastic-container-service/main.ts +0 -0
  413. /package/src/lib/{services → aws/services}/elastic-container-service/types.ts +0 -0
  414. /package/src/lib/{services → aws/services}/elastic-file-system/index.ts +0 -0
  415. /package/src/lib/{services → aws/services}/elastic-file-system/main.ts +0 -0
  416. /package/src/lib/{services → aws/services}/elastic-file-system/types.ts +0 -0
  417. /package/src/lib/{services → aws/services}/elastic-kubernetes-service/index.ts +0 -0
  418. /package/src/lib/{services → aws/services}/elastic-kubernetes-service/main.ts +0 -0
  419. /package/src/lib/{services → aws/services}/elastic-kubernetes-service/types.ts +0 -0
  420. /package/src/lib/{services → aws/services}/elasticache/index.ts +0 -0
  421. /package/src/lib/{services → aws/services}/elasticache/main.ts +0 -0
  422. /package/src/lib/{services → aws/services}/elasticache/types.ts +0 -0
  423. /package/src/lib/{services → aws/services}/eventbridge/index.ts +0 -0
  424. /package/src/lib/{services → aws/services}/eventbridge/main.ts +0 -0
  425. /package/src/lib/{services → aws/services}/eventbridge/target.ts +0 -0
  426. /package/src/lib/{services → aws/services}/eventbridge/types.ts +0 -0
  427. /package/src/lib/{services → aws/services}/evidently/index.ts +0 -0
  428. /package/src/lib/{services → aws/services}/evidently/main.ts +0 -0
  429. /package/src/lib/{services → aws/services}/evidently/types.ts +0 -0
  430. /package/src/lib/{services → aws/services}/identity-access-management/index.ts +0 -0
  431. /package/src/lib/{services → aws/services}/identity-access-management/main.ts +0 -0
  432. /package/src/lib/{services → aws/services}/index.ts +0 -0
  433. /package/src/lib/{services → aws/services}/key-management-service/index.ts +0 -0
  434. /package/src/lib/{services → aws/services}/key-management-service/main.ts +0 -0
  435. /package/src/lib/{services → aws/services}/key-management-service/types.ts +0 -0
  436. /package/src/lib/{services → aws/services}/lambda/index.ts +0 -0
  437. /package/src/lib/{services → aws/services}/lambda/main.ts +0 -0
  438. /package/src/lib/{services → aws/services}/lambda/types.ts +0 -0
  439. /package/src/lib/{services → aws/services}/route53/index.ts +0 -0
  440. /package/src/lib/{services → aws/services}/route53/main.ts +0 -0
  441. /package/src/lib/{services → aws/services}/route53/types.ts +0 -0
  442. /package/src/lib/{services → aws/services}/secrets-manager/index.ts +0 -0
  443. /package/src/lib/{services → aws/services}/secrets-manager/main.ts +0 -0
  444. /package/src/lib/{services → aws/services}/simple-notification-service/index.ts +0 -0
  445. /package/src/lib/{services → aws/services}/simple-notification-service/main.ts +0 -0
  446. /package/src/lib/{services → aws/services}/simple-notification-service/types.ts +0 -0
  447. /package/src/lib/{services → aws/services}/simple-queue-service/index.ts +0 -0
  448. /package/src/lib/{services → aws/services}/simple-queue-service/main.ts +0 -0
  449. /package/src/lib/{services → aws/services}/simple-queue-service/types.ts +0 -0
  450. /package/src/lib/{services → aws/services}/simple-storage-service/index.ts +0 -0
  451. /package/src/lib/{services → aws/services}/simple-storage-service/main.ts +0 -0
  452. /package/src/lib/{services → aws/services}/simple-storage-service/types.ts +0 -0
  453. /package/src/lib/{services → aws/services}/step-function/index.ts +0 -0
  454. /package/src/lib/{services → aws/services}/step-function/main.ts +0 -0
  455. /package/src/lib/{services → aws/services}/step-function/types.ts +0 -0
  456. /package/src/lib/{services → aws/services}/systems-manager/index.ts +0 -0
  457. /package/src/lib/{services → aws/services}/systems-manager/main.ts +0 -0
  458. /package/src/lib/{services → aws/services}/systems-manager/types.ts +0 -0
  459. /package/src/lib/{services → aws/services}/virtual-private-cloud/index.ts +0 -0
  460. /package/src/lib/{services → aws/services}/virtual-private-cloud/main.ts +0 -0
  461. /package/src/lib/{services → aws/services}/web-application-firewall/index.ts +0 -0
  462. /package/src/lib/{services → aws/services}/web-application-firewall/main.ts +0 -0
  463. /package/src/lib/{services → aws/services}/web-application-firewall/types.ts +0 -0
  464. /package/src/lib/{types/aws → aws/types}/index.ts +0 -0
@@ -0,0 +1,164 @@
1
+ import { CfnOutput } from 'aws-cdk-lib'
2
+ import { Construct } from 'constructs'
3
+ import { isDevStage, isPrdStage, isTestStage, isUatStage } from '../../common'
4
+ import {
5
+ AcmManager,
6
+ ApiManager,
7
+ AppConfigManager,
8
+ CloudFrontManager,
9
+ CloudTrailManager,
10
+ CloudWatchManager,
11
+ CodeBuildManager,
12
+ DynamodbManager,
13
+ EcrManager,
14
+ EcsManager,
15
+ EfsManager,
16
+ EksManager,
17
+ ElastiCacheManager,
18
+ EventManager,
19
+ EventTargetManager,
20
+ EvidentlyManager,
21
+ IamManager,
22
+ KmsManager,
23
+ LambdaManager,
24
+ LogManager,
25
+ Route53Manager,
26
+ S3Manager,
27
+ SecretsManager,
28
+ SfnManager,
29
+ SnsManager,
30
+ SqsManager,
31
+ SsmManager,
32
+ VpcManager,
33
+ WafManager,
34
+ } from '../services'
35
+ import { createCfnOutput } from '../utils'
36
+ import { CommonStackProps } from './types'
37
+
38
+ /**
39
+ * @subcategory Construct
40
+ * @classdesc Common construct to use as a base for all higher level constructs.
41
+ * @example
42
+ * import { CommonConstruct } from '@gradientedge/cdk-utils';
43
+ *
44
+ * class CustomConstruct extends CommonConstruct {
45
+ * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
46
+ * super(parent, id, props);
47
+ * this.props = props;
48
+ * };
49
+ * };
50
+ */
51
+ export class CommonConstruct extends Construct {
52
+ props: CommonStackProps
53
+ acmManager: AcmManager
54
+ apiManager: ApiManager
55
+ appConfigManager: AppConfigManager
56
+ codeBuildManager: CodeBuildManager
57
+ cloudFrontManager: CloudFrontManager
58
+ cloudTrailManager: CloudTrailManager
59
+ cloudWatchManager: CloudWatchManager
60
+ dynamodbManager: DynamodbManager
61
+ ecrManager: EcrManager
62
+ ecsManager: EcsManager
63
+ efsManager: EfsManager
64
+ eksManager: EksManager
65
+ elasticacheManager: ElastiCacheManager
66
+ eventManager: EventManager
67
+ eventTargetManager: EventTargetManager
68
+ evidentlyManager: EvidentlyManager
69
+ iamManager: IamManager
70
+ kmsManager: KmsManager
71
+ lambdaManager: LambdaManager
72
+ logManager: LogManager
73
+ route53Manager: Route53Manager
74
+ s3Manager: S3Manager
75
+ secretsManager: SecretsManager
76
+ sfnManager: SfnManager
77
+ snsManager: SnsManager
78
+ sqsManager: SqsManager
79
+ ssmManager: SsmManager
80
+ vpcManager: VpcManager
81
+ wafManager: WafManager
82
+
83
+ fullyQualifiedDomainName: string
84
+
85
+ constructor(parent: Construct, id: string, props: CommonStackProps) {
86
+ super(parent, id)
87
+ this.props = props
88
+ this.acmManager = new AcmManager()
89
+ this.apiManager = new ApiManager()
90
+ this.appConfigManager = new AppConfigManager()
91
+ this.codeBuildManager = new CodeBuildManager()
92
+ this.cloudFrontManager = new CloudFrontManager()
93
+ this.cloudTrailManager = new CloudTrailManager()
94
+ this.cloudWatchManager = new CloudWatchManager()
95
+ this.dynamodbManager = new DynamodbManager()
96
+ this.ecrManager = new EcrManager()
97
+ this.ecsManager = new EcsManager()
98
+ this.efsManager = new EfsManager()
99
+ this.eksManager = new EksManager()
100
+ this.elasticacheManager = new ElastiCacheManager()
101
+ this.eventManager = new EventManager()
102
+ this.eventTargetManager = new EventTargetManager()
103
+ this.evidentlyManager = new EvidentlyManager()
104
+ this.iamManager = new IamManager()
105
+ this.kmsManager = new KmsManager()
106
+ this.lambdaManager = new LambdaManager()
107
+ this.logManager = new LogManager()
108
+ this.route53Manager = new Route53Manager()
109
+ this.s3Manager = new S3Manager()
110
+ this.secretsManager = new SecretsManager()
111
+ this.sfnManager = new SfnManager()
112
+ this.snsManager = new SnsManager()
113
+ this.sqsManager = new SqsManager()
114
+ this.ssmManager = new SsmManager()
115
+ this.vpcManager = new VpcManager()
116
+ this.wafManager = new WafManager()
117
+
118
+ this.determineFullyQualifiedDomain()
119
+ }
120
+
121
+ /**
122
+ * @summary Helper method to add CloudFormation outputs from the construct
123
+ * @param id scoped id of the resource
124
+ * @param value the value of the exported output
125
+ * @param description optional description for the output
126
+ * @param overrideId Flag which indicates whether to override the default logical id of the output
127
+ */
128
+ protected addCfnOutput(id: string, value: string, description?: string, overrideId = true): CfnOutput {
129
+ return createCfnOutput(id, this, value, description, overrideId)
130
+ }
131
+
132
+ /**
133
+ * @summary Determine the fully qualified domain name based on domainName & subDomain
134
+ */
135
+ protected determineFullyQualifiedDomain() {
136
+ this.fullyQualifiedDomainName = this.props.subDomain
137
+ ? `${this.props.subDomain}.${this.props.domainName}`
138
+ : this.props.domainName
139
+ }
140
+
141
+ /**
142
+ * @summary Utility method to determine if the initialisation is in development (dev) stage
143
+ * This is determined by the stage property injected via cdk context
144
+ */
145
+ public isDevelopmentStage = () => isDevStage(this.props.stage)
146
+
147
+ /**
148
+ * @summary Utility method to determine if the initialisation is in test (tst) stage
149
+ * This is determined by the stage property injected via cdk context
150
+ */
151
+ public isTestStage = () => isTestStage(this.props.stage)
152
+
153
+ /**
154
+ * @summary Utility method to determine if the initialisation is in uat (uat) stage
155
+ * This is determined by the stage property injected via cdk context
156
+ */
157
+ public isUatStage = () => isUatStage(this.props.stage)
158
+
159
+ /**
160
+ * @summary Utility method to determine if the initialisation is in production (prd) stage
161
+ * This is determined by the stage property injected via cdk context
162
+ */
163
+ public isProductionStage = () => isPrdStage(this.props.stage)
164
+ }
@@ -0,0 +1,3 @@
1
+ export * from './construct'
2
+ export * from './stack'
3
+ export * from './types'
@@ -0,0 +1,150 @@
1
+ import { App, Stack, StackProps } from 'aws-cdk-lib'
2
+ import { Runtime } from 'aws-cdk-lib/aws-lambda'
3
+ import fs from 'fs'
4
+ import { CommonConstruct } from './construct'
5
+ import { CommonStackProps } from './types'
6
+
7
+ import appRoot from 'app-root-path'
8
+ import { isDevStage } from '../../common'
9
+
10
+ /**
11
+ * @classdesc Common stack to use as a base for all higher level constructs.
12
+ * @example
13
+ * import { CommonStack } from '@gradientedge/cdk-utils'
14
+ *
15
+ * class CustomStack extends CommonStack {
16
+ * constructor(parent: App, name: string, props: StackProps) {
17
+ * super(parent, name, props)
18
+ * // provision resources
19
+ * }
20
+ * }
21
+ */
22
+ export class CommonStack extends Stack {
23
+ public static NODEJS_RUNTIME = Runtime.NODEJS_18_X
24
+
25
+ construct: CommonConstruct
26
+ props: CommonStackProps
27
+
28
+ constructor(parent: App, name: string, props: StackProps) {
29
+ super(parent, name, props)
30
+
31
+ /* determine extra cdk contexts */
32
+ this.determineExtraContexts()
33
+
34
+ /* determine extra cdk stage contexts */
35
+ this.determineStageContexts()
36
+
37
+ this.props = this.determineConstructProps(props)
38
+
39
+ /* initialise the construct */
40
+ this.construct = new CommonConstruct(this, 'cdk-utils', this.props)
41
+ }
42
+
43
+ /**
44
+ * @summary Method to determine the core CDK construct properties injected via context cdk.json
45
+ * @param props The stack properties
46
+ * @returns The stack properties
47
+ */
48
+ protected determineConstructProps(props: StackProps) {
49
+ return {
50
+ domainName: this.node.tryGetContext('domainName'),
51
+ excludeDomainNameForBuckets: this.node.tryGetContext('excludeDomainNameForBuckets'),
52
+ extraContexts: this.node.tryGetContext('extraContexts'),
53
+ logRetention: this.node.tryGetContext('logRetention'),
54
+ name: props.stackName || 'cdk-utils',
55
+ nodejsRuntime: this.node.tryGetContext('nodejsRuntime') ?? CommonStack.NODEJS_RUNTIME,
56
+ region: this.node.tryGetContext('region'),
57
+ skipStageForARecords: this.node.tryGetContext('skipStageForARecords'),
58
+ stackName: props.stackName,
59
+ stage: this.node.tryGetContext('stage'),
60
+ subDomain: this.node.tryGetContext('subDomain'),
61
+ }
62
+ }
63
+
64
+ /**
65
+ * @summary Method to determine extra cdk contexts apart from the main cdk.json
66
+ * - Sets the properties from the extra contexts into cdk node context
67
+ * - Primary use is to have layered config in separate files to enable easier maintenance and readability
68
+ */
69
+ protected determineExtraContexts() {
70
+ const extraContexts = this.node.tryGetContext('extraContexts')
71
+ const debug = this.node.tryGetContext('debug')
72
+
73
+ if (!extraContexts) {
74
+ if (debug) console.debug(`No additional contexts provided. Using default context properties from cdk.json`)
75
+ return
76
+ }
77
+
78
+ extraContexts.forEach((context: string) => {
79
+ const extraContextPath = `${appRoot.path}/${context}`
80
+
81
+ /* scenario where extra context is configured in cdk.json but absent in file system */
82
+ if (!fs.existsSync(extraContextPath)) throw `Extra context properties unavailable in path:${extraContextPath}`
83
+
84
+ /* read the extra properties */
85
+ const extraContextPropsBuffer = fs.readFileSync(extraContextPath)
86
+ if (debug) console.debug(`Adding additional contexts provided in ${extraContextPath}`)
87
+
88
+ /* parse as JSON properties */
89
+ const extraContextProps = JSON.parse(extraContextPropsBuffer.toString('utf-8'))
90
+
91
+ /* set each of the property into the cdk node context */
92
+ Object.keys(extraContextProps).forEach((propKey: any) => {
93
+ this.node.setContext(propKey, extraContextProps[propKey])
94
+ })
95
+ })
96
+ }
97
+
98
+ /**
99
+ * @summary Method to determine extra cdk stage contexts apart from the main cdk.json
100
+ * - Sets the properties from the extra stage contexts into cdk node context
101
+ * - Primary use is to have layered config for each environment which is injected into the context
102
+ */
103
+ protected determineStageContexts() {
104
+ const stage = this.node.tryGetContext('stage')
105
+ const stageContextPath = this.node.tryGetContext('stageContextPath') || 'cdkEnv'
106
+ const stageContextFilePath = `${appRoot.path}/${stageContextPath}/${stage}.json`
107
+ const debug = this.node.tryGetContext('debug')
108
+
109
+ if (isDevStage(stage)) {
110
+ if (debug) console.debug(`Development stage. Using default stage context properties`)
111
+ }
112
+
113
+ /* alert default context usage when extra stage config is missing */
114
+ if (!fs.existsSync(stageContextFilePath)) {
115
+ if (debug) console.debug(`Stage specific context properties unavailable in path:${stageContextFilePath}`)
116
+ if (debug) console.debug(`Using default stage context properties for ${stage} stage`)
117
+ return
118
+ }
119
+
120
+ /* read the extra properties */
121
+ const stageContextPropsBuffer = fs.readFileSync(stageContextFilePath)
122
+ if (debug) console.debug(`Adding additional stage contexts provided in ${stageContextFilePath}`)
123
+
124
+ /* parse as JSON properties */
125
+ const stageContextProps = JSON.parse(stageContextPropsBuffer.toString('utf-8'))
126
+
127
+ /* set each of the property into the cdk node context */
128
+ Object.keys(stageContextProps).forEach((propKey: any) => {
129
+ /* handle object, array properties */
130
+ if (typeof stageContextProps[propKey] === 'object' && !Array.isArray(stageContextProps[propKey])) {
131
+ this.node.setContext(propKey, {
132
+ ...this.node.tryGetContext(propKey),
133
+ ...stageContextProps[propKey],
134
+ })
135
+ } else {
136
+ /* handle all other primitive properties */
137
+ this.node.setContext(propKey, stageContextProps[propKey])
138
+ }
139
+ })
140
+ }
141
+
142
+ /**
143
+ * @summary Determine the fully qualified domain name based on domainName & subDomain
144
+ */
145
+ protected fullyQualifiedDomain() {
146
+ const domainName = this.node.tryGetContext('domainName')
147
+ const subDomain = this.node.tryGetContext('subDomain')
148
+ return subDomain ? `${subDomain}.${domainName}` : domainName
149
+ }
150
+ }
@@ -0,0 +1,15 @@
1
+ import { StackProps } from 'aws-cdk-lib'
2
+ import { Runtime, Tracing } from 'aws-cdk-lib/aws-lambda'
3
+ import { RetentionDays } from 'aws-cdk-lib/aws-logs'
4
+ import { BaseProps } from '../../common'
5
+
6
+ /**
7
+ */
8
+ export interface CommonStackProps extends BaseProps, StackProps {
9
+ region: string
10
+ logRetention?: RetentionDays
11
+ defaultReservedLambdaConcurrentExecutions?: number
12
+ defaultTracing?: Tracing
13
+ excludeDomainNameForBuckets?: boolean
14
+ nodejsRuntime?: Runtime
15
+ }
@@ -0,0 +1,5 @@
1
+ export * from './common'
2
+ export * from './construct'
3
+ export * from './services'
4
+ export * from './types'
5
+ export * from './utils'
@@ -2,7 +2,7 @@ import { fromEnv, fromIni } from '@aws-sdk/credential-providers'
2
2
  import { AwsCredentialIdentityProvider } from '@aws-sdk/types'
3
3
  import { CfnOutput } from 'aws-cdk-lib'
4
4
  import _ from 'lodash'
5
- import { CommonConstruct } from '../../common'
5
+ import { CommonConstruct } from '../common'
6
6
 
7
7
  /**
8
8
  * @summary Helper method to add CloudFormation outputs from the construct
@@ -39,3 +39,35 @@ export function determineCredentials(): AwsCredentialIdentityProvider {
39
39
  if (process.env.AWS_PROFILE) return fromIni()
40
40
  return fromEnv()
41
41
  }
42
+
43
+ /**
44
+ */
45
+ const defaultResponseObject = {
46
+ body: '',
47
+ headers: {
48
+ 'Access-Control-Allow-Origin': '*',
49
+ },
50
+ isBase64Encoded: false,
51
+ statusCode: 200,
52
+ }
53
+
54
+ /**
55
+ * @param error
56
+ */
57
+ export function redirectError(error: any) {
58
+ console.error(error, error.message, error.stack)
59
+ return Object.assign({}, defaultResponseObject, {
60
+ body: JSON.stringify(Object.assign({}, { error: error.message, success: false })),
61
+ statusCode: 500,
62
+ })
63
+ }
64
+
65
+ /**
66
+ * @param message
67
+ */
68
+ export function redirectSuccess(message: any) {
69
+ return Object.assign({}, defaultResponseObject, {
70
+ body: JSON.stringify(Object.assign({}, { error: message, success: true })),
71
+ statusCode: 200,
72
+ })
73
+ }
@@ -0,0 +1,57 @@
1
+ import { AzurermProvider } from '@cdktf/provider-azurerm/lib/provider'
2
+ import { TerraformStack } from 'cdktf'
3
+ import { Construct } from 'constructs'
4
+ import { isDevStage, isPrdStage, isTestStage, isUatStage } from '../../common'
5
+ import { AzureStorageManager } from '../services'
6
+ import { CommonAzureStackProps } from './types'
7
+
8
+ export class CommonAzureConstruct extends TerraformStack {
9
+ declare props: CommonAzureStackProps
10
+ id: string
11
+ fullyQualifiedDomainName: string
12
+ storageManager: AzureStorageManager
13
+
14
+ constructor(scope: Construct, id: string, props: CommonAzureStackProps) {
15
+ super(scope, id)
16
+ this.props = props
17
+ this.id = id
18
+
19
+ this.storageManager = new AzureStorageManager()
20
+
21
+ this.determineFullyQualifiedDomain()
22
+ new AzurermProvider(this, `${this.id}-provider`, this.props)
23
+ }
24
+
25
+ /**
26
+ * @summary Determine the fully qualified domain name based on domainName & subDomain
27
+ */
28
+ protected determineFullyQualifiedDomain(): void {
29
+ this.fullyQualifiedDomainName = this.props.subDomain
30
+ ? `${this.props.subDomain}.${this.props.domainName}`
31
+ : this.props.domainName
32
+ }
33
+
34
+ /**
35
+ * @summary Utility method to determine if the initialisation is in development (dev) stage
36
+ * This is determined by the stage property injected via cdk context
37
+ */
38
+ public isDevelopmentStage = () => isDevStage(this.props.stage)
39
+
40
+ /**
41
+ * @summary Utility method to determine if the initialisation is in test (tst) stage
42
+ * This is determined by the stage property injected via cdk context
43
+ */
44
+ public isTestStage = () => isTestStage(this.props.stage)
45
+
46
+ /**
47
+ * @summary Utility method to determine if the initialisation is in uat (uat) stage
48
+ * This is determined by the stage property injected via cdk context
49
+ */
50
+ public isUatStage = () => isUatStage(this.props.stage)
51
+
52
+ /**
53
+ * @summary Utility method to determine if the initialisation is in production (prd) stage
54
+ * This is determined by the stage property injected via cdk context
55
+ */
56
+ public isProductionStage = () => isPrdStage(this.props.stage)
57
+ }
@@ -0,0 +1,3 @@
1
+ export * from './construct'
2
+ export * from './stack'
3
+ export * from './types'
@@ -0,0 +1,145 @@
1
+ import fs from 'fs'
2
+ import { CommonAzureConstruct } from './construct'
3
+ import { CommonAzureStackProps } from './types'
4
+
5
+ import appRoot from 'app-root-path'
6
+ import { App, TerraformStack } from 'cdktf'
7
+ import { isDevStage } from '../../common'
8
+ import { Construct } from 'constructs'
9
+
10
+ /**
11
+ * @classdesc Common stack to use as a base for all higher level constructs.
12
+ * @example
13
+ * import { CommonAzureStack } from '@gradientedge/cdk-utils'
14
+ *
15
+ * class CustomStack extends CommonAzureStack {
16
+ * constructor(parent: App, name: string, props: StackProps) {
17
+ * super(parent, name, props)
18
+ * // provision resources
19
+ * }
20
+ * }
21
+ */
22
+ export class CommonAzureStack extends TerraformStack {
23
+ construct: CommonAzureConstruct
24
+ props: CommonAzureStackProps
25
+
26
+ constructor(parent: Construct, name: string, props: CommonAzureStackProps) {
27
+ super(parent, name)
28
+
29
+ /* determine extra cdk contexts */
30
+ this.determineExtraContexts()
31
+
32
+ /* determine extra cdk stage contexts */
33
+ this.determineStageContexts()
34
+
35
+ this.props = this.determineConstructProps(props)
36
+
37
+ /* initialise the construct */
38
+ this.construct = new CommonAzureConstruct(this, 'cdk-utils', this.props)
39
+ }
40
+
41
+ /**
42
+ * @summary Method to determine the core CDK construct properties injected via context cdktf.json
43
+ * @param props The stack properties
44
+ * @returns The stack properties
45
+ */
46
+ protected determineConstructProps(props: CommonAzureStackProps) {
47
+ return {
48
+ domainName: this.node.tryGetContext('domainName'),
49
+ extraContexts: this.node.tryGetContext('extraContexts'),
50
+ features: this.node.tryGetContext('features'),
51
+ name: this.node.tryGetContext('resourceGroupName'),
52
+ resourceGroupName: this.node.tryGetContext('resourceGroupName'),
53
+ skipStageForARecords: this.node.tryGetContext('skipStageForARecords'),
54
+ stage: this.node.tryGetContext('stage'),
55
+ subDomain: this.node.tryGetContext('subDomain'),
56
+ }
57
+ }
58
+
59
+ /**
60
+ * @summary Method to determine extra cdk contexts apart from the main cdktf.json
61
+ * - Sets the properties from the extra contexts into cdk node context
62
+ * - Primary use is to have layered config in separate files to enable easier maintenance and readability
63
+ */
64
+ protected determineExtraContexts() {
65
+ const extraContexts = this.node.tryGetContext('extraContexts')
66
+ const debug = this.node.tryGetContext('debug')
67
+
68
+ if (!extraContexts) {
69
+ if (debug) console.debug(`No additional contexts provided. Using default context properties from cdktf.json`)
70
+ return
71
+ }
72
+
73
+ extraContexts.forEach((context: string) => {
74
+ const extraContextPath = `${appRoot.path}/${context}`
75
+
76
+ /* scenario where extra context is configured in cdk.json but absent in file system */
77
+ if (!fs.existsSync(extraContextPath)) throw `Extra context properties unavailable in path:${extraContextPath}`
78
+
79
+ /* read the extra properties */
80
+ const extraContextPropsBuffer = fs.readFileSync(extraContextPath)
81
+ if (debug) console.debug(`Adding additional contexts provided in ${extraContextPath}`)
82
+
83
+ /* parse as JSON properties */
84
+ const extraContextProps = JSON.parse(extraContextPropsBuffer.toString('utf-8'))
85
+
86
+ /* set each of the property into the cdk node context */
87
+ Object.keys(extraContextProps).forEach((propKey: any) => {
88
+ this.node.setContext(propKey, extraContextProps[propKey])
89
+ })
90
+ })
91
+ }
92
+
93
+ /**
94
+ * @summary Method to determine extra cdk stage contexts apart from the main cdktf.json
95
+ * - Sets the properties from the extra stage contexts into cdk node context
96
+ * - Primary use is to have layered config for each environment which is injected into the context
97
+ */
98
+ protected determineStageContexts() {
99
+ const stage = this.node.tryGetContext('stage')
100
+ const stageContextPath = this.node.tryGetContext('stageContextPath') || 'cdkEnv'
101
+ const stageContextFilePath = `${appRoot.path}/${stageContextPath}/${stage}.json`
102
+ const debug = this.node.tryGetContext('debug')
103
+
104
+ if (isDevStage(stage)) {
105
+ if (debug) console.debug(`Development stage. Using default stage context properties`)
106
+ }
107
+
108
+ /* alert default context usage when extra stage config is missing */
109
+ if (!fs.existsSync(stageContextFilePath)) {
110
+ if (debug) console.debug(`Stage specific context properties unavailable in path:${stageContextFilePath}`)
111
+ if (debug) console.debug(`Using default stage context properties for ${stage} stage`)
112
+ return
113
+ }
114
+
115
+ /* read the extra properties */
116
+ const stageContextPropsBuffer = fs.readFileSync(stageContextFilePath)
117
+ if (debug) console.debug(`Adding additional stage contexts provided in ${stageContextFilePath}`)
118
+
119
+ /* parse as JSON properties */
120
+ const stageContextProps = JSON.parse(stageContextPropsBuffer.toString('utf-8'))
121
+
122
+ /* set each of the property into the cdk node context */
123
+ Object.keys(stageContextProps).forEach((propKey: any) => {
124
+ /* handle object, array properties */
125
+ if (typeof stageContextProps[propKey] === 'object' && !Array.isArray(stageContextProps[propKey])) {
126
+ this.node.setContext(propKey, {
127
+ ...this.node.tryGetContext(propKey),
128
+ ...stageContextProps[propKey],
129
+ })
130
+ } else {
131
+ /* handle all other primitive properties */
132
+ this.node.setContext(propKey, stageContextProps[propKey])
133
+ }
134
+ })
135
+ }
136
+
137
+ /**
138
+ * @summary Determine the fully qualified domain name based on domainName & subDomain
139
+ */
140
+ protected fullyQualifiedDomain() {
141
+ const domainName = this.node.tryGetContext('domainName')
142
+ const subDomain = this.node.tryGetContext('subDomain')
143
+ return subDomain ? `${subDomain}.${domainName}` : domainName
144
+ }
145
+ }
@@ -0,0 +1,8 @@
1
+ import { AzurermProviderConfig } from '@cdktf/provider-azurerm/lib/provider'
2
+ import { BaseProps } from '../../common'
3
+
4
+ /**
5
+ */
6
+ export interface CommonAzureStackProps extends BaseProps, AzurermProviderConfig {
7
+ resourceGroupName?: string
8
+ }
@@ -0,0 +1,4 @@
1
+ export * from './common'
2
+ export * from './services'
3
+ export * from './types'
4
+ export * from './utils'
@@ -0,0 +1 @@
1
+ export * from './storage'
@@ -0,0 +1,2 @@
1
+ export * from './main'
2
+ export * from './types'