@gradientedge/cdk-utils 4.4.7 → 4.5.1

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 (389) hide show
  1. package/app/api-destined-function/node_modules/.yarn-integrity +89 -2
  2. package/app/api-destined-function/node_modules/balanced-match/LICENSE.md +21 -0
  3. package/app/api-destined-function/node_modules/balanced-match/README.md +97 -0
  4. package/app/api-destined-function/node_modules/balanced-match/index.js +62 -0
  5. package/app/api-destined-function/node_modules/balanced-match/package.json +48 -0
  6. package/app/api-destined-function/node_modules/brace-expansion/LICENSE +21 -0
  7. package/app/api-destined-function/node_modules/brace-expansion/README.md +129 -0
  8. package/app/api-destined-function/node_modules/brace-expansion/index.js +201 -0
  9. package/app/api-destined-function/node_modules/brace-expansion/package.json +47 -0
  10. package/app/api-destined-function/node_modules/concat-map/.travis.yml +4 -0
  11. package/app/api-destined-function/node_modules/concat-map/LICENSE +18 -0
  12. package/app/api-destined-function/node_modules/concat-map/README.markdown +62 -0
  13. package/app/api-destined-function/node_modules/concat-map/example/map.js +6 -0
  14. package/app/api-destined-function/node_modules/concat-map/index.js +13 -0
  15. package/app/api-destined-function/node_modules/concat-map/package.json +43 -0
  16. package/app/api-destined-function/node_modules/fs.realpath/LICENSE +43 -0
  17. package/app/api-destined-function/node_modules/fs.realpath/README.md +33 -0
  18. package/app/api-destined-function/node_modules/fs.realpath/index.js +66 -0
  19. package/app/api-destined-function/node_modules/fs.realpath/old.js +303 -0
  20. package/app/api-destined-function/node_modules/fs.realpath/package.json +26 -0
  21. package/app/api-destined-function/node_modules/glob/LICENSE +21 -0
  22. package/app/api-destined-function/node_modules/glob/README.md +378 -0
  23. package/app/api-destined-function/node_modules/glob/common.js +236 -0
  24. package/app/api-destined-function/node_modules/glob/glob.js +787 -0
  25. package/app/api-destined-function/node_modules/glob/package.json +52 -0
  26. package/app/api-destined-function/node_modules/glob/sync.js +483 -0
  27. package/app/api-destined-function/node_modules/inflight/LICENSE +15 -0
  28. package/app/api-destined-function/node_modules/inflight/README.md +37 -0
  29. package/app/api-destined-function/node_modules/inflight/inflight.js +54 -0
  30. package/app/api-destined-function/node_modules/inflight/package.json +29 -0
  31. package/app/api-destined-function/node_modules/inherits/LICENSE +16 -0
  32. package/app/api-destined-function/node_modules/inherits/README.md +42 -0
  33. package/app/api-destined-function/node_modules/inherits/inherits.js +9 -0
  34. package/app/api-destined-function/node_modules/inherits/inherits_browser.js +27 -0
  35. package/app/api-destined-function/node_modules/inherits/package.json +29 -0
  36. package/app/api-destined-function/node_modules/minimatch/LICENSE +15 -0
  37. package/app/api-destined-function/node_modules/minimatch/README.md +209 -0
  38. package/app/api-destined-function/node_modules/minimatch/minimatch.js +952 -0
  39. package/app/api-destined-function/node_modules/minimatch/package.json +30 -0
  40. package/app/api-destined-function/node_modules/mkdirp/LICENSE +21 -0
  41. package/app/api-destined-function/node_modules/mkdirp/bin/cmd.js +68 -0
  42. package/app/api-destined-function/node_modules/mkdirp/index.js +31 -0
  43. package/app/api-destined-function/node_modules/mkdirp/lib/find-made.js +29 -0
  44. package/app/api-destined-function/node_modules/mkdirp/lib/mkdirp-manual.js +64 -0
  45. package/app/api-destined-function/node_modules/mkdirp/lib/mkdirp-native.js +39 -0
  46. package/app/api-destined-function/node_modules/mkdirp/lib/opts-arg.js +23 -0
  47. package/app/api-destined-function/node_modules/mkdirp/lib/path-arg.js +29 -0
  48. package/app/api-destined-function/node_modules/mkdirp/lib/use-native.js +10 -0
  49. package/app/api-destined-function/node_modules/mkdirp/package.json +44 -0
  50. package/app/api-destined-function/node_modules/mkdirp/readme.markdown +266 -0
  51. package/app/api-destined-function/node_modules/once/LICENSE +15 -0
  52. package/app/api-destined-function/node_modules/once/README.md +79 -0
  53. package/app/api-destined-function/node_modules/once/once.js +42 -0
  54. package/app/api-destined-function/node_modules/once/package.json +33 -0
  55. package/app/api-destined-function/node_modules/path-is-absolute/index.js +20 -0
  56. package/app/api-destined-function/node_modules/path-is-absolute/license +21 -0
  57. package/app/api-destined-function/node_modules/path-is-absolute/package.json +43 -0
  58. package/app/api-destined-function/node_modules/path-is-absolute/readme.md +59 -0
  59. package/app/api-destined-function/node_modules/rimraf/LICENSE +15 -0
  60. package/app/api-destined-function/node_modules/rimraf/README.md +101 -0
  61. package/app/api-destined-function/node_modules/rimraf/bin.js +68 -0
  62. package/app/api-destined-function/node_modules/rimraf/package.json +32 -0
  63. package/app/api-destined-function/node_modules/rimraf/rimraf.js +360 -0
  64. package/app/api-destined-function/node_modules/uuid/dist/bin/uuid +2 -0
  65. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/index.js +9 -0
  66. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/md5.js +215 -0
  67. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/nil.js +1 -0
  68. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/parse.js +35 -0
  69. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/regex.js +1 -0
  70. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/rng.js +19 -0
  71. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/sha1.js +96 -0
  72. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/stringify.js +30 -0
  73. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v1.js +95 -0
  74. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v3.js +4 -0
  75. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v35.js +64 -0
  76. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v4.js +24 -0
  77. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/v5.js +4 -0
  78. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/validate.js +7 -0
  79. package/app/api-destined-function/node_modules/uuid/dist/esm-browser/version.js +11 -0
  80. package/app/api-destined-function/node_modules/uuid/dist/esm-node/index.js +9 -0
  81. package/app/api-destined-function/node_modules/uuid/dist/esm-node/md5.js +13 -0
  82. package/app/api-destined-function/node_modules/uuid/dist/esm-node/nil.js +1 -0
  83. package/app/api-destined-function/node_modules/uuid/dist/esm-node/parse.js +35 -0
  84. package/app/api-destined-function/node_modules/uuid/dist/esm-node/regex.js +1 -0
  85. package/app/api-destined-function/node_modules/uuid/dist/esm-node/rng.js +12 -0
  86. package/app/api-destined-function/node_modules/uuid/dist/esm-node/sha1.js +13 -0
  87. package/app/api-destined-function/node_modules/uuid/dist/esm-node/stringify.js +29 -0
  88. package/app/api-destined-function/node_modules/uuid/dist/esm-node/v1.js +95 -0
  89. package/app/api-destined-function/node_modules/uuid/dist/esm-node/v3.js +4 -0
  90. package/app/api-destined-function/node_modules/uuid/dist/esm-node/v35.js +64 -0
  91. package/app/api-destined-function/node_modules/uuid/dist/esm-node/v4.js +24 -0
  92. package/app/api-destined-function/node_modules/uuid/dist/esm-node/v5.js +4 -0
  93. package/app/api-destined-function/node_modules/uuid/dist/esm-node/validate.js +7 -0
  94. package/app/api-destined-function/node_modules/uuid/dist/esm-node/version.js +11 -0
  95. package/app/api-destined-function/node_modules/uuid/dist/index.js +79 -0
  96. package/app/api-destined-function/node_modules/uuid/dist/md5-browser.js +223 -0
  97. package/app/api-destined-function/node_modules/uuid/dist/md5.js +23 -0
  98. package/app/api-destined-function/node_modules/uuid/dist/nil.js +8 -0
  99. package/app/api-destined-function/node_modules/uuid/dist/parse.js +45 -0
  100. package/app/api-destined-function/node_modules/uuid/dist/regex.js +8 -0
  101. package/app/api-destined-function/node_modules/uuid/dist/rng-browser.js +26 -0
  102. package/app/api-destined-function/node_modules/uuid/dist/rng.js +24 -0
  103. package/app/api-destined-function/node_modules/uuid/dist/sha1-browser.js +104 -0
  104. package/app/api-destined-function/node_modules/uuid/dist/sha1.js +23 -0
  105. package/app/api-destined-function/node_modules/uuid/dist/stringify.js +39 -0
  106. package/app/api-destined-function/node_modules/uuid/dist/umd/uuid.min.js +1 -0
  107. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidNIL.min.js +1 -0
  108. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidParse.min.js +1 -0
  109. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidStringify.min.js +1 -0
  110. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidValidate.min.js +1 -0
  111. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidVersion.min.js +1 -0
  112. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv1.min.js +1 -0
  113. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv3.min.js +1 -0
  114. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv4.min.js +1 -0
  115. package/app/api-destined-function/node_modules/uuid/dist/umd/uuidv5.min.js +1 -0
  116. package/app/api-destined-function/node_modules/uuid/dist/uuid-bin.js +85 -0
  117. package/app/api-destined-function/node_modules/uuid/dist/v1.js +107 -0
  118. package/app/api-destined-function/node_modules/uuid/dist/v3.js +16 -0
  119. package/app/api-destined-function/node_modules/uuid/dist/v35.js +78 -0
  120. package/app/api-destined-function/node_modules/uuid/dist/v4.js +37 -0
  121. package/app/api-destined-function/node_modules/uuid/dist/v5.js +16 -0
  122. package/app/api-destined-function/node_modules/uuid/dist/validate.js +17 -0
  123. package/app/api-destined-function/node_modules/uuid/dist/version.js +21 -0
  124. package/app/api-destined-function/node_modules/wrappy/LICENSE +15 -0
  125. package/app/api-destined-function/node_modules/wrappy/README.md +36 -0
  126. package/app/api-destined-function/node_modules/wrappy/package.json +29 -0
  127. package/app/api-destined-function/node_modules/wrappy/wrappy.js +33 -0
  128. package/app/api-destined-function/package.json +6 -1
  129. package/app/api-destined-function/src/lib/lambda.ts +1 -3
  130. package/dist/app/api-destined-function/layers/nodejs/node_modules/.bin/uuid +2 -0
  131. package/dist/app/api-destined-function/layers/nodejs/node_modules/.yarn-integrity +109 -0
  132. package/dist/app/api-destined-function/layers/nodejs/node_modules/@types/uuid/LICENSE +21 -0
  133. package/dist/app/api-destined-function/layers/nodejs/node_modules/@types/uuid/README.md +16 -0
  134. package/dist/app/api-destined-function/layers/nodejs/node_modules/@types/uuid/index.d.mts +10 -0
  135. package/dist/app/api-destined-function/layers/nodejs/node_modules/@types/uuid/index.d.ts +80 -0
  136. package/dist/app/api-destined-function/layers/nodejs/node_modules/@types/uuid/package.json +54 -0
  137. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/LICENSE.md +9 -0
  138. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/README.md +505 -0
  139. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/bin/uuid +2 -0
  140. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/index.js +9 -0
  141. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/md5.js +215 -0
  142. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/nil.js +1 -0
  143. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/parse.js +35 -0
  144. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/regex.js +1 -0
  145. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/rng.js +19 -0
  146. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/sha1.js +96 -0
  147. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/stringify.js +30 -0
  148. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v1.js +95 -0
  149. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v3.js +4 -0
  150. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v35.js +64 -0
  151. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v4.js +24 -0
  152. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/v5.js +4 -0
  153. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/validate.js +7 -0
  154. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-browser/version.js +11 -0
  155. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/index.js +9 -0
  156. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/md5.js +13 -0
  157. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/nil.js +1 -0
  158. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/parse.js +35 -0
  159. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/regex.js +1 -0
  160. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/rng.js +12 -0
  161. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/sha1.js +13 -0
  162. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/stringify.js +29 -0
  163. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/v1.js +95 -0
  164. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/v3.js +4 -0
  165. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/v35.js +64 -0
  166. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/v4.js +24 -0
  167. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/v5.js +4 -0
  168. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/validate.js +7 -0
  169. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/esm-node/version.js +11 -0
  170. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/index.js +79 -0
  171. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/md5-browser.js +223 -0
  172. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/md5.js +23 -0
  173. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/nil.js +8 -0
  174. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/parse.js +45 -0
  175. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/regex.js +8 -0
  176. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/rng-browser.js +26 -0
  177. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/rng.js +24 -0
  178. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/sha1-browser.js +104 -0
  179. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/sha1.js +23 -0
  180. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/stringify.js +39 -0
  181. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuid.min.js +1 -0
  182. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidNIL.min.js +1 -0
  183. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidParse.min.js +1 -0
  184. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidStringify.min.js +1 -0
  185. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidValidate.min.js +1 -0
  186. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidVersion.min.js +1 -0
  187. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidv1.min.js +1 -0
  188. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidv3.min.js +1 -0
  189. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidv4.min.js +1 -0
  190. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/umd/uuidv5.min.js +1 -0
  191. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/uuid-bin.js +85 -0
  192. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/v1.js +107 -0
  193. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/v3.js +16 -0
  194. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/v35.js +78 -0
  195. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/v4.js +37 -0
  196. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/v5.js +16 -0
  197. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/validate.js +17 -0
  198. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/dist/version.js +21 -0
  199. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/package.json +135 -0
  200. package/dist/app/api-destined-function/layers/nodejs/node_modules/uuid/wrapper.mjs +10 -0
  201. package/dist/app/api-destined-function/layers/nodejs/package.json +30 -0
  202. package/dist/app/api-destined-function/src/lib/lambda.d.ts +17 -0
  203. package/dist/app/api-destined-function/src/lib/lambda.d.ts.map +1 -0
  204. package/dist/app/api-destined-function/src/lib/lambda.js +32 -0
  205. package/dist/app/api-destined-function/src/lib/lambda.js.map +1 -0
  206. package/dist/index.d.ts +6 -0
  207. package/dist/index.d.ts.map +1 -0
  208. package/dist/index.js.map +1 -0
  209. package/dist/src/lib/common/construct.d.ts +81 -0
  210. package/dist/src/lib/common/construct.d.ts.map +1 -0
  211. package/dist/src/lib/common/construct.js +136 -0
  212. package/dist/src/lib/common/construct.js.map +1 -0
  213. package/dist/src/lib/common/index.d.ts +3 -0
  214. package/dist/src/lib/common/index.d.ts.map +1 -0
  215. package/dist/src/lib/common/index.js +15 -0
  216. package/dist/src/lib/common/index.js.map +1 -0
  217. package/dist/src/lib/common/stack.d.ts +55 -0
  218. package/dist/src/lib/common/stack.d.ts.map +1 -0
  219. package/dist/src/lib/common/stack.js +148 -0
  220. package/dist/src/lib/common/stack.js.map +1 -0
  221. package/dist/src/lib/construct/api-to-eventbridge-target/api-destination-event.d.ts +17 -0
  222. package/dist/src/lib/construct/api-to-eventbridge-target/api-destination-event.d.ts.map +1 -0
  223. package/dist/src/lib/construct/api-to-eventbridge-target/api-destination-event.js +18 -0
  224. package/dist/src/lib/construct/api-to-eventbridge-target/api-destination-event.js.map +1 -0
  225. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-lambda.d.ts +20 -0
  226. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-lambda.d.ts.map +1 -0
  227. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-lambda.js +20 -0
  228. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-lambda.js.map +1 -0
  229. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-rest-api.d.ts +36 -0
  230. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-rest-api.d.ts.map +1 -0
  231. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-rest-api.js +30 -0
  232. package/dist/src/lib/construct/api-to-eventbridge-target/api-destined-rest-api.js.map +1 -0
  233. package/dist/src/lib/construct/api-to-eventbridge-target/index.d.ts +5 -0
  234. package/dist/src/lib/construct/api-to-eventbridge-target/index.d.ts.map +1 -0
  235. package/dist/src/lib/construct/api-to-eventbridge-target/index.js +17 -0
  236. package/dist/src/lib/construct/api-to-eventbridge-target/index.js.map +1 -0
  237. package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +135 -0
  238. package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts.map +1 -0
  239. package/dist/src/lib/construct/api-to-eventbridge-target/main.js +488 -0
  240. package/dist/src/lib/construct/api-to-eventbridge-target/main.js.map +1 -0
  241. package/dist/src/lib/construct/graphql-api-lambda/index.d.ts +2 -0
  242. package/dist/src/lib/construct/graphql-api-lambda/index.d.ts.map +1 -0
  243. package/dist/src/lib/construct/graphql-api-lambda/index.js +14 -0
  244. package/dist/src/lib/construct/graphql-api-lambda/index.js.map +1 -0
  245. package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +113 -0
  246. package/dist/src/lib/construct/graphql-api-lambda/main.d.ts.map +1 -0
  247. package/dist/src/lib/construct/graphql-api-lambda/main.js +202 -0
  248. package/dist/src/lib/construct/graphql-api-lambda/main.js.map +1 -0
  249. package/dist/src/lib/construct/index.d.ts +5 -0
  250. package/dist/src/lib/construct/index.d.ts.map +1 -0
  251. package/dist/src/lib/construct/index.js +17 -0
  252. package/dist/src/lib/construct/index.js.map +1 -0
  253. package/dist/src/lib/construct/site-with-ecs-backend/index.d.ts +2 -0
  254. package/dist/src/lib/construct/site-with-ecs-backend/index.d.ts.map +1 -0
  255. package/dist/src/lib/construct/site-with-ecs-backend/index.js +14 -0
  256. package/dist/src/lib/construct/site-with-ecs-backend/index.js.map +1 -0
  257. package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +168 -0
  258. package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts.map +1 -0
  259. package/dist/src/lib/construct/site-with-ecs-backend/main.js +328 -0
  260. package/dist/src/lib/construct/site-with-ecs-backend/main.js.map +1 -0
  261. package/dist/src/lib/construct/static-site/index.d.ts +2 -0
  262. package/dist/src/lib/construct/static-site/index.d.ts.map +1 -0
  263. package/dist/src/lib/construct/static-site/index.js +14 -0
  264. package/dist/src/lib/construct/static-site/index.js.map +1 -0
  265. package/dist/src/lib/construct/static-site/main.d.ts +95 -0
  266. package/dist/src/lib/construct/static-site/main.d.ts.map +1 -0
  267. package/dist/src/lib/construct/static-site/main.js +169 -0
  268. package/dist/src/lib/construct/static-site/main.js.map +1 -0
  269. package/dist/src/lib/manager/aws/acm-manager.d.ts +47 -0
  270. package/dist/src/lib/manager/aws/acm-manager.d.ts.map +1 -0
  271. package/dist/src/lib/manager/aws/acm-manager.js +91 -0
  272. package/dist/src/lib/manager/aws/acm-manager.js.map +1 -0
  273. package/dist/src/lib/manager/aws/api-manager.d.ts +44 -0
  274. package/dist/src/lib/manager/aws/api-manager.d.ts.map +1 -0
  275. package/dist/src/lib/manager/aws/api-manager.js +112 -0
  276. package/dist/src/lib/manager/aws/api-manager.js.map +1 -0
  277. package/dist/src/lib/manager/aws/app-config-manager.d.ts +66 -0
  278. package/dist/src/lib/manager/aws/app-config-manager.d.ts.map +1 -0
  279. package/dist/src/lib/manager/aws/app-config-manager.js +149 -0
  280. package/dist/src/lib/manager/aws/app-config-manager.js.map +1 -0
  281. package/dist/src/lib/manager/aws/cloudfront-manager.d.ts +113 -0
  282. package/dist/src/lib/manager/aws/cloudfront-manager.d.ts.map +1 -0
  283. package/dist/src/lib/manager/aws/cloudfront-manager.js +283 -0
  284. package/dist/src/lib/manager/aws/cloudfront-manager.js.map +1 -0
  285. package/dist/src/lib/manager/aws/cloudtrail-manager.d.ts +49 -0
  286. package/dist/src/lib/manager/aws/cloudtrail-manager.d.ts.map +1 -0
  287. package/dist/src/lib/manager/aws/cloudtrail-manager.js +100 -0
  288. package/dist/src/lib/manager/aws/cloudtrail-manager.js.map +1 -0
  289. package/dist/src/lib/manager/aws/cloudwatch-manager.d.ts +122 -0
  290. package/dist/src/lib/manager/aws/cloudwatch-manager.d.ts.map +1 -0
  291. package/dist/src/lib/manager/aws/cloudwatch-manager.js +353 -0
  292. package/dist/src/lib/manager/aws/cloudwatch-manager.js.map +1 -0
  293. package/dist/src/lib/manager/aws/codebuild-manager.d.ts +41 -0
  294. package/dist/src/lib/manager/aws/codebuild-manager.d.ts.map +1 -0
  295. package/dist/src/lib/manager/aws/codebuild-manager.js +95 -0
  296. package/dist/src/lib/manager/aws/codebuild-manager.js.map +1 -0
  297. package/dist/src/lib/manager/aws/dynamodb-manager.d.ts +33 -0
  298. package/dist/src/lib/manager/aws/dynamodb-manager.d.ts.map +1 -0
  299. package/dist/src/lib/manager/aws/dynamodb-manager.js +80 -0
  300. package/dist/src/lib/manager/aws/dynamodb-manager.js.map +1 -0
  301. package/dist/src/lib/manager/aws/ecr-manager.d.ts +32 -0
  302. package/dist/src/lib/manager/aws/ecr-manager.d.ts.map +1 -0
  303. package/dist/src/lib/manager/aws/ecr-manager.js +61 -0
  304. package/dist/src/lib/manager/aws/ecr-manager.js.map +1 -0
  305. package/dist/src/lib/manager/aws/ecs-manager.d.ts +49 -0
  306. package/dist/src/lib/manager/aws/ecs-manager.d.ts.map +1 -0
  307. package/dist/src/lib/manager/aws/ecs-manager.js +104 -0
  308. package/dist/src/lib/manager/aws/ecs-manager.js.map +1 -0
  309. package/dist/src/lib/manager/aws/eks-manager.d.ts +37 -0
  310. package/dist/src/lib/manager/aws/eks-manager.d.ts.map +1 -0
  311. package/dist/src/lib/manager/aws/eks-manager.js +110 -0
  312. package/dist/src/lib/manager/aws/eks-manager.js.map +1 -0
  313. package/dist/src/lib/manager/aws/elasticache-manager.d.ts +43 -0
  314. package/dist/src/lib/manager/aws/elasticache-manager.d.ts.map +1 -0
  315. package/dist/src/lib/manager/aws/elasticache-manager.js +103 -0
  316. package/dist/src/lib/manager/aws/elasticache-manager.js.map +1 -0
  317. package/dist/src/lib/manager/aws/event-manager.d.ts +68 -0
  318. package/dist/src/lib/manager/aws/event-manager.d.ts.map +1 -0
  319. package/dist/src/lib/manager/aws/event-manager.js +163 -0
  320. package/dist/src/lib/manager/aws/event-manager.js.map +1 -0
  321. package/dist/src/lib/manager/aws/iam-manager.d.ts +155 -0
  322. package/dist/src/lib/manager/aws/iam-manager.d.ts.map +1 -0
  323. package/dist/src/lib/manager/aws/iam-manager.js +381 -0
  324. package/dist/src/lib/manager/aws/iam-manager.js.map +1 -0
  325. package/dist/src/lib/manager/aws/index.d.ts +24 -0
  326. package/dist/src/lib/manager/aws/index.d.ts.map +1 -0
  327. package/dist/src/lib/manager/aws/index.js +36 -0
  328. package/dist/src/lib/manager/aws/index.js.map +1 -0
  329. package/dist/src/lib/manager/aws/lambda-manager.d.ts +95 -0
  330. package/dist/src/lib/manager/aws/lambda-manager.d.ts.map +1 -0
  331. package/dist/src/lib/manager/aws/lambda-manager.js +197 -0
  332. package/dist/src/lib/manager/aws/lambda-manager.js.map +1 -0
  333. package/dist/src/lib/manager/aws/log-manager.d.ts +52 -0
  334. package/dist/src/lib/manager/aws/log-manager.d.ts.map +1 -0
  335. package/dist/src/lib/manager/aws/log-manager.js +109 -0
  336. package/dist/src/lib/manager/aws/log-manager.js.map +1 -0
  337. package/dist/src/lib/manager/aws/route53-manager.d.ts +69 -0
  338. package/dist/src/lib/manager/aws/route53-manager.d.ts.map +1 -0
  339. package/dist/src/lib/manager/aws/route53-manager.js +159 -0
  340. package/dist/src/lib/manager/aws/route53-manager.js.map +1 -0
  341. package/dist/src/lib/manager/aws/s3-manager.d.ts +74 -0
  342. package/dist/src/lib/manager/aws/s3-manager.d.ts.map +1 -0
  343. package/dist/src/lib/manager/aws/s3-manager.js +203 -0
  344. package/dist/src/lib/manager/aws/s3-manager.js.map +1 -0
  345. package/dist/src/lib/manager/aws/secrets-manager.d.ts +58 -0
  346. package/dist/src/lib/manager/aws/secrets-manager.d.ts.map +1 -0
  347. package/dist/src/lib/manager/aws/secrets-manager.js +117 -0
  348. package/dist/src/lib/manager/aws/secrets-manager.js.map +1 -0
  349. package/dist/src/lib/manager/aws/sns-manager.d.ts +43 -0
  350. package/dist/src/lib/manager/aws/sns-manager.d.ts.map +1 -0
  351. package/dist/src/lib/manager/aws/sns-manager.js +91 -0
  352. package/dist/src/lib/manager/aws/sns-manager.js.map +1 -0
  353. package/dist/src/lib/manager/aws/ssm-manager.d.ts +61 -0
  354. package/dist/src/lib/manager/aws/ssm-manager.d.ts.map +1 -0
  355. package/dist/src/lib/manager/aws/ssm-manager.js +125 -0
  356. package/dist/src/lib/manager/aws/ssm-manager.js.map +1 -0
  357. package/dist/src/lib/manager/aws/vpc-manager.d.ts +46 -0
  358. package/dist/src/lib/manager/aws/vpc-manager.d.ts.map +1 -0
  359. package/dist/src/lib/manager/aws/vpc-manager.js +95 -0
  360. package/dist/src/lib/manager/aws/vpc-manager.js.map +1 -0
  361. package/dist/src/lib/manager/aws/waf-manager.d.ts +40 -0
  362. package/dist/src/lib/manager/aws/waf-manager.d.ts.map +1 -0
  363. package/dist/src/lib/manager/aws/waf-manager.js +90 -0
  364. package/dist/src/lib/manager/aws/waf-manager.js.map +1 -0
  365. package/dist/src/lib/manager/index.d.ts +2 -0
  366. package/dist/src/lib/manager/index.d.ts.map +1 -0
  367. package/dist/src/lib/manager/index.js +14 -0
  368. package/dist/src/lib/manager/index.js.map +1 -0
  369. package/dist/src/lib/types/aws/index.d.ts +487 -0
  370. package/dist/src/lib/types/aws/index.d.ts.map +1 -0
  371. package/dist/src/lib/types/aws/index.js +3 -0
  372. package/dist/src/lib/types/aws/index.js.map +1 -0
  373. package/dist/src/lib/types/index.d.ts +2 -0
  374. package/dist/src/lib/types/index.d.ts.map +1 -0
  375. package/dist/src/lib/types/index.js +14 -0
  376. package/dist/src/lib/types/index.js.map +1 -0
  377. package/dist/src/lib/utils/aws/index.d.ts +16 -0
  378. package/dist/src/lib/utils/aws/index.d.ts.map +1 -0
  379. package/dist/src/lib/utils/aws/index.js +50 -0
  380. package/dist/src/lib/utils/aws/index.js.map +1 -0
  381. package/dist/src/lib/utils/index.d.ts +63 -0
  382. package/dist/src/lib/utils/index.d.ts.map +1 -0
  383. package/dist/src/lib/utils/index.js +85 -0
  384. package/dist/src/lib/utils/index.js.map +1 -0
  385. package/package.json +11 -11
  386. package/src/lib/common/construct.ts +2 -0
  387. package/src/lib/manager/aws/elasticache-manager.ts +98 -0
  388. package/src/lib/manager/aws/index.ts +1 -0
  389. package/src/lib/types/aws/index.ts +7 -0
@@ -0,0 +1,74 @@
1
+ import * as cdk from 'aws-cdk-lib';
2
+ import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
3
+ import * as s3 from 'aws-cdk-lib/aws-s3';
4
+ import * as s3deploy from 'aws-cdk-lib/aws-s3-deployment';
5
+ import * as common from '../../common';
6
+ import * as types from '../../types';
7
+ /**
8
+ * @stability stable
9
+ * @category cdk-utils.s3-manager
10
+ * @subcategory Construct
11
+ * @classdesc Provides operations on AWS S3.
12
+ * - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
13
+ * - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
14
+ * @example
15
+ * import * as common from '@gradientedge/cdk-utils'
16
+ *
17
+ * class CustomConstruct extends common.common.CommonConstruct {
18
+ * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
19
+ * super(parent, id, props)
20
+ * this.props = props
21
+ * this.s3Manager.createS3Bucket('MyBucket', this)
22
+ * }
23
+ * }
24
+ *
25
+ * @see [CDK S3 Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3-readme.html}
26
+ */
27
+ export declare class S3Manager {
28
+ /**
29
+ * @summary Method to determine S3 Bucket lifecycle properties
30
+ * @param {types.S3BucketProps} props bucket properties
31
+ * @private
32
+ */
33
+ protected determineBucketLifecycleRules(props: types.S3BucketProps): types.LifecycleRule[] | undefined;
34
+ /**
35
+ * @summary Method to determine the bucket name
36
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
37
+ * @param {types.S3BucketProps} props bucket properties
38
+ * @private
39
+ */
40
+ protected static determineBucketName(scope: common.CommonConstruct, props: types.S3BucketProps): string;
41
+ /**
42
+ * @summary Method to determine the log bucket name
43
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
44
+ * @param {types.S3BucketProps} props bucket properties
45
+ * @private
46
+ */
47
+ protected static determineLogBucketName(scope: common.CommonConstruct, props: types.S3BucketProps): string;
48
+ /**
49
+ * @summary Method to create a s3 bucket
50
+ * @param {string} id scoped id of the resource
51
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
52
+ * @param {types.S3BucketProps} props bucket properties
53
+ */
54
+ createS3Bucket(id: string, scope: common.CommonConstruct, props: types.S3BucketProps): cdk.aws_s3.IBucket;
55
+ /**
56
+ * @summary Method to create an iam bucket policy for cloudtrail
57
+ * @param {string} id scoped id of the resource
58
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
59
+ * @param {s3.IBucket} bucket
60
+ */
61
+ createBucketPolicyForCloudTrail(id: string, scope: common.CommonConstruct, bucket: s3.IBucket): cdk.aws_s3.CfnBucketPolicy;
62
+ /**
63
+ * @summary Method to create a s3 bucket deployment
64
+ * @param {string} id scoped id of the resource
65
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
66
+ * @param {s3.IBucket} siteBucket
67
+ * @param {cloudfront.IDistribution} distribution
68
+ * @param {s3deploy.ISource[]} sources
69
+ * @param {string} prefix
70
+ * @param {boolean} prune
71
+ */
72
+ doBucketDeployment(id: string, scope: common.CommonConstruct, siteBucket: s3.IBucket, distribution: cloudfront.IDistribution, sources: s3deploy.ISource[], prefix: string, prune?: boolean): void;
73
+ }
74
+ //# sourceMappingURL=s3-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"s3-manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/s3-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAA;AAExD,OAAO,KAAK,EAAE,MAAM,oBAAoB,CAAA;AACxC,OAAO,KAAK,QAAQ,MAAM,+BAA+B,CAAA;AACzD,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AAGpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,SAAS;IACpB;;;;OAIG;IACH,SAAS,CAAC,6BAA6B,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa;IAyBlE;;;;;OAKG;IACH,SAAS,CAAC,MAAM,CAAC,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa;IAM9F;;;;;OAKG;IACH,SAAS,CAAC,MAAM,CAAC,sBAAsB,CAAC,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa;IAMjG;;;;;OAKG;IACI,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa;IAkD3F;;;;;OAKG;IACI,+BAA+B,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,CAAC,OAAO;IA0BpG;;;;;;;;;OASG;IACI,kBAAkB,CACvB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,UAAU,EAAE,EAAE,CAAC,OAAO,EACtB,YAAY,EAAE,UAAU,CAAC,aAAa,EACtC,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,EAC3B,MAAM,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,OAAO;CAalB"}
@@ -0,0 +1,203 @@
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.S3Manager = void 0;
23
+ const cdk = __importStar(require("aws-cdk-lib"));
24
+ const iam = __importStar(require("aws-cdk-lib/aws-iam"));
25
+ const s3 = __importStar(require("aws-cdk-lib/aws-s3"));
26
+ const s3deploy = __importStar(require("aws-cdk-lib/aws-s3-deployment"));
27
+ const utils = __importStar(require("../../utils"));
28
+ /**
29
+ * @stability stable
30
+ * @category cdk-utils.s3-manager
31
+ * @subcategory Construct
32
+ * @classdesc Provides operations on AWS S3.
33
+ * - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
34
+ * - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
35
+ * @example
36
+ * import * as common from '@gradientedge/cdk-utils'
37
+ *
38
+ * class CustomConstruct extends common.common.CommonConstruct {
39
+ * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
40
+ * super(parent, id, props)
41
+ * this.props = props
42
+ * this.s3Manager.createS3Bucket('MyBucket', this)
43
+ * }
44
+ * }
45
+ *
46
+ * @see [CDK S3 Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3-readme.html}
47
+ */
48
+ class S3Manager {
49
+ /**
50
+ * @summary Method to determine S3 Bucket lifecycle properties
51
+ * @param {types.S3BucketProps} props bucket properties
52
+ * @private
53
+ */
54
+ determineBucketLifecycleRules(props) {
55
+ if (!props.lifecycleRules)
56
+ return undefined;
57
+ const bucketLifecycleRules = [];
58
+ props.lifecycleRules.forEach(lifecycleRule => {
59
+ bucketLifecycleRules.push({
60
+ id: lifecycleRule.id,
61
+ enabled: lifecycleRule.enabled,
62
+ abortIncompleteMultipartUploadAfter: lifecycleRule.abortIncompleteMultipartUploadAfter,
63
+ expirationDate: lifecycleRule.expirationDate,
64
+ expiration: lifecycleRule.expirationInDays ? cdk.Duration.days(lifecycleRule.expirationInDays) : undefined,
65
+ noncurrentVersionExpiration: lifecycleRule.noncurrentVersionExpirationInDays
66
+ ? cdk.Duration.days(lifecycleRule.noncurrentVersionExpirationInDays)
67
+ : undefined,
68
+ noncurrentVersionTransitions: lifecycleRule.noncurrentVersionTransitions,
69
+ transitions: lifecycleRule.transitions,
70
+ prefix: lifecycleRule.prefix,
71
+ tagFilters: lifecycleRule.tagFilters,
72
+ expiredObjectDeleteMarker: lifecycleRule.expiredObjectDeleteMarker,
73
+ });
74
+ });
75
+ return bucketLifecycleRules;
76
+ }
77
+ /**
78
+ * @summary Method to determine the bucket name
79
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
80
+ * @param {types.S3BucketProps} props bucket properties
81
+ * @private
82
+ */
83
+ static determineBucketName(scope, props) {
84
+ return scope.isProductionStage()
85
+ ? `${props.bucketName}.${scope.fullyQualifiedDomainName}`
86
+ : `${props.bucketName}-${scope.props.stage}.${scope.fullyQualifiedDomainName}`;
87
+ }
88
+ /**
89
+ * @summary Method to determine the log bucket name
90
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
91
+ * @param {types.S3BucketProps} props bucket properties
92
+ * @private
93
+ */
94
+ static determineLogBucketName(scope, props) {
95
+ return scope.isProductionStage()
96
+ ? `${props.logBucketName}.${scope.fullyQualifiedDomainName}`
97
+ : `${props.logBucketName}-${scope.props.stage}.${scope.fullyQualifiedDomainName}`;
98
+ }
99
+ /**
100
+ * @summary Method to create a s3 bucket
101
+ * @param {string} id scoped id of the resource
102
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
103
+ * @param {types.S3BucketProps} props bucket properties
104
+ */
105
+ createS3Bucket(id, scope, props) {
106
+ if (!props)
107
+ throw `S3 props undefined`;
108
+ let bucket;
109
+ const bucketName = S3Manager.determineBucketName(scope, props);
110
+ if (props.existingBucket && props.bucketName) {
111
+ bucket = s3.Bucket.fromBucketName(scope, `${id}`, bucketName);
112
+ }
113
+ else {
114
+ let logBucket;
115
+ if (props.logBucketName) {
116
+ const logBucketName = S3Manager.determineLogBucketName(scope, props);
117
+ logBucket = s3.Bucket.fromBucketName(scope, `${id}-logs`, logBucketName);
118
+ }
119
+ bucket = new s3.Bucket(scope, `${id}-bucket`, {
120
+ accessControl: props.accessControl,
121
+ autoDeleteObjects: props.autoDeleteObjects,
122
+ blockPublicAccess: props.blockPublicAccess || s3.BlockPublicAccess.BLOCK_ALL,
123
+ bucketName: bucketName,
124
+ cors: props.cors,
125
+ encryption: props.encryption || s3.BucketEncryption.S3_MANAGED,
126
+ encryptionKey: props.encryptionKey,
127
+ lifecycleRules: this.determineBucketLifecycleRules(props),
128
+ metrics: props.metrics,
129
+ publicReadAccess: props.publicReadAccess,
130
+ removalPolicy: props.removalPolicy || cdk.RemovalPolicy.RETAIN,
131
+ serverAccessLogsBucket: logBucket,
132
+ serverAccessLogsPrefix: props.serverAccessLogsPrefix,
133
+ websiteIndexDocument: props.websiteIndexDocument,
134
+ websiteErrorDocument: props.websiteErrorDocument,
135
+ websiteRoutingRules: props.websiteRoutingRules,
136
+ versioned: props.versioned,
137
+ });
138
+ const cfnBucket = bucket.node.defaultChild;
139
+ cfnBucket.notificationConfiguration = {
140
+ eventBridgeConfiguration: {
141
+ eventBridgeEnabled: props.enableEventBridge ?? false,
142
+ },
143
+ };
144
+ }
145
+ utils.createCfnOutput(`${id}-bucketName`, scope, bucket.bucketName);
146
+ utils.createCfnOutput(`${id}-bucketArn`, scope, bucket.bucketArn);
147
+ return bucket;
148
+ }
149
+ /**
150
+ * @summary Method to create an iam bucket policy for cloudtrail
151
+ * @param {string} id scoped id of the resource
152
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
153
+ * @param {s3.IBucket} bucket
154
+ */
155
+ createBucketPolicyForCloudTrail(id, scope, bucket) {
156
+ const bucketPolicyDocument = new iam.PolicyDocument({
157
+ statements: [
158
+ new iam.PolicyStatement({
159
+ actions: ['s3:GetBucketAcl'],
160
+ effect: iam.Effect.ALLOW,
161
+ principals: [new iam.ServicePrincipal('cloudtrail.amazonaws.com')],
162
+ resources: [bucket.bucketArn],
163
+ sid: 'AWSCloudTrailAclCheck20150319',
164
+ }),
165
+ new iam.PolicyStatement({
166
+ actions: ['s3:PutObject'],
167
+ effect: iam.Effect.ALLOW,
168
+ principals: [new iam.ServicePrincipal('cloudtrail.amazonaws.com')],
169
+ resources: [bucket.arnForObjects('*')],
170
+ sid: 'AWSCloudTrailWrite20150319',
171
+ }),
172
+ ],
173
+ });
174
+ return new s3.CfnBucketPolicy(scope, `${id}`, {
175
+ bucket: bucket.bucketName,
176
+ policyDocument: bucketPolicyDocument,
177
+ });
178
+ }
179
+ /**
180
+ * @summary Method to create a s3 bucket deployment
181
+ * @param {string} id scoped id of the resource
182
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
183
+ * @param {s3.IBucket} siteBucket
184
+ * @param {cloudfront.IDistribution} distribution
185
+ * @param {s3deploy.ISource[]} sources
186
+ * @param {string} prefix
187
+ * @param {boolean} prune
188
+ */
189
+ doBucketDeployment(id, scope, siteBucket, distribution, sources, prefix, prune) {
190
+ new s3deploy.BucketDeployment(scope, `${id}`, {
191
+ destinationBucket: siteBucket,
192
+ destinationKeyPrefix: prefix,
193
+ distribution: distribution,
194
+ distributionPaths: ['/*'],
195
+ memoryLimit: 1024,
196
+ prune: !!prune,
197
+ serverSideEncryption: s3deploy.ServerSideEncryption.AES_256,
198
+ sources: sources,
199
+ });
200
+ }
201
+ }
202
+ exports.S3Manager = S3Manager;
203
+ //# sourceMappingURL=s3-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"s3-manager.js","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/s3-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAkC;AAElC,yDAA0C;AAC1C,uDAAwC;AACxC,wEAAyD;AAGzD,mDAAoC;AAEpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,SAAS;IACpB;;;;OAIG;IACO,6BAA6B,CAAC,KAA0B;QAChE,IAAI,CAAC,KAAK,CAAC,cAAc;YAAE,OAAO,SAAS,CAAA;QAE3C,MAAM,oBAAoB,GAA0B,EAAE,CAAA;QACtD,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;YAC3C,oBAAoB,CAAC,IAAI,CAAC;gBACxB,EAAE,EAAE,aAAa,CAAC,EAAE;gBACpB,OAAO,EAAE,aAAa,CAAC,OAAO;gBAC9B,mCAAmC,EAAE,aAAa,CAAC,mCAAmC;gBACtF,cAAc,EAAE,aAAa,CAAC,cAAc;gBAC5C,UAAU,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC,C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AAE,CAAC,IAAI,GAAG,CAAC,gBAAgB,CAAC,0BAA0B,CAAC,CAAC;oBAClE,SAAS,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;oBACtC,GAAG,EAAE,4BAA4B;iBAClC,CAAC;aACH;SACF,CAAC,CAAA;QAEF,OAAO,IAAI,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;YAC5C,MAAM,EAAE,MAAM,CAAC,UAAU;YACzB,cAAc,EAAE,oBAAoB;SACrC,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;;;OASG;IACI,kBAAkB,CACvB,EAAU,EACV,KAA6B,EAC7B,UAAsB,EACtB,YAAsC,EACtC,OAA2B,EAC3B,MAAc,EACd,KAAe;QAEf,IAAI,QAAQ,CAAC,gBAAgB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;YAC5C,iBAAiB,EAAE,UAAU;YAC7B,oBAAoB,EAAE,MAAM;YAC5B,YAAY,EAAE,YAAY;YAC1B,iBAAiB,EAAE,CAAC,IAAI,CAAC;YACzB,WAAW,EAAE,IAAI;YACjB,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,oBAAoB,EAAE,QAAQ,CAAC,oBAAoB,CAAC,OAAO;YAC3D,OAAO,EAAE,OAAO;SACjB,CAAC,CAAA;IACJ,CAAC;CACF;AA7KD,8BA6KC"}
@@ -0,0 +1,58 @@
1
+ import * as cdk from 'aws-cdk-lib';
2
+ import * as common from '../../common';
3
+ /**
4
+ * @stability experimental
5
+ * @category cdk-utils.secrets-manager
6
+ * @subcategory Construct
7
+ * @classdesc Provides operations on AWS Secrets Manager.
8
+ * - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
9
+ * - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
10
+ * @example
11
+ * import * as common from '@gradientedge/cdk-utils'
12
+ *
13
+ * class CustomConstruct extends common.common.CommonConstruct {
14
+ * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
15
+ * super(parent, id, props)
16
+ * this.props = props
17
+ * this.secretsManager.loadSecret('MySecretName', 'eu-west-1')
18
+ * }
19
+ * }
20
+ *
21
+ * @see [CDK Secrets Manager Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager-readme.html}
22
+ */
23
+ export declare class SecretsManager {
24
+ /**
25
+ *
26
+ * @param {string} region
27
+ */
28
+ getAwsSecretsManager(region: string): any;
29
+ /**
30
+ * @stability experimental
31
+ * @summary Method to load a secret from secrets manager
32
+ * @param {string} secretName
33
+ * @param {string} region
34
+ */
35
+ loadSecret(secretName: string, region: string): Promise<any>;
36
+ /**
37
+ * @stability experimental
38
+ * @summary Method to load secrets from secrets manager
39
+ * @param {string} secretNames
40
+ * @param {string} region
41
+ */
42
+ loadSecrets(secretNames: string, region: string): Promise<{}>;
43
+ /**
44
+ * @stability experimental
45
+ * @summary Method to export secrets from secrets manager to a dot env format
46
+ */
47
+ exportToDotEnv(): void;
48
+ /**
49
+ * @stability stable
50
+ * @summary Method to retrieve a secret from secrets manager with a cloudformation export
51
+ * @param id
52
+ * @param scope
53
+ * @param stackName
54
+ * @param exportName
55
+ */
56
+ retrieveSecretFromSecretsManager(id: string, scope: common.CommonConstruct, stackName: string, exportName: string): cdk.aws_secretsmanager.ISecret;
57
+ }
58
+ //# sourceMappingURL=secrets-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secrets-manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/secrets-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAA;AAElC,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AAKtC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,cAAc;IACzB;;;OAGG;IACI,oBAAoB,CAAC,MAAM,EAAE,MAAM;IAI1C;;;;;OAKG;IACU,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAO1D;;;;;OAKG;IACU,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAS5D;;;OAGG;IACI,cAAc;IA2BrB;;;;;;;OAOG;IACI,gCAAgC,CACrC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM;CAQrB"}
@@ -0,0 +1,117 @@
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.SecretsManager = void 0;
23
+ const cdk = __importStar(require("aws-cdk-lib"));
24
+ const secretsManager = __importStar(require("aws-cdk-lib/aws-secretsmanager"));
25
+ const AWS = require('aws-sdk');
26
+ const fs = require('fs');
27
+ /**
28
+ * @stability experimental
29
+ * @category cdk-utils.secrets-manager
30
+ * @subcategory Construct
31
+ * @classdesc Provides operations on AWS Secrets Manager.
32
+ * - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
33
+ * - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
34
+ * @example
35
+ * import * as common from '@gradientedge/cdk-utils'
36
+ *
37
+ * class CustomConstruct extends common.common.CommonConstruct {
38
+ * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
39
+ * super(parent, id, props)
40
+ * this.props = props
41
+ * this.secretsManager.loadSecret('MySecretName', 'eu-west-1')
42
+ * }
43
+ * }
44
+ *
45
+ * @see [CDK Secrets Manager Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager-readme.html}
46
+ */
47
+ class SecretsManager {
48
+ /**
49
+ *
50
+ * @param {string} region
51
+ */
52
+ getAwsSecretsManager(region) {
53
+ return new AWS.SecretsManager({ region: region });
54
+ }
55
+ /**
56
+ * @stability experimental
57
+ * @summary Method to load a secret from secrets manager
58
+ * @param {string} secretName
59
+ * @param {string} region
60
+ */
61
+ async loadSecret(secretName, region) {
62
+ const secretsManager = this.getAwsSecretsManager(region);
63
+ const secret = await Promise.all([secretsManager.getSecretValue({ SecretId: secretName }).promise()]);
64
+ return secret ? JSON.parse(secret[0].SecretString) : {};
65
+ }
66
+ /**
67
+ * @stability experimental
68
+ * @summary Method to load secrets from secrets manager
69
+ * @param {string} secretNames
70
+ * @param {string} region
71
+ */
72
+ async loadSecrets(secretNames, region) {
73
+ let secrets = {};
74
+ for (const secretName of secretNames.split(',')) {
75
+ secrets = { ...secrets, ...(await this.loadSecret(secretName, region)) };
76
+ }
77
+ return secrets;
78
+ }
79
+ /**
80
+ * @stability experimental
81
+ * @summary Method to export secrets from secrets manager to a dot env format
82
+ */
83
+ exportToDotEnv() {
84
+ let nconf = require('nconf');
85
+ nconf.argv().env();
86
+ const appRoot = require('app-root-path');
87
+ if (nconf.get('profile')) {
88
+ console.log(`Using named aws profile ${nconf.get('profile')}`);
89
+ AWS.config.credentials = new AWS.SharedIniFileCredentials({ profile: nconf.get('profile') });
90
+ }
91
+ const region = nconf.get('region');
92
+ AWS.config.update({ region: nconf.get('region') });
93
+ const outFileName = nconf.get('out') ? nconf.get('out') : '.env';
94
+ this.loadSecret(nconf.get('name'), region).then((secretString) => {
95
+ if (nconf.get('overwrite')) {
96
+ fs.writeFileSync(`${appRoot.path}/.env`, '');
97
+ }
98
+ Object.keys(secretString).forEach(function (key) {
99
+ console.log(`Adding environment variable for key: ${key}`);
100
+ fs.appendFileSync(`${appRoot.path}/${outFileName}`, `${key}=${secretString[key]}\r\n`);
101
+ });
102
+ });
103
+ }
104
+ /**
105
+ * @stability stable
106
+ * @summary Method to retrieve a secret from secrets manager with a cloudformation export
107
+ * @param id
108
+ * @param scope
109
+ * @param stackName
110
+ * @param exportName
111
+ */
112
+ retrieveSecretFromSecretsManager(id, scope, stackName, exportName) {
113
+ return secretsManager.Secret.fromSecretNameV2(scope, `${id}`, cdk.Fn.importValue(`${stackName}-${scope.props.stage}-${exportName}`));
114
+ }
115
+ }
116
+ exports.SecretsManager = SecretsManager;
117
+ //# sourceMappingURL=secrets-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secrets-manager.js","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/secrets-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAkC;AAClC,+EAAgE;AAGhE,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAC9B,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAExB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,cAAc;IACzB;;;OAGG;IACI,oBAAoB,CAAC,MAAc;QACxC,OAAO,IAAI,GAAG,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IACnD,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,UAAU,CAAC,UAAkB,EAAE,MAAc;QACxD,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAA;QACxD,MAAM,MAAM,GAAQ,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,cAAc,CA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AA;QAElD,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;QAEhE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,YAAiB,EAAE,EAAE;YACpE,IAAI,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;gBAC1B,EAAE,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,IAAI,OAAO,EAAE,EAAE,CAAC,CAAA;aAC7C;YAED,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,UAAU,GAAG;gBAC7C,OAAO,CAAC,GAAG,CAAC,wCAAwC,GAAG,EAAE,CAAC,CAAA;gBAC1D,EAAE,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,IAAI,WAAW,EAAE,EAAE,GAAG,GAAG,IAAI,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YACxF,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;OAOG;IACI,gCAAgC,CACrC,EAAU,EACV,KAA6B,EAC7B,SAAiB,EACjB,UAAkB;QAElB,OAAO,cAAc,CAAC,MAAM,CAAC,gBAAgB,CAC3C,KAAK,EACL,GAAG,EAAE,EAAE,EACP,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,GAAG,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI,UAAU,EAAE,CAAC,CACtE,CAAA;IACH,CAAC;CACF;AAxFD,wCAwFC"}
@@ -0,0 +1,43 @@
1
+ import * as lambda from 'aws-cdk-lib/aws-lambda';
2
+ import * as sns from 'aws-cdk-lib/aws-sns';
3
+ import * as common from '../../common';
4
+ import * as types from '../../types';
5
+ /**
6
+ * @stability stable
7
+ * @category cdk-utils.sns-manager
8
+ * @subcategory Construct
9
+ * @classdesc Provides operations on AWS Simple Notification Service.
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.snsManager.createEmailNotificationService('MySns', 'eu-west-1', ['test@example.com'])
20
+ * }
21
+ * }
22
+ *
23
+ * @see [CDK Simple Notification Service Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sns-readme.html}
24
+ */
25
+ export declare class SnsManager {
26
+ /**
27
+ * @summary Method to create an email notification service
28
+ * @param {string} id scoped id of the resource
29
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
30
+ * @param {types.SubscriptionProps} props
31
+ * @param {string[]} emails
32
+ */
33
+ createEmailNotificationService(id: string, scope: common.CommonConstruct, props: types.SubscriptionProps, emails: string[]): sns.Topic;
34
+ /**
35
+ * @summary Method to create a lambda notification service
36
+ * @param {string} id scoped id of the resource
37
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
38
+ * @param {types.SubscriptionProps} props
39
+ * @param {lambda.Function} lambdaFunction
40
+ */
41
+ createLambdaNotificationService(id: string, scope: common.CommonConstruct, props: types.SubscriptionProps, lambdaFunction: lambda.Function): sns.Topic;
42
+ }
43
+ //# sourceMappingURL=sns-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sns-manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/sns-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAA;AAChD,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAE1C,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AAGpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,UAAU;IACrB;;;;;;OAMG;IACI,8BAA8B,CACnC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,KAAK,EAAE,KAAK,CAAC,iBAAiB,EAC9B,MAAM,EAAE,MAAM,EAAE;IAoBlB;;;;;;OAMG;IACI,+BAA+B,CACpC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,KAAK,EAAE,KAAK,CAAC,iBAAiB,EAC9B,cAAc,EAAE,MAAM,CAAC,QAAQ;CAiBlC"}
@@ -0,0 +1,91 @@
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.SnsManager = void 0;
23
+ const sns = __importStar(require("aws-cdk-lib/aws-sns"));
24
+ const subs = __importStar(require("aws-cdk-lib/aws-sns-subscriptions"));
25
+ const utils = __importStar(require("../../utils"));
26
+ /**
27
+ * @stability stable
28
+ * @category cdk-utils.sns-manager
29
+ * @subcategory Construct
30
+ * @classdesc Provides operations on AWS Simple Notification Service.
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.snsManager.createEmailNotificationService('MySns', 'eu-west-1', ['test@example.com'])
41
+ * }
42
+ * }
43
+ *
44
+ * @see [CDK Simple Notification Service Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sns-readme.html}
45
+ */
46
+ class SnsManager {
47
+ /**
48
+ * @summary Method to create an email notification service
49
+ * @param {string} id scoped id of the resource
50
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
51
+ * @param {types.SubscriptionProps} props
52
+ * @param {string[]} emails
53
+ */
54
+ createEmailNotificationService(id, scope, props, emails) {
55
+ if (!props)
56
+ throw `Subscription props undefined`;
57
+ const topic = new sns.Topic(scope, id, {
58
+ displayName: `${props.topicName}-${scope.props.stage}`,
59
+ topicName: `${props.topicName}-${scope.props.stage}`,
60
+ fifo: props.fifo,
61
+ });
62
+ if (emails && emails.length > 0) {
63
+ emails.forEach((email) => topic.addSubscription(new subs.EmailSubscription(email)));
64
+ }
65
+ utils.createCfnOutput(`${id}-subscriptionArn`, scope, topic.topicArn);
66
+ utils.createCfnOutput(`${id}-subscriptionName`, scope, topic.topicName);
67
+ return topic;
68
+ }
69
+ /**
70
+ * @summary Method to create a lambda notification service
71
+ * @param {string} id scoped id of the resource
72
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
73
+ * @param {types.SubscriptionProps} props
74
+ * @param {lambda.Function} lambdaFunction
75
+ */
76
+ createLambdaNotificationService(id, scope, props, lambdaFunction) {
77
+ if (!props)
78
+ throw `Subscription props undefined`;
79
+ const topic = new sns.Topic(scope, id, {
80
+ displayName: `${props.topicName}-${scope.props.stage}`,
81
+ topicName: `${props.topicName}-${scope.props.stage}`,
82
+ fifo: props.fifo,
83
+ });
84
+ topic.addSubscription(new subs.LambdaSubscription(lambdaFunction));
85
+ utils.createCfnOutput(`${id}-subscriptionArn`, scope, topic.topicArn);
86
+ utils.createCfnOutput(`${id}-subscriptionName`, scope, topic.topicName);
87
+ return topic;
88
+ }
89
+ }
90
+ exports.SnsManager = SnsManager;
91
+ //# sourceMappingURL=sns-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sns-manager.js","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/sns-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,yDAA0C;AAC1C,wEAAyD;AAGzD,mDAAoC;AAEpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,UAAU;IACrB;;;;;;OAMG;IACI,8BAA8B,CACnC,EAAU,EACV,KAA6B,EAC7B,KAA8B,EAC9B,MAAgB;QAEhB,IAAI,CAAC,KAAK;YAAE,MAAM,8BAA8B,CAAA;QAEhD,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE;YACrC,WAAW,EAAE,GAAG,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;YACtD,SAAS,EAAE,GAAG,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;YACpD,IAAI,EAAE,KAAK,CAAC,IAAI;SACjB,CAAC,CAAA;QAEF,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YAC/B,MAAM,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;SAC5F;QAED,KAAK,CAAC,eA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