@gradientedge/cdk-utils 4.4.6 → 4.5.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 (325) hide show
  1. package/app/api-destined-function/node_modules/.yarn-integrity +1 -1
  2. package/app/api-destined-function/node_modules/minimatch/README.md +1 -1
  3. package/app/api-destined-function/node_modules/minimatch/minimatch.js +74 -45
  4. package/app/api-destined-function/node_modules/minimatch/package.json +3 -3
  5. package/app/api-destined-function/node_modules/uuid/dist/bin/uuid +2 -0
  6. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/index.js +9 -0
  7. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/md5.js +215 -0
  8. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/nil.js +1 -0
  9. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/parse.js +35 -0
  10. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/regex.js +1 -0
  11. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/rng.js +19 -0
  12. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/sha1.js +96 -0
  13. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/stringify.js +30 -0
  14. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v1.js +95 -0
  15. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v3.js +4 -0
  16. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v35.js +64 -0
  17. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v4.js +24 -0
  18. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v5.js +4 -0
  19. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/validate.js +7 -0
  20. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/version.js +11 -0
  21. package/app/api-destined-function/node_modules/uuid/dist/esm-node/index.js +9 -0
  22. package/app/api-destined-function/node_modules/uuid/dist/esm-node/md5.js +13 -0
  23. package/app/api-destined-function/node_modules/uuid/dist/esm-node/nil.js +1 -0
  24. package/app/api-destined-function/node_modules/uuid/dist/esm-node/parse.js +35 -0
  25. package/app/api-destined-function/node_modules/uuid/dist/esm-node/regex.js +1 -0
  26. package/app/api-destined-function/node_modules/uuid/dist/esm-node/rng.js +12 -0
  27. package/app/api-destined-function/node_modules/uuid/dist/esm-node/sha1.js +13 -0
  28. package/app/api-destined-function/node_modules/uuid/dist/esm-node/stringify.js +29 -0
  29. package/app/api-destined-function/node_modules/uuid/dist/esm-node/v1.js +95 -0
  30. package/app/api-destined-function/node_modules/uuid/dist/esm-node/v3.js +4 -0
  31. package/app/api-destined-function/node_modules/uuid/dist/esm-node/v35.js +64 -0
  32. package/app/api-destined-function/node_modules/uuid/dist/esm-node/v4.js +24 -0
  33. package/app/api-destined-function/node_modules/uuid/dist/esm-node/v5.js +4 -0
  34. package/app/api-destined-function/node_modules/uuid/dist/esm-node/validate.js +7 -0
  35. package/app/api-destined-function/node_modules/uuid/dist/esm-node/version.js +11 -0
  36. package/app/api-destined-function/node_modules/uuid/dist/index.js +79 -0
  37. package/app/api-destined-function/node_modules/uuid/dist/md5-browser.js +223 -0
  38. package/app/api-destined-function/node_modules/uuid/dist/md5.js +23 -0
  39. package/app/api-destined-function/node_modules/uuid/dist/nil.js +8 -0
  40. package/app/api-destined-function/node_modules/uuid/dist/parse.js +45 -0
  41. package/app/api-destined-function/node_modules/uuid/dist/regex.js +8 -0
  42. package/app/api-destined-function/node_modules/uuid/dist/rng-browser.js +26 -0
  43. package/app/api-destined-function/node_modules/uuid/dist/rng.js +24 -0
  44. package/app/api-destined-function/node_modules/uuid/dist/sha1-browser.js +104 -0
  45. package/app/api-destined-function/node_modules/uuid/dist/sha1.js +23 -0
  46. package/app/api-destined-function/node_modules/uuid/dist/stringify.js +39 -0
  47. package/app/api-destined-function/node_modules/uuid/dist/umd/uuid.min.js +1 -0
  48. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidNIL.min.js +1 -0
  49. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidParse.min.js +1 -0
  50. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidStringify.min.js +1 -0
  51. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidValidate.min.js +1 -0
  52. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidVersion.min.js +1 -0
  53. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv1.min.js +1 -0
  54. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv3.min.js +1 -0
  55. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv4.min.js +1 -0
  56. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv5.min.js +1 -0
  57. package/app/api-destined-function/node_modules/uuid/dist/uuid-bin.js +85 -0
  58. package/app/api-destined-function/node_modules/uuid/dist/v1.js +107 -0
  59. package/app/api-destined-function/node_modules/uuid/dist/v3.js +16 -0
  60. package/app/api-destined-function/node_modules/uuid/dist/v35.js +78 -0
  61. package/app/api-destined-function/node_modules/uuid/dist/v4.js +37 -0
  62. package/app/api-destined-function/node_modules/uuid/dist/v5.js +16 -0
  63. package/app/api-destined-function/node_modules/uuid/dist/validate.js +17 -0
  64. package/app/api-destined-function/node_modules/uuid/dist/version.js +21 -0
  65. package/app/api-destined-function/package.json +2 -1
  66. package/dist/app/api-destined-function/layers/nodejs/node_modules/.bin/uuid +2 -0
  67. package/dist/app/api-destined-function/layers/nodejs/node_modules/.yarn-integrity +109 -0
  68. package/dist/app/api-destined-function/layers/nodejs/node_modules/@types/uuid/LICENSE +21 -0
  69. package/dist/app/api-destined-function/layers/nodejs/node_modules/@types/uuid/README.md +16 -0
  70. package/dist/app/api-destined-function/layers/nodejs/node_modules/@types/uuid/index.d.mts +10 -0
  71. package/dist/app/api-destined-function/layers/nodejs/node_modules/@types/uuid/index.d.ts +80 -0
  72. package/dist/app/api-destined-function/layers/nodejs/node_modules/@types/uuid/package.json +54 -0
  73. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/LICENSE.md +9 -0
  74. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/README.md +505 -0
  75. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/bin/uuid +2 -0
  76. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/index.js +9 -0
  77. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/md5.js +215 -0
  78. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/nil.js +1 -0
  79. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/parse.js +35 -0
  80. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/regex.js +1 -0
  81. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/rng.js +19 -0
  82. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/sha1.js +96 -0
  83. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/stringify.js +30 -0
  84. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v1.js +95 -0
  85. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v3.js +4 -0
  86. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v35.js +64 -0
  87. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v4.js +24 -0
  88. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v5.js +4 -0
  89. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/validate.js +7 -0
  90. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/version.js +11 -0
  91. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/index.js +9 -0
  92. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/md5.js +13 -0
  93. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/nil.js +1 -0
  94. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/parse.js +35 -0
  95. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/regex.js +1 -0
  96. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/rng.js +12 -0
  97. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/sha1.js +13 -0
  98. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/stringify.js +29 -0
  99. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/v1.js +95 -0
  100. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/v3.js +4 -0
  101. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/v35.js +64 -0
  102. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/v4.js +24 -0
  103. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/v5.js +4 -0
  104. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/validate.js +7 -0
  105. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/version.js +11 -0
  106. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/index.js +79 -0
  107. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/md5-browser.js +223 -0
  108. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/md5.js +23 -0
  109. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/nil.js +8 -0
  110. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/parse.js +45 -0
  111. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/regex.js +8 -0
  112. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/rng-browser.js +26 -0
  113. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/rng.js +24 -0
  114. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/sha1-browser.js +104 -0
  115. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/sha1.js +23 -0
  116. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/stringify.js +39 -0
  117. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuid.min.js +1 -0
  118. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidNIL.min.js +1 -0
  119. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidParse.min.js +1 -0
  120. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidStringify.min.js +1 -0
  121. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidValidate.min.js +1 -0
  122. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidVersion.min.js +1 -0
  123. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidv1.min.js +1 -0
  124. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidv3.min.js +1 -0
  125. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidv4.min.js +1 -0
  126. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidv5.min.js +1 -0
  127. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/uuid-bin.js +85 -0
  128. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/v1.js +107 -0
  129. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/v3.js +16 -0
  130. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/v35.js +78 -0
  131. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/v4.js +37 -0
  132. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/v5.js +16 -0
  133. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/validate.js +17 -0
  134. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/version.js +21 -0
  135. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/package.json +135 -0
  136. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/wrapper.mjs +10 -0
  137. package/dist/app/api-destined-function/layers/nodejs/package.json +30 -0
  138. package/dist/app/api-destined-function/src/lib/lambda.d.ts +19 -0
  139. package/dist/app/api-destined-function/src/lib/lambda.d.ts.map +1 -0
  140. package/dist/app/api-destined-function/src/lib/lambda.js +34 -0
  141. package/dist/app/api-destined-function/src/lib/lambda.js.map +1 -0
  142. package/dist/index.d.ts +6 -0
  143. package/dist/index.d.ts.map +1 -0
  144. package/dist/index.js.map +1 -0
  145. package/dist/src/lib/common/construct.d.ts +81 -0
  146. package/dist/src/lib/common/construct.d.ts.map +1 -0
  147. package/dist/src/lib/common/construct.js +136 -0
  148. package/dist/src/lib/common/construct.js.map +1 -0
  149. package/dist/src/lib/common/index.d.ts +3 -0
  150. package/dist/src/lib/common/index.d.ts.map +1 -0
  151. package/dist/src/lib/common/index.js +15 -0
  152. package/dist/src/lib/common/index.js.map +1 -0
  153. package/dist/src/lib/common/stack.d.ts +55 -0
  154. package/dist/src/lib/common/stack.d.ts.map +1 -0
  155. package/dist/src/lib/common/stack.js +148 -0
  156. package/dist/src/lib/common/stack.js.map +1 -0
  157. package/dist/src/lib/construct/api-to-eventbridge-target/api-destination-event.d.ts +17 -0
  158. package/dist/src/lib/construct/api-to-eventbridge-target/api-destination-event.d.ts.map +1 -0
  159. package/dist/src/lib/construct/api-to-eventbridge-target/api-destination-event.js +18 -0
  160. package/dist/src/lib/construct/api-to-eventbridge-target/api-destination-event.js.map +1 -0
  161. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-lambda.d.ts +20 -0
  162. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-lambda.d.ts.map +1 -0
  163. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-lambda.js +20 -0
  164. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-lambda.js.map +1 -0
  165. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-rest-api.d.ts +36 -0
  166. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-rest-api.d.ts.map +1 -0
  167. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-rest-api.js +30 -0
  168. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-rest-api.js.map +1 -0
  169. package/dist/src/lib/construct/api-to-eventbridge-target/index.d.ts +5 -0
  170. package/dist/src/lib/construct/api-to-eventbridge-target/index.d.ts.map +1 -0
  171. package/dist/src/lib/construct/api-to-eventbridge-target/index.js +17 -0
  172. package/dist/src/lib/construct/api-to-eventbridge-target/index.js.map +1 -0
  173. package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +135 -0
  174. package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts.map +1 -0
  175. package/dist/src/lib/construct/api-to-eventbridge-target/main.js +488 -0
  176. package/dist/src/lib/construct/api-to-eventbridge-target/main.js.map +1 -0
  177. package/dist/src/lib/construct/graphql-api-lambda/index.d.ts +2 -0
  178. package/dist/src/lib/construct/graphql-api-lambda/index.d.ts.map +1 -0
  179. package/dist/src/lib/construct/graphql-api-lambda/index.js +14 -0
  180. package/dist/src/lib/construct/graphql-api-lambda/index.js.map +1 -0
  181. package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +113 -0
  182. package/dist/src/lib/construct/graphql-api-lambda/main.d.ts.map +1 -0
  183. package/dist/src/lib/construct/graphql-api-lambda/main.js +202 -0
  184. package/dist/src/lib/construct/graphql-api-lambda/main.js.map +1 -0
  185. package/dist/src/lib/construct/index.d.ts +5 -0
  186. package/dist/src/lib/construct/index.d.ts.map +1 -0
  187. package/dist/src/lib/construct/index.js +17 -0
  188. package/dist/src/lib/construct/index.js.map +1 -0
  189. package/dist/src/lib/construct/site-with-ecs-backend/index.d.ts +2 -0
  190. package/dist/src/lib/construct/site-with-ecs-backend/index.d.ts.map +1 -0
  191. package/dist/src/lib/construct/site-with-ecs-backend/index.js +14 -0
  192. package/dist/src/lib/construct/site-with-ecs-backend/index.js.map +1 -0
  193. package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +168 -0
  194. package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts.map +1 -0
  195. package/dist/src/lib/construct/site-with-ecs-backend/main.js +328 -0
  196. package/dist/src/lib/construct/site-with-ecs-backend/main.js.map +1 -0
  197. package/dist/src/lib/construct/static-site/index.d.ts +2 -0
  198. package/dist/src/lib/construct/static-site/index.d.ts.map +1 -0
  199. package/dist/src/lib/construct/static-site/index.js +14 -0
  200. package/dist/src/lib/construct/static-site/index.js.map +1 -0
  201. package/dist/src/lib/construct/static-site/main.d.ts +95 -0
  202. package/dist/src/lib/construct/static-site/main.d.ts.map +1 -0
  203. package/dist/src/lib/construct/static-site/main.js +169 -0
  204. package/dist/src/lib/construct/static-site/main.js.map +1 -0
  205. package/dist/src/lib/manager/aws/acm-manager.d.ts +47 -0
  206. package/dist/src/lib/manager/aws/acm-manager.d.ts.map +1 -0
  207. package/dist/src/lib/manager/aws/acm-manager.js +91 -0
  208. package/dist/src/lib/manager/aws/acm-manager.js.map +1 -0
  209. package/dist/src/lib/manager/aws/api-manager.d.ts +44 -0
  210. package/dist/src/lib/manager/aws/api-manager.d.ts.map +1 -0
  211. package/dist/src/lib/manager/aws/api-manager.js +112 -0
  212. package/dist/src/lib/manager/aws/api-manager.js.map +1 -0
  213. package/dist/src/lib/manager/aws/app-config-manager.d.ts +66 -0
  214. package/dist/src/lib/manager/aws/app-config-manager.d.ts.map +1 -0
  215. package/dist/src/lib/manager/aws/app-config-manager.js +149 -0
  216. package/dist/src/lib/manager/aws/app-config-manager.js.map +1 -0
  217. package/dist/src/lib/manager/aws/cloudfront-manager.d.ts +113 -0
  218. package/dist/src/lib/manager/aws/cloudfront-manager.d.ts.map +1 -0
  219. package/dist/src/lib/manager/aws/cloudfront-manager.js +283 -0
  220. package/dist/src/lib/manager/aws/cloudfront-manager.js.map +1 -0
  221. package/dist/src/lib/manager/aws/cloudtrail-manager.d.ts +49 -0
  222. package/dist/src/lib/manager/aws/cloudtrail-manager.d.ts.map +1 -0
  223. package/dist/src/lib/manager/aws/cloudtrail-manager.js +100 -0
  224. package/dist/src/lib/manager/aws/cloudtrail-manager.js.map +1 -0
  225. package/dist/src/lib/manager/aws/cloudwatch-manager.d.ts +122 -0
  226. package/dist/src/lib/manager/aws/cloudwatch-manager.d.ts.map +1 -0
  227. package/dist/src/lib/manager/aws/cloudwatch-manager.js +353 -0
  228. package/dist/src/lib/manager/aws/cloudwatch-manager.js.map +1 -0
  229. package/dist/src/lib/manager/aws/codebuild-manager.d.ts +41 -0
  230. package/dist/src/lib/manager/aws/codebuild-manager.d.ts.map +1 -0
  231. package/dist/src/lib/manager/aws/codebuild-manager.js +95 -0
  232. package/dist/src/lib/manager/aws/codebuild-manager.js.map +1 -0
  233. package/dist/src/lib/manager/aws/dynamodb-manager.d.ts +33 -0
  234. package/dist/src/lib/manager/aws/dynamodb-manager.d.ts.map +1 -0
  235. package/dist/src/lib/manager/aws/dynamodb-manager.js +80 -0
  236. package/dist/src/lib/manager/aws/dynamodb-manager.js.map +1 -0
  237. package/dist/src/lib/manager/aws/ecr-manager.d.ts +32 -0
  238. package/dist/src/lib/manager/aws/ecr-manager.d.ts.map +1 -0
  239. package/dist/src/lib/manager/aws/ecr-manager.js +61 -0
  240. package/dist/src/lib/manager/aws/ecr-manager.js.map +1 -0
  241. package/dist/src/lib/manager/aws/ecs-manager.d.ts +49 -0
  242. package/dist/src/lib/manager/aws/ecs-manager.d.ts.map +1 -0
  243. package/dist/src/lib/manager/aws/ecs-manager.js +104 -0
  244. package/dist/src/lib/manager/aws/ecs-manager.js.map +1 -0
  245. package/dist/src/lib/manager/aws/eks-manager.d.ts +37 -0
  246. package/dist/src/lib/manager/aws/eks-manager.d.ts.map +1 -0
  247. package/dist/src/lib/manager/aws/eks-manager.js +110 -0
  248. package/dist/src/lib/manager/aws/eks-manager.js.map +1 -0
  249. package/dist/src/lib/manager/aws/elasticache-manager.d.ts +43 -0
  250. package/dist/src/lib/manager/aws/elasticache-manager.d.ts.map +1 -0
  251. package/dist/src/lib/manager/aws/elasticache-manager.js +103 -0
  252. package/dist/src/lib/manager/aws/elasticache-manager.js.map +1 -0
  253. package/dist/src/lib/manager/aws/event-manager.d.ts +68 -0
  254. package/dist/src/lib/manager/aws/event-manager.d.ts.map +1 -0
  255. package/dist/src/lib/manager/aws/event-manager.js +163 -0
  256. package/dist/src/lib/manager/aws/event-manager.js.map +1 -0
  257. package/dist/src/lib/manager/aws/iam-manager.d.ts +155 -0
  258. package/dist/src/lib/manager/aws/iam-manager.d.ts.map +1 -0
  259. package/dist/src/lib/manager/aws/iam-manager.js +381 -0
  260. package/dist/src/lib/manager/aws/iam-manager.js.map +1 -0
  261. package/dist/src/lib/manager/aws/index.d.ts +24 -0
  262. package/dist/src/lib/manager/aws/index.d.ts.map +1 -0
  263. package/dist/src/lib/manager/aws/index.js +36 -0
  264. package/dist/src/lib/manager/aws/index.js.map +1 -0
  265. package/dist/src/lib/manager/aws/lambda-manager.d.ts +95 -0
  266. package/dist/src/lib/manager/aws/lambda-manager.d.ts.map +1 -0
  267. package/dist/src/lib/manager/aws/lambda-manager.js +197 -0
  268. package/dist/src/lib/manager/aws/lambda-manager.js.map +1 -0
  269. package/dist/src/lib/manager/aws/log-manager.d.ts +52 -0
  270. package/dist/src/lib/manager/aws/log-manager.d.ts.map +1 -0
  271. package/dist/src/lib/manager/aws/log-manager.js +109 -0
  272. package/dist/src/lib/manager/aws/log-manager.js.map +1 -0
  273. package/dist/src/lib/manager/aws/route53-manager.d.ts +69 -0
  274. package/dist/src/lib/manager/aws/route53-manager.d.ts.map +1 -0
  275. package/dist/src/lib/manager/aws/route53-manager.js +159 -0
  276. package/dist/src/lib/manager/aws/route53-manager.js.map +1 -0
  277. package/dist/src/lib/manager/aws/s3-manager.d.ts +74 -0
  278. package/dist/src/lib/manager/aws/s3-manager.d.ts.map +1 -0
  279. package/dist/src/lib/manager/aws/s3-manager.js +203 -0
  280. package/dist/src/lib/manager/aws/s3-manager.js.map +1 -0
  281. package/dist/src/lib/manager/aws/secrets-manager.d.ts +58 -0
  282. package/dist/src/lib/manager/aws/secrets-manager.d.ts.map +1 -0
  283. package/dist/src/lib/manager/aws/secrets-manager.js +117 -0
  284. package/dist/src/lib/manager/aws/secrets-manager.js.map +1 -0
  285. package/dist/src/lib/manager/aws/sns-manager.d.ts +43 -0
  286. package/dist/src/lib/manager/aws/sns-manager.d.ts.map +1 -0
  287. package/dist/src/lib/manager/aws/sns-manager.js +91 -0
  288. package/dist/src/lib/manager/aws/sns-manager.js.map +1 -0
  289. package/dist/src/lib/manager/aws/ssm-manager.d.ts +61 -0
  290. package/dist/src/lib/manager/aws/ssm-manager.d.ts.map +1 -0
  291. package/dist/src/lib/manager/aws/ssm-manager.js +125 -0
  292. package/dist/src/lib/manager/aws/ssm-manager.js.map +1 -0
  293. package/dist/src/lib/manager/aws/vpc-manager.d.ts +46 -0
  294. package/dist/src/lib/manager/aws/vpc-manager.d.ts.map +1 -0
  295. package/dist/src/lib/manager/aws/vpc-manager.js +95 -0
  296. package/dist/src/lib/manager/aws/vpc-manager.js.map +1 -0
  297. package/dist/src/lib/manager/aws/waf-manager.d.ts +40 -0
  298. package/dist/src/lib/manager/aws/waf-manager.d.ts.map +1 -0
  299. package/dist/src/lib/manager/aws/waf-manager.js +90 -0
  300. package/dist/src/lib/manager/aws/waf-manager.js.map +1 -0
  301. package/dist/src/lib/manager/index.d.ts +2 -0
  302. package/dist/src/lib/manager/index.d.ts.map +1 -0
  303. package/dist/src/lib/manager/index.js +14 -0
  304. package/dist/src/lib/manager/index.js.map +1 -0
  305. package/dist/src/lib/types/aws/index.d.ts +487 -0
  306. package/dist/src/lib/types/aws/index.d.ts.map +1 -0
  307. package/dist/src/lib/types/aws/index.js +3 -0
  308. package/dist/src/lib/types/aws/index.js.map +1 -0
  309. package/dist/src/lib/types/index.d.ts +2 -0
  310. package/dist/src/lib/types/index.d.ts.map +1 -0
  311. package/dist/src/lib/types/index.js +14 -0
  312. package/dist/src/lib/types/index.js.map +1 -0
  313. package/dist/src/lib/utils/aws/index.d.ts +16 -0
  314. package/dist/src/lib/utils/aws/index.d.ts.map +1 -0
  315. package/dist/src/lib/utils/aws/index.js +50 -0
  316. package/dist/src/lib/utils/aws/index.js.map +1 -0
  317. package/dist/src/lib/utils/index.d.ts +63 -0
  318. package/dist/src/lib/utils/index.d.ts.map +1 -0
  319. package/dist/src/lib/utils/index.js +85 -0
  320. package/dist/src/lib/utils/index.js.map +1 -0
  321. package/package.json +8 -7
  322. package/src/lib/common/construct.ts +2 -0
  323. package/src/lib/manager/aws/elasticache-manager.ts +98 -0
  324. package/src/lib/manager/aws/index.ts +1 -0
  325. package/src/lib/types/aws/index.ts +7 -0
@@ -0,0 +1,197 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.LambdaManager = void 0;
23
+ const pylambda = __importStar(require("@aws-cdk/aws-lambda-python-alpha"));
24
+ const cdk = __importStar(require("aws-cdk-lib"));
25
+ const iam = __importStar(require("aws-cdk-lib/aws-iam"));
26
+ const lambda = __importStar(require("aws-cdk-lib/aws-lambda"));
27
+ const utils = __importStar(require("../../utils"));
28
+ const cloudfront_manager_1 = require("./cloudfront-manager");
29
+ /**
30
+ * @stability stable
31
+ * @category cdk-utils.lambda-manager
32
+ * @subcategory Construct
33
+ * @classdesc Provides operations on AWS Lambda.
34
+ * - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
35
+ * - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
36
+ * @example
37
+ * import * as common from '@gradientedge/cdk-utils'
38
+ *
39
+ * class CustomConstruct extends common.common.CommonConstruct {
40
+ * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
41
+ * super(parent, id, props)
42
+ * this.props = props
43
+ * this.lambdaManager.createLambdaFunction('MyFunction', this, role, layers, code)
44
+ * }
45
+ * }
46
+ *
47
+ * @see [CDK Lambda Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda-readme.html}
48
+ */
49
+ class LambdaManager {
50
+ /**
51
+ * @summary Method to create a lambda layer (nodejs)
52
+ * @param {string} id scoped id of the resource
53
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
54
+ * @param {lambda.AssetCode} code
55
+ */
56
+ createLambdaLayer(id, scope, code) {
57
+ const lambdaLayer = new lambda.LayerVersion(scope, `${id}`, {
58
+ compatibleRuntimes: [lambda.Runtime.NODEJS_14_X],
59
+ code: code,
60
+ description: `${id}`,
61
+ layerVersionName: `${id}-${scope.props.stage}`,
62
+ });
63
+ utils.createCfnOutput(`${id}-lambdaLayerArn`, scope, lambdaLayer.layerVersionArn);
64
+ return lambdaLayer;
65
+ }
66
+ /**
67
+ * @summary Method to create a lambda layer (python)
68
+ * @param {string} id scoped id of the resource
69
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
70
+ * @param {string} entry path to layer source
71
+ */
72
+ createPythonLambdaLayer(id, scope, entry) {
73
+ const lambdaLayer = new pylambda.PythonLayerVersion(scope, `${id}`, {
74
+ compatibleRuntimes: [lambda.Runtime.PYTHON_3_8],
75
+ description: `${id}`,
76
+ entry: entry,
77
+ layerVersionName: `${id}-${scope.props.stage}`,
78
+ });
79
+ utils.createCfnOutput(`${id}-lambdaLayerArn`, scope, lambdaLayer.layerVersionArn);
80
+ return lambdaLayer;
81
+ }
82
+ /**
83
+ * @summary Method to create a lambda function (python)
84
+ * @param {string} id scoped id of the resource
85
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
86
+ * @param {types.LambdaProps} props
87
+ * @param {iam.Role | iam.CfnRole} role
88
+ * @param {lambda.ILayerVersion[]} layers
89
+ * @param {string} entry path to lambda source
90
+ * @param {string?} index
91
+ * @param {string?} handler
92
+ * @param {Map<string, string>?} environment
93
+ * @param {ec2.IVpc?} vpc
94
+ * @param {ec2.ISecurityGroup[]?} securityGroups
95
+ * @param {efs.IAccessPoint?} accessPoint
96
+ * @param {string?} mountPath
97
+ * @param {ec2.SubnetSelection?} vpcSubnets
98
+ */
99
+ createPythonLambdaFunction(id, scope, props, role, layers, entry, index, handler, environment, vpc, securityGroups, accessPoint, mountPath, vpcSubnets) {
100
+ if (!props)
101
+ throw `Lambda props undefined`;
102
+ const functionName = `${props.functionName}-${scope.props.stage}`;
103
+ const lambdaFunction = new pylambda.PythonFunction(scope, `${id}`, {
104
+ allowPublicSubnet: !!vpc,
105
+ functionName: functionName,
106
+ index: index,
107
+ handler: handler,
108
+ runtime: lambda.Runtime.PYTHON_3_8,
109
+ entry: entry,
110
+ environment: {
111
+ REGION: scope.props.region,
112
+ ...environment,
113
+ },
114
+ filesystem: accessPoint ? lambda.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
115
+ layers: layers,
116
+ logRetention: props.logRetention,
117
+ memorySize: props.memorySize,
118
+ onFailure: props.onFailure,
119
+ onSuccess: props.onSuccess,
120
+ reservedConcurrentExecutions: props.reservedConcurrentExecutions,
121
+ role: role instanceof iam.Role ? role : undefined,
122
+ securityGroups: securityGroups,
123
+ timeout: props.timeoutInSecs ? cdk.Duration.seconds(props.timeoutInSecs) : cdk.Duration.minutes(1),
124
+ vpc: vpc,
125
+ vpcSubnets: vpcSubnets,
126
+ });
127
+ utils.createCfnOutput(`${id}-lambdaArn`, scope, lambdaFunction.functionArn);
128
+ utils.createCfnOutput(`${id}-lambdaName`, scope, lambdaFunction.functionName);
129
+ return lambdaFunction;
130
+ }
131
+ /**
132
+ * @summary Method to create a lambda function (nodejs)
133
+ * @param {string} id scoped id of the resource
134
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
135
+ * @param {types.LambdaProps} props
136
+ * @param {iam.Role | iam.CfnRole} role
137
+ * @param {lambda.ILayerVersion[]} layers
138
+ * @param {lambda.AssetCode} code
139
+ * @param {string?} handler
140
+ * @param {Map<string, string>?} environment
141
+ * @param {ec2.IVpc?} vpc
142
+ * @param {ec2.ISecurityGroup[]?} securityGroups
143
+ * @param {efs.IAccessPoint?} accessPoint
144
+ * @param {string?} mountPath
145
+ * @param {ec2.SubnetSelection?} vpcSubnets
146
+ */
147
+ createLambdaFunction(id, scope, props, role, layers, code, handler, environment, vpc, securityGroups, accessPoint, mountPath, vpcSubnets) {
148
+ if (!props)
149
+ throw `Lambda props undefined`;
150
+ const functionName = `${props.functionName}-${scope.props.stage}`;
151
+ const lambdaFunction = new lambda.Function(scope, `${id}`, {
152
+ allowPublicSubnet: !!vpc,
153
+ functionName: functionName,
154
+ handler: handler || 'index.lambda_handler',
155
+ runtime: lambda.Runtime.NODEJS_14_X,
156
+ code: code,
157
+ environment: {
158
+ REGION: scope.props.region,
159
+ ...environment,
160
+ },
161
+ filesystem: accessPoint ? lambda.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
162
+ layers: layers,
163
+ logRetention: props.logRetention,
164
+ memorySize: props.memorySize,
165
+ onFailure: props.onFailure,
166
+ onSuccess: props.onSuccess,
167
+ reservedConcurrentExecutions: props.reservedConcurrentExecutions,
168
+ role: role instanceof iam.Role ? role : undefined,
169
+ securityGroups: securityGroups,
170
+ timeout: props.timeoutInSecs ? cdk.Duration.seconds(props.timeoutInSecs) : cdk.Duration.minutes(1),
171
+ vpc: vpc,
172
+ vpcSubnets: vpcSubnets,
173
+ });
174
+ utils.createCfnOutput(`${id}-lambdaArn`, scope, lambdaFunction.functionArn);
175
+ utils.createCfnOutput(`${id}-lambdaName`, scope, lambdaFunction.functionName);
176
+ return lambdaFunction;
177
+ }
178
+ /**
179
+ * @summary Method to provision a Lambda@Edge function
180
+ *
181
+ * @param {string} id scoped id of the resource
182
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
183
+ * @param {types.LambdaEdgeProps} props lambda@edge properties
184
+ * @param {lambda.ILayerVersion[]} layers
185
+ * @param {lambda.AssetCode} code
186
+ * @param {Map<string, string>?} environment
187
+ * @param {ec2.IVpc?} vpc
188
+ * @param {ec2.ISecurityGroup[]?} securityGroups
189
+ * @param {efs.IAccessPoint?} accessPoint
190
+ * @param {string?} mountPath
191
+ */
192
+ createEdgeFunction(id, scope, props, layers, code, environment, vpc, securityGroups, accessPoint, mountPath) {
193
+ return new cloudfront_manager_1.CloudFrontManager().createEdgeFunction(id, scope, props, layers, code, environment, vpc, securityGroups, accessPoint, mountPath);
194
+ }
195
+ }
196
+ exports.LambdaManager = LambdaManager;
197
+ //# sourceMappingURL=lambda-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lambda-manager.js","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/lambda-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,2EAA4D;AAC5D,iDAAkC;AAGlC,yDAA0C;AAC1C,+DAAgD;AAGhD,mDAAoC;AACpC,6DAAwD;AAExD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,aAAa;IACxB;;;;;OAKG;IACI,iBAAiB,CAAC,EAAU,EAAE,KAA6B,EAAE,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AA4B,EAAE,KAAK,CAAC,4BAA4B;YAChE,IAAI,EAAE,IAAI,YAAY,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;YACjD,cAAc,EAAE,cAAc;YAC9B,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;YAClG,GAAG,EAAE,GAAG;YACR,UAAU,EAAE,UAAU;SACvB,CAAC,CAAA;QAEF,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,CAAC,WAAW,CAAC,CAAA;QAC3E,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,CAAC,YAAY,CAAC,CAAA;QAE7E,OAAO,cAAc,CAAA;IACvB,CAAC;IAED;;;;;;;;;;;;;OAaG;IACI,kBAAkB,CACvB,EAAU,EACV,KAA6B,EAC7B,KAA4B,EAC5B,MAA8B,EAC9B,IAAsB,EACtB,WAAiB,EACjB,GAAc,EACd,cAAqC,EACrC,WAA8B,EAC9B,SAAkB;QAElB,OAAO,IAAI,sCAAiB,EAAE,CAAC,kBAAkB,CAC/C,EAAE,EACF,KAAK,EACL,KAAK,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,GAAG,EACH,cAAc,EACd,WAAW,EACX,SAAS,CACV,CAAA;IACH,CAAC;CACF;AAlND,sCAkNC"}
@@ -0,0 +1,52 @@
1
+ import * as cdk from 'aws-cdk-lib';
2
+ import * as logs from 'aws-cdk-lib/aws-logs';
3
+ import * as common from '../../common';
4
+ import * as types from '../../types';
5
+ /**
6
+ * @stability stable
7
+ * @category cdk-utils.cloudwatch-manager
8
+ * @subcategory Construct
9
+ * @classdesc Provides operations on AWS CloudWatch.
10
+ * - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
11
+ * - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
12
+ * @example
13
+ * import * as common from '@gradientedge/cdk-utils'
14
+ *
15
+ * class CustomConstruct extends common.common.CommonConstruct {
16
+ * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
17
+ * super(parent, id, props)
18
+ * this.props = props
19
+ * this.logsManager.createMetricFilter('MyMetricFilter', this, logGroup)
20
+ * }
21
+ * }
22
+ *
23
+ * @see [CDK CloudWatch Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs-readme.html}
24
+ */
25
+ export declare class LogManager {
26
+ /**
27
+ * @summary Method to create a cloudwatch metric filter
28
+ * @param {string} id scoped id of the resource
29
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
30
+ * @param {types.MetricFilterProps} props
31
+ * @param {logs.ILogGroup} logGroup
32
+ */
33
+ createMetricFilter(id: string, scope: common.CommonConstruct, props: types.MetricFilterProps, logGroup: logs.ILogGroup): {
34
+ metricFilter: cdk.aws_logs.MetricFilter;
35
+ metric: cdk.aws_cloudwatch.Metric;
36
+ };
37
+ /**
38
+ * @summary Method to create a cloudwatch log group (cfn)
39
+ * @param {string} id scoped id of the resource
40
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
41
+ * @param {types.LogProps} props
42
+ */
43
+ createCfnLogGroup(id: string, scope: common.CommonConstruct, props: types.LogProps): cdk.aws_logs.CfnLogGroup;
44
+ /**
45
+ * @summary Method to create a cloudwatch log group
46
+ * @param {string} id scoped id of the resource
47
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
48
+ * @param {types.LogProps} props
49
+ */
50
+ createLogGroup(id: string, scope: common.CommonConstruct, props: types.LogProps): cdk.aws_logs.LogGroup;
51
+ }
52
+ //# sourceMappingURL=log-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log-manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/log-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,IAAI,MAAM,sBAAsB,CAAA;AAC5C,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AAGpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,UAAU;IACrB;;;;;;OAMG;IACI,kBAAkB,CACvB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,KAAK,EAAE,KAAK,CAAC,iBAAiB,EAC9B,QAAQ,EAAE,IAAI,CAAC,SAAS;;;;IAwB1B;;;;;OAKG;IACI,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ;IAazF;;;;;OAKG;IACI,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ;CAavF"}
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.LogManager = void 0;
23
+ const cdk = __importStar(require("aws-cdk-lib"));
24
+ const logs = __importStar(require("aws-cdk-lib/aws-logs"));
25
+ const utils = __importStar(require("../../utils"));
26
+ /**
27
+ * @stability stable
28
+ * @category cdk-utils.cloudwatch-manager
29
+ * @subcategory Construct
30
+ * @classdesc Provides operations on AWS CloudWatch.
31
+ * - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
32
+ * - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
33
+ * @example
34
+ * import * as common from '@gradientedge/cdk-utils'
35
+ *
36
+ * class CustomConstruct extends common.common.CommonConstruct {
37
+ * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
38
+ * super(parent, id, props)
39
+ * this.props = props
40
+ * this.logsManager.createMetricFilter('MyMetricFilter', this, logGroup)
41
+ * }
42
+ * }
43
+ *
44
+ * @see [CDK CloudWatch Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs-readme.html}
45
+ */
46
+ class LogManager {
47
+ /**
48
+ * @summary Method to create a cloudwatch metric filter
49
+ * @param {string} id scoped id of the resource
50
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
51
+ * @param {types.MetricFilterProps} props
52
+ * @param {logs.ILogGroup} logGroup
53
+ */
54
+ createMetricFilter(id, scope, props, logGroup) {
55
+ if (!props)
56
+ throw `MetricFilter props undefined`;
57
+ const metricFilter = new logs.MetricFilter(scope, `${id}`, {
58
+ logGroup: logGroup,
59
+ metricName: props.metricName,
60
+ metricNamespace: props.metricNamespace,
61
+ metricValue: props.metricValue,
62
+ defaultValue: props.defaultValue,
63
+ filterPattern: props.filterPattern,
64
+ });
65
+ const metric = props.options
66
+ ? metricFilter.metric({
67
+ dimensionsMap: props.options.dimensionsMap,
68
+ statistic: props.options.statistic,
69
+ period: props.periodInSecs ? cdk.Duration.seconds(props.periodInSecs) : cdk.Duration.minutes(5),
70
+ })
71
+ : metricFilter.metric();
72
+ return { metricFilter, metric };
73
+ }
74
+ /**
75
+ * @summary Method to create a cloudwatch log group (cfn)
76
+ * @param {string} id scoped id of the resource
77
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
78
+ * @param {types.LogProps} props
79
+ */
80
+ createCfnLogGroup(id, scope, props) {
81
+ if (!props)
82
+ throw `Logs props undefined`;
83
+ const logGroup = new logs.CfnLogGroup(scope, `${id}`, {
84
+ logGroupName: `${props.logGroupName}-${scope.props.stage}`,
85
+ retentionInDays: props.retention,
86
+ });
87
+ utils.createCfnOutput(`${id}-logGroupArn`, scope, logGroup.attrArn);
88
+ return logGroup;
89
+ }
90
+ /**
91
+ * @summary Method to create a cloudwatch log group
92
+ * @param {string} id scoped id of the resource
93
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
94
+ * @param {types.LogProps} props
95
+ */
96
+ createLogGroup(id, scope, props) {
97
+ if (!props)
98
+ throw `Logs props undefined`;
99
+ const logGroup = new logs.LogGroup(scope, `${id}`, {
100
+ logGroupName: `${props.logGroupName}-${scope.props.stage}`,
101
+ retention: props.retention,
102
+ removalPolicy: props.removalPolicy ?? cdk.RemovalPolicy.DESTROY,
103
+ });
104
+ utils.createCfnOutput(`${id}-logGroupArn`, scope, logGroup.logGroupArn);
105
+ return logGroup;
106
+ }
107
+ }
108
+ exports.LogManager = LogManager;
109
+ //# sourceMappingURL=log-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log-manager.js","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/log-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAkC;AAClC,2DAA4C;AAG5C,mDAAoC;AAEpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,UAAU;IACrB;;;;;;OAMG;IACI,kBAAkB,CACvB,EAAU,EACV,KAA6B,EAC7B,KAA8B,EAC9B,QAAwB;QAExB,IAAI,CAAC,KAAK;YAAE,MAAM,8B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AAE,QAAQ,CAAC,OAAO,CAAC,CAAA;QAEnE,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED;;;;;OAKG;IACI,cAAc,CAAC,EAAU,EAAE,KAA6B,EAAE,KAAqB;QACpF,IAAI,CAAC,KAAK;YAAE,MAAM,sBAAsB,CAAA;QAExC,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;YACjD,YAAY,EAAE,GAAG,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;YAC1D,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,aAAa,EAAE,KAAK,CAAC,aAAa,IAAI,GAAG,CAAC,aAAa,CAAC,OAAO;SAChE,CAAC,CAAA;QAEF,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAA;QAEvE,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF;AA1ED,gCA0EC"}
@@ -0,0 +1,69 @@
1
+ import * as apig from 'aws-cdk-lib/aws-apigateway';
2
+ import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
3
+ import * as route53 from 'aws-cdk-lib/aws-route53';
4
+ import * as common from '../../common';
5
+ import * as types from '../../types';
6
+ /**
7
+ * @stability stable
8
+ * @category cdk-utils.route53-manager
9
+ * @subcategory Construct
10
+ * @classdesc Provides operations on AWS Route53.
11
+ * - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
12
+ * - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
13
+ * @example
14
+ * import * as common from '@gradientedge/cdk-utils'
15
+ *
16
+ * class CustomConstruct extends common.common.CommonConstruct {
17
+ * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
18
+ * super(parent, id, props)
19
+ * this.props = props
20
+ * this.route53Manager.createHostedZone('MyHostedZone', this)
21
+ * }
22
+ * }
23
+ *
24
+ * @see [CDK Route53 Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_route53-readme.html}
25
+ */
26
+ export declare class Route53Manager {
27
+ /**
28
+ * @summary Method to create a hosted zone
29
+ * @param {string} id scoped id of the resource
30
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
31
+ * @param {types.Route53Props} props
32
+ */
33
+ createHostedZone(id: string, scope: common.CommonConstruct, props: types.Route53Props): route53.IHostedZone;
34
+ /**
35
+ * @summary Method to create/lookup a hosted zone
36
+ * @param {string} id scoped id of the resource
37
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
38
+ * @param useExistingHostedZone Flag to indicate whether to lookup vs create new hosted zone
39
+ */
40
+ withHostedZoneFromFullyQualifiedDomainName(id: string, scope: common.CommonConstruct, useExistingHostedZone: boolean): route53.IHostedZone;
41
+ /**
42
+ * @summary Method to create a-record for cloudfront target
43
+ * @param {string} id scoped id of the resource
44
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
45
+ * @param {cloudfront.IDistribution} distribution
46
+ * @param {route53.IHostedZone} hostedZone
47
+ * @param {string} recordName
48
+ */
49
+ createCloudFrontTargetARecord(id: string, scope: common.CommonConstruct, distribution?: cloudfront.IDistribution, hostedZone?: route53.IHostedZone, recordName?: string): route53.ARecord;
50
+ /**
51
+ * @summary Method to create a-record for cloudfront target
52
+ * @param {string} id scoped id of the resource
53
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
54
+ * @param {cloudfront.IDistribution} distribution
55
+ * @param {route53.IHostedZone} hostedZone
56
+ * @param {string} recordName
57
+ */
58
+ createCloudFrontTargetARecordV2(id: string, scope: common.CommonConstruct, distribution?: cloudfront.IDistribution, hostedZone?: route53.IHostedZone, recordName?: string): route53.ARecord;
59
+ /**
60
+ * @summary Method to create a-record for restApi gateway target
61
+ * @param {string} id scoped id of the resource
62
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
63
+ * @param recordName
64
+ * @param apiDomain
65
+ * @param hostedZone
66
+ */
67
+ createApiGatewayARecord(id: string, scope: common.CommonConstruct, recordName: string, apiDomain: apig.DomainName, hostedZone: route53.IHostedZone): route53.ARecord;
68
+ }
69
+ //# sourceMappingURL=route53-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route53-manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/route53-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAA;AAClD,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAA;AACxD,OAAO,KAAK,OAAO,MAAM,yBAAyB,CAAA;AAElD,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AAGpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,cAAc;IACzB;;;;;OAKG;IACI,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,YAAY;IAsB5F;;;;;OAKG;IACI,0CAA0C,CAC/C,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,qBAAqB,EAAE,OAAO;IAqBhC;;;;;;;OAOG;IACI,6BAA6B,CAClC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,YAAY,CAAC,EAAE,UAAU,CAAC,aAAa,EACvC,UAAU,CAAC,EAAE,OAAO,CAAC,WAAW,EAChC,UAAU,CAAC,EAAE,MAAM;IAgBrB;;;;;;;OAOG;IACI,+BAA+B,CACpC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,YAAY,CAAC,EAAE,UAAU,CAAC,aAAa,EACvC,UAAU,CAAC,EAAE,OAAO,CAAC,WAAW,EAChC,UAAU,CAAC,EAAE,MAAM;IAgBrB;;;;;;;OAOG;IACI,uBAAuB,CAC5B,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,IAAI,CAAC,UAAU,EAC1B,UAAU,EAAE,OAAO,CAAC,WAAW;CAgBlC"}
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.Route53Manager = void 0;
23
+ const route53 = __importStar(require("aws-cdk-lib/aws-route53"));
24
+ const route53Targets = __importStar(require("aws-cdk-lib/aws-route53-targets"));
25
+ const utils = __importStar(require("../../utils"));
26
+ /**
27
+ * @stability stable
28
+ * @category cdk-utils.route53-manager
29
+ * @subcategory Construct
30
+ * @classdesc Provides operations on AWS Route53.
31
+ * - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
32
+ * - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
33
+ * @example
34
+ * import * as common from '@gradientedge/cdk-utils'
35
+ *
36
+ * class CustomConstruct extends common.common.CommonConstruct {
37
+ * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
38
+ * super(parent, id, props)
39
+ * this.props = props
40
+ * this.route53Manager.createHostedZone('MyHostedZone', this)
41
+ * }
42
+ * }
43
+ *
44
+ * @see [CDK Route53 Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_route53-readme.html}
45
+ */
46
+ class Route53Manager {
47
+ /**
48
+ * @summary Method to create a hosted zone
49
+ * @param {string} id scoped id of the resource
50
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
51
+ * @param {types.Route53Props} props
52
+ */
53
+ createHostedZone(id, scope, props) {
54
+ let hostedZone;
55
+ if (!props)
56
+ throw `Route53 props undefined`;
57
+ if (props.useExistingHostedZone) {
58
+ hostedZone = route53.HostedZone.fromLookup(scope, `${id}`, {
59
+ domainName: scope.props.domainName,
60
+ });
61
+ }
62
+ else {
63
+ hostedZone = new route53.HostedZone(scope, `${id}`, {
64
+ zoneName: scope.props.domainName,
65
+ comment: `Hosted zone for ${scope.props.domainName}`,
66
+ });
67
+ }
68
+ utils.createCfnOutput(`${id}-hostedZoneId`, scope, hostedZone.hostedZoneId);
69
+ utils.createCfnOutput(`${id}-hostedZoneArn`, scope, hostedZone.hostedZoneArn);
70
+ return hostedZone;
71
+ }
72
+ /**
73
+ * @summary Method to create/lookup a hosted zone
74
+ * @param {string} id scoped id of the resource
75
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
76
+ * @param useExistingHostedZone Flag to indicate whether to lookup vs create new hosted zone
77
+ */
78
+ withHostedZoneFromFullyQualifiedDomainName(id, scope, useExistingHostedZone) {
79
+ let hostedZone;
80
+ if (useExistingHostedZone) {
81
+ hostedZone = route53.HostedZone.fromLookup(scope, `${id}`, {
82
+ domainName: scope.fullyQualifiedDomainName,
83
+ });
84
+ }
85
+ else {
86
+ hostedZone = new route53.HostedZone(scope, `${id}`, {
87
+ zoneName: scope.fullyQualifiedDomainName,
88
+ comment: `Hosted zone for ${scope.fullyQualifiedDomainName}`,
89
+ });
90
+ }
91
+ utils.createCfnOutput(`${id}-hostedZoneId`, scope, hostedZone.hostedZoneId);
92
+ utils.createCfnOutput(`${id}-hostedZoneArn`, scope, hostedZone.hostedZoneArn);
93
+ return hostedZone;
94
+ }
95
+ /**
96
+ * @summary Method to create a-record for cloudfront target
97
+ * @param {string} id scoped id of the resource
98
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
99
+ * @param {cloudfront.IDistribution} distribution
100
+ * @param {route53.IHostedZone} hostedZone
101
+ * @param {string} recordName
102
+ */
103
+ createCloudFrontTargetARecord(id, scope, distribution, hostedZone, recordName) {
104
+ if (!distribution)
105
+ throw `Distribution undefined`;
106
+ if (!hostedZone)
107
+ throw `HostedZone undefined`;
108
+ const aRecord = new route53.ARecord(scope, `${id}`, {
109
+ recordName: recordName && scope.isProductionStage() ? `${recordName}` : `${recordName}-${scope.props.stage}`,
110
+ target: route53.RecordTarget.fromAlias(new route53Targets.CloudFrontTarget(distribution)),
111
+ zone: hostedZone,
112
+ });
113
+ utils.createCfnOutput(`${id}-aRecordDomainName`, scope, aRecord.domainName);
114
+ return aRecord;
115
+ }
116
+ /**
117
+ * @summary Method to create a-record for cloudfront target
118
+ * @param {string} id scoped id of the resource
119
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
120
+ * @param {cloudfront.IDistribution} distribution
121
+ * @param {route53.IHostedZone} hostedZone
122
+ * @param {string} recordName
123
+ */
124
+ createCloudFrontTargetARecordV2(id, scope, distribution, hostedZone, recordName) {
125
+ if (!distribution)
126
+ throw `Distribution undefined`;
127
+ if (!hostedZone)
128
+ throw `HostedZone undefined`;
129
+ const aRecord = new route53.ARecord(scope, `${id}`, {
130
+ recordName: recordName,
131
+ target: route53.RecordTarget.fromAlias(new route53Targets.CloudFrontTarget(distribution)),
132
+ zone: hostedZone,
133
+ });
134
+ utils.createCfnOutput(`${id}-aRecordDomainName`, scope, aRecord.domainName);
135
+ return aRecord;
136
+ }
137
+ /**
138
+ * @summary Method to create a-record for restApi gateway target
139
+ * @param {string} id scoped id of the resource
140
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
141
+ * @param recordName
142
+ * @param apiDomain
143
+ * @param hostedZone
144
+ */
145
+ createApiGatewayARecord(id, scope, recordName, apiDomain, hostedZone) {
146
+ let apiRecordName = '';
147
+ if (recordName && recordName !== '')
148
+ apiRecordName = scope.isProductionStage() ? `${recordName}` : `${recordName}-${scope.props.stage}`;
149
+ const apiARecord = new route53.ARecord(scope, `${id}`, {
150
+ recordName: apiRecordName,
151
+ target: route53.RecordTarget.fromAlias(new route53Targets.ApiGatewayDomain(apiDomain)),
152
+ zone: hostedZone,
153
+ });
154
+ utils.createCfnOutput(`${id}-a-record-domain-name`, scope, apiARecord.domainName);
155
+ return apiARecord;
156
+ }
157
+ }
158
+ exports.Route53Manager = Route53Manager;
159
+ //# sourceMappingURL=route53-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route53-manager.js","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/route53-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,iEAAkD;AAClD,gFAAiE;AAGjE,mDAAoC;AAEpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,cAAc;IACzB;;;;;OAKG;IACI,gBAAgB,CAAC,EAAU,EAAE,KAA6B,EAAE,KAAyB;QAC1F,IAAI,UAA+B,CAAA;QAEnC,IAAI,CAAC,KAAK;YAAE,MAAM,yBAAyB,CAAA;QAE3C,IAAI,KAAK,CAAC,qBAAqB,EAAE;YAC/B,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;gBACzD,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,UAAU;aACnC,CAAC,CAAA;SACH;aAAM;YACL,UAAU,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;gBAClD,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,UAAU;gBAChC,OAAO,EAAE,mBAAmB,KAAK,CAAC,KAAK,CAAC,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