@gradientedge/cdk-utils 4.4.5 → 4.4.9

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 (317) 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 +1 -0
  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 +80 -0
  146. package/dist/src/lib/common/construct.d.ts.map +1 -0
  147. package/dist/src/lib/common/construct.js +134 -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/event-manager.d.ts +68 -0
  250. package/dist/src/lib/manager/aws/event-manager.d.ts.map +1 -0
  251. package/dist/src/lib/manager/aws/event-manager.js +163 -0
  252. package/dist/src/lib/manager/aws/event-manager.js.map +1 -0
  253. package/dist/src/lib/manager/aws/iam-manager.d.ts +155 -0
  254. package/dist/src/lib/manager/aws/iam-manager.d.ts.map +1 -0
  255. package/dist/src/lib/manager/aws/iam-manager.js +381 -0
  256. package/dist/src/lib/manager/aws/iam-manager.js.map +1 -0
  257. package/dist/src/lib/manager/aws/index.d.ts +23 -0
  258. package/dist/src/lib/manager/aws/index.d.ts.map +1 -0
  259. package/dist/src/lib/manager/aws/index.js +35 -0
  260. package/dist/src/lib/manager/aws/index.js.map +1 -0
  261. package/dist/src/lib/manager/aws/lambda-manager.d.ts +95 -0
  262. package/dist/src/lib/manager/aws/lambda-manager.d.ts.map +1 -0
  263. package/dist/src/lib/manager/aws/lambda-manager.js +197 -0
  264. package/dist/src/lib/manager/aws/lambda-manager.js.map +1 -0
  265. package/dist/src/lib/manager/aws/log-manager.d.ts +52 -0
  266. package/dist/src/lib/manager/aws/log-manager.d.ts.map +1 -0
  267. package/dist/src/lib/manager/aws/log-manager.js +109 -0
  268. package/dist/src/lib/manager/aws/log-manager.js.map +1 -0
  269. package/dist/src/lib/manager/aws/route53-manager.d.ts +69 -0
  270. package/dist/src/lib/manager/aws/route53-manager.d.ts.map +1 -0
  271. package/dist/src/lib/manager/aws/route53-manager.js +159 -0
  272. package/dist/src/lib/manager/aws/route53-manager.js.map +1 -0
  273. package/dist/src/lib/manager/aws/s3-manager.d.ts +74 -0
  274. package/dist/src/lib/manager/aws/s3-manager.d.ts.map +1 -0
  275. package/dist/src/lib/manager/aws/s3-manager.js +203 -0
  276. package/dist/src/lib/manager/aws/s3-manager.js.map +1 -0
  277. package/dist/src/lib/manager/aws/secrets-manager.d.ts +58 -0
  278. package/dist/src/lib/manager/aws/secrets-manager.d.ts.map +1 -0
  279. package/dist/src/lib/manager/aws/secrets-manager.js +117 -0
  280. package/dist/src/lib/manager/aws/secrets-manager.js.map +1 -0
  281. package/dist/src/lib/manager/aws/sns-manager.d.ts +43 -0
  282. package/dist/src/lib/manager/aws/sns-manager.d.ts.map +1 -0
  283. package/dist/src/lib/manager/aws/sns-manager.js +91 -0
  284. package/dist/src/lib/manager/aws/sns-manager.js.map +1 -0
  285. package/dist/src/lib/manager/aws/ssm-manager.d.ts +61 -0
  286. package/dist/src/lib/manager/aws/ssm-manager.d.ts.map +1 -0
  287. package/dist/src/lib/manager/aws/ssm-manager.js +125 -0
  288. package/dist/src/lib/manager/aws/ssm-manager.js.map +1 -0
  289. package/dist/src/lib/manager/aws/vpc-manager.d.ts +46 -0
  290. package/dist/src/lib/manager/aws/vpc-manager.d.ts.map +1 -0
  291. package/dist/src/lib/manager/aws/vpc-manager.js +95 -0
  292. package/dist/src/lib/manager/aws/vpc-manager.js.map +1 -0
  293. package/dist/src/lib/manager/aws/waf-manager.d.ts +40 -0
  294. package/dist/src/lib/manager/aws/waf-manager.d.ts.map +1 -0
  295. package/dist/src/lib/manager/aws/waf-manager.js +90 -0
  296. package/dist/src/lib/manager/aws/waf-manager.js.map +1 -0
  297. package/dist/src/lib/manager/index.d.ts +2 -0
  298. package/dist/src/lib/manager/index.d.ts.map +1 -0
  299. package/dist/src/lib/manager/index.js +14 -0
  300. package/dist/src/lib/manager/index.js.map +1 -0
  301. package/dist/src/lib/types/aws/index.d.ts +480 -0
  302. package/dist/src/lib/types/aws/index.d.ts.map +1 -0
  303. package/dist/src/lib/types/aws/index.js +3 -0
  304. package/dist/src/lib/types/aws/index.js.map +1 -0
  305. package/dist/src/lib/types/index.d.ts +2 -0
  306. package/dist/src/lib/types/index.d.ts.map +1 -0
  307. package/dist/src/lib/types/index.js +14 -0
  308. package/dist/src/lib/types/index.js.map +1 -0
  309. package/dist/src/lib/utils/aws/index.d.ts +16 -0
  310. package/dist/src/lib/utils/aws/index.d.ts.map +1 -0
  311. package/dist/src/lib/utils/aws/index.js +50 -0
  312. package/dist/src/lib/utils/aws/index.js.map +1 -0
  313. package/dist/src/lib/utils/index.d.ts +63 -0
  314. package/dist/src/lib/utils/index.d.ts.map +1 -0
  315. package/dist/src/lib/utils/index.js +85 -0
  316. package/dist/src/lib/utils/index.js.map +1 -0
  317. package/package.json +8 -7
@@ -0,0 +1,32 @@
1
+ import * as ecr from 'aws-cdk-lib/aws-ecr-assets';
2
+ import * as common from '../../common';
3
+ /**
4
+ * @stability stable
5
+ * @category cdk-utils.ecr-manager
6
+ * @subcategory Construct
7
+ * @classdesc Provides operations on AWS Elastic Container Registry.
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.ecrManager.createDockerImage('MyImage', this, dockerfilePath)
18
+ * }
19
+ * }
20
+ *
21
+ * @see [CDK ECR Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecr-readme.html}
22
+ */
23
+ export declare class EcrManager {
24
+ /**
25
+ * @summary Method to create a docker image in ecr
26
+ * @param {string} id scoped id of the resource
27
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
28
+ * @param {string} dockerfilePath
29
+ */
30
+ createDockerImage(id: string, scope: common.CommonConstruct, dockerfilePath: string): ecr.DockerImageAsset;
31
+ }
32
+ //# sourceMappingURL=ecr-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ecr-manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/ecr-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,4BAA4B,CAAA;AACjD,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AAGtC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,UAAU;IACrB;;;;;OAKG;IACI,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,cAAc,EAAE,MAAM;CAS3F"}
@@ -0,0 +1,61 @@
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.EcrManager = void 0;
23
+ const ecr = __importStar(require("aws-cdk-lib/aws-ecr-assets"));
24
+ const utils = __importStar(require("../../utils"));
25
+ /**
26
+ * @stability stable
27
+ * @category cdk-utils.ecr-manager
28
+ * @subcategory Construct
29
+ * @classdesc Provides operations on AWS Elastic Container Registry.
30
+ * - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
31
+ * - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
32
+ * @example
33
+ * import * as common from '@gradientedge/cdk-utils'
34
+ *
35
+ * class CustomConstruct extends common.common.CommonConstruct {
36
+ * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
37
+ * super(parent, id, props)
38
+ * this.props = props
39
+ * this.ecrManager.createDockerImage('MyImage', this, dockerfilePath)
40
+ * }
41
+ * }
42
+ *
43
+ * @see [CDK ECR Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecr-readme.html}
44
+ */
45
+ class EcrManager {
46
+ /**
47
+ * @summary Method to create a docker image in ecr
48
+ * @param {string} id scoped id of the resource
49
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
50
+ * @param {string} dockerfilePath
51
+ */
52
+ createDockerImage(id, scope, dockerfilePath) {
53
+ const asset = new ecr.DockerImageAsset(scope, `${id}`, {
54
+ directory: dockerfilePath,
55
+ });
56
+ utils.createCfnOutput(`${id}-dockerImageArn`, scope, asset.imageUri);
57
+ return asset;
58
+ }
59
+ }
60
+ exports.EcrManager = EcrManager;
61
+ //# sourceMappingURL=ecr-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ecr-manager.js","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/ecr-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,gEAAiD;AAEjD,mDAAoC;AAEpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,UAAU;IACrB;;;;;OAKG;IACI,iBAAiB,CAAC,EAAU,EAAE,KAA6B,EAAE,cAAsB;QACxF,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,gBAAgB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;YACrD,SAAS,EAAE,cAAc;SAC1B,CAAC,CAAA;QAEF,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;QAEpE,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AAhBD,gCAgBC"}
@@ -0,0 +1,49 @@
1
+ import * as ec2 from 'aws-cdk-lib/aws-ec2';
2
+ import * as ecs from 'aws-cdk-lib/aws-ecs';
3
+ import * as iam from 'aws-cdk-lib/aws-iam';
4
+ import * as logs from 'aws-cdk-lib/aws-logs';
5
+ import * as common from '../../common';
6
+ import * as types from '../../types';
7
+ /**
8
+ * @stability stable
9
+ * @category cdk-utils.ecs-manager
10
+ * @subcategory Construct
11
+ * @classdesc Provides operations on AWS Elastic Container Service.
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.ecsManager.createEcsCluster('MyCluster', this, vpc)
22
+ * }
23
+ * }
24
+ *
25
+ * @see [CDK ECS Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs-readme.html}
26
+ */
27
+ export declare class EcsManager {
28
+ /**
29
+ * @summary Method to create an ecs cluster
30
+ * @param {string} id scoped id of the resource
31
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
32
+ * @param {types.EcsClusterProps} props
33
+ * @param {ec2.IVpc} vpc
34
+ */
35
+ createEcsCluster(id: string, scope: common.CommonConstruct, props: types.EcsClusterProps, vpc: ec2.IVpc): ecs.Cluster;
36
+ /**
37
+ * @summary Method to create an ecs fargate task
38
+ * @param {string} id scoped id of the resource
39
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
40
+ * @param {types.EcsTaskProps} props
41
+ * @param {ecs.ICluster} cluster
42
+ * @param {iam.Role} role
43
+ * @param {logs.ILogGroup} logGroup
44
+ * @param {ecs.ContainerImage} containerImage
45
+ * @param {Map<string, string>} environment
46
+ */
47
+ createEcsFargateTask(id: string, scope: common.CommonConstruct, props: types.EcsTaskProps, cluster: ecs.ICluster, role: iam.Role, logGroup: logs.ILogGroup, containerImage: ecs.ContainerImage, environment?: any): ecs.TaskDefinition;
48
+ }
49
+ //# sourceMappingURL=ecs-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ecs-manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/ecs-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,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,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,eAAe,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI;IAc9G;;;;;;;;;;OAUG;IACI,oBAAoB,CACzB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,KAAK,EAAE,KAAK,CAAC,YAAY,EACzB,OAAO,EAAE,GAAG,CAAC,QAAQ,EACrB,IAAI,EAAE,GAAG,CAAC,IAAI,EACd,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,cAAc,EAAE,GAAG,CAAC,cAAc,EAClC,WAAW,CAAC,EAAE,GAAG;CA+BpB"}
@@ -0,0 +1,104 @@
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.EcsManager = void 0;
23
+ const ecs = __importStar(require("aws-cdk-lib/aws-ecs"));
24
+ const utils = __importStar(require("../../utils"));
25
+ /**
26
+ * @stability stable
27
+ * @category cdk-utils.ecs-manager
28
+ * @subcategory Construct
29
+ * @classdesc Provides operations on AWS Elastic Container Service.
30
+ * - A new instance of this class is injected into {@link common.CommonConstruct} constructor.
31
+ * - If a custom construct extends {@link common.CommonConstruct}, an instance is available within the context.
32
+ * @example
33
+ * import * as common from '@gradientedge/cdk-utils'
34
+ *
35
+ * class CustomConstruct extends common.common.CommonConstruct {
36
+ * constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
37
+ * super(parent, id, props)
38
+ * this.props = props
39
+ * this.ecsManager.createEcsCluster('MyCluster', this, vpc)
40
+ * }
41
+ * }
42
+ *
43
+ * @see [CDK ECS Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs-readme.html}
44
+ */
45
+ class EcsManager {
46
+ /**
47
+ * @summary Method to create an ecs cluster
48
+ * @param {string} id scoped id of the resource
49
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
50
+ * @param {types.EcsClusterProps} props
51
+ * @param {ec2.IVpc} vpc
52
+ */
53
+ createEcsCluster(id, scope, props, vpc) {
54
+ if (!props)
55
+ throw `Ecs Cluster props undefined`;
56
+ const ecsCluster = new ecs.Cluster(scope, `${id}`, {
57
+ clusterName: `${props.clusterName}-${scope.props.stage}`,
58
+ vpc: vpc,
59
+ });
60
+ utils.createCfnOutput(`${id}-clusterArn`, scope, ecsCluster.clusterArn);
61
+ utils.createCfnOutput(`${id}-clusterName`, scope, ecsCluster.clusterName);
62
+ return ecsCluster;
63
+ }
64
+ /**
65
+ * @summary Method to create an ecs fargate task
66
+ * @param {string} id scoped id of the resource
67
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
68
+ * @param {types.EcsTaskProps} props
69
+ * @param {ecs.ICluster} cluster
70
+ * @param {iam.Role} role
71
+ * @param {logs.ILogGroup} logGroup
72
+ * @param {ecs.ContainerImage} containerImage
73
+ * @param {Map<string, string>} environment
74
+ */
75
+ createEcsFargateTask(id, scope, props, cluster, role, logGroup, containerImage, environment) {
76
+ if (!props)
77
+ throw `EcsTask props undefined`;
78
+ const ecsTask = new ecs.TaskDefinition(scope, `${id}`, {
79
+ compatibility: ecs.Compatibility.FARGATE,
80
+ cpu: props.cpu,
81
+ executionRole: role,
82
+ family: `${props.family}-${scope.props.stage}`,
83
+ memoryMiB: props.memoryMiB,
84
+ networkMode: ecs.NetworkMode.AWS_VPC,
85
+ taskRole: role,
86
+ });
87
+ ecsTask.addContainer('EcsContainer', {
88
+ cpu: props.cpu ? parseInt(props.cpu) : undefined,
89
+ disableNetworking: false,
90
+ environment: environment,
91
+ image: containerImage,
92
+ logging: ecs.LogDriver.awsLogs({
93
+ logGroup: logGroup,
94
+ streamPrefix: `${id}`,
95
+ }),
96
+ memoryLimitMiB: props.memoryMiB ? parseInt(props.memoryMiB) : undefined,
97
+ privileged: false,
98
+ });
99
+ utils.createCfnOutput(`${id}-taskArn`, scope, ecsTask.taskDefinitionArn);
100
+ return ecsTask;
101
+ }
102
+ }
103
+ exports.EcsManager = EcsManager;
104
+ //# sourceMappingURL=ecs-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ecs-manager.js","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/ecs-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,yDAA0C;AAK1C,mDAAoC;AAEpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,UAAU;IACrB;;;;;;OAMG;IACI,gBAAgB,CAAC,EAAU,EAAE,KAA6B,EAAE,KAA4B,EAAE,GAAa;QAC5G,IAAI,CAAC,KAAK;YAAE,MAAM,6BAA6B,CAAA;QAE/C,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;YACjD,WAAW,EAAE,GAAG,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;YACxD,GAAG,EAAE,GAAG;SACT,CAAC,CAAA;QAEF,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,CAAA;QACvE,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,CAAA;QAEzE,OAAO,UAAU,CAAA;IACnB,CAAC;IAED;;;;;;;;;;OAUG;IACI,oBAAoB,CACzB,EAAU,EACV,KAA6B,EAC7B,KAAyB,EACzB,OAAqB,EACrB,IAAc,EACd,QAAwB,EACxB,cAAkC,EAClC,WAAiB;QAEjB,IAAI,CAAC,KAAK;YAAE,MAAM,yBAAyB,CAAA;QAE3C,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;YACrD,aAAa,EAAE,GAAG,CAAC,aAAa,CAAC,OAAO;YACxC,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,aAAa,EAAE,IAAI;YACnB,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;YAC9C,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,WAAW,EAAE,GAAG,CAAC,WAAW,CAAC,OAAO;YACpC,QAAQ,EAAE,IAAI;SACf,CAAC,CAAA;QAEF,OAAO,CAAC,YAAY,CAAC,cAAc,EAAE;YACnC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;YAChD,iBAAiB,EAAE,KAAK;YACxB,WAAW,EAAE,WAAW;YACxB,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC;gBAC7B,QAAQ,EAAE,QAAQ;gBAClB,YAAY,EAAE,GAAG,EAAE,EAAE;aACtB,CAAC;YACF,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS;YACvE,UAAU,EAAE,KAAK;SAClB,CAAC,CAAA;QAEF,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAA;QAExE,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AAxED,gCAwEC"}
@@ -0,0 +1,37 @@
1
+ import * as ec2 from 'aws-cdk-lib/aws-ec2';
2
+ import * as ecr from 'aws-cdk-lib/aws-ecr-assets';
3
+ import * as eks from 'aws-cdk-lib/aws-eks';
4
+ import * as common from '../../common';
5
+ import * as types from '../../types';
6
+ /**
7
+ * @stability stable
8
+ * @category cdk-utils.eks-manager
9
+ * @subcategory Construct
10
+ * @classdesc Provides operations on AWS Elastic Kubernetes Service.
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.eksManager.createEksDeployment('MyEksDeployment', this, image, vpc)
21
+ * }
22
+ * }
23
+ *
24
+ * @see [CDK EKS Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks-readme.html}
25
+ */
26
+ export declare class EksManager {
27
+ /**
28
+ * @summary Method to create an eks deployment
29
+ * @param {string} id scoped id of the resource
30
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
31
+ * @param {types.EksClusterProps} props
32
+ * @param {ecr.DockerImageAsset} image
33
+ * @param {ec2.IVpc} vpc
34
+ */
35
+ createEksDeployment(id: string, scope: common.CommonConstruct, props: types.EksClusterProps, image: ecr.DockerImageAsset, vpc: ec2.IVpc): eks.Cluster;
36
+ }
37
+ //# sourceMappingURL=eks-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eks-manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/eks-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,OAAO,KAAK,GAAG,MAAM,4BAA4B,CAAA;AACjD,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AAGpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,UAAU;IACrB;;;;;;;OAOG;IACI,mBAAmB,CACxB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,KAAK,EAAE,KAAK,CAAC,eAAe,EAC5B,KAAK,EAAE,GAAG,CAAC,gBAAgB,EAC3B,GAAG,EAAE,GAAG,CAAC,IAAI;CA4DhB"}
@@ -0,0 +1,110 @@
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.EksManager = void 0;
23
+ const ec2 = __importStar(require("aws-cdk-lib/aws-ec2"));
24
+ const eks = __importStar(require("aws-cdk-lib/aws-eks"));
25
+ const utils = __importStar(require("../../utils"));
26
+ /**
27
+ * @stability stable
28
+ * @category cdk-utils.eks-manager
29
+ * @subcategory Construct
30
+ * @classdesc Provides operations on AWS Elastic Kubernetes 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.eksManager.createEksDeployment('MyEksDeployment', this, image, vpc)
41
+ * }
42
+ * }
43
+ *
44
+ * @see [CDK EKS Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks-readme.html}
45
+ */
46
+ class EksManager {
47
+ /**
48
+ * @summary Method to create an eks deployment
49
+ * @param {string} id scoped id of the resource
50
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
51
+ * @param {types.EksClusterProps} props
52
+ * @param {ecr.DockerImageAsset} image
53
+ * @param {ec2.IVpc} vpc
54
+ */
55
+ createEksDeployment(id, scope, props, image, vpc) {
56
+ if (!props)
57
+ throw `EksCluster props undefined`;
58
+ const appLabel = { app: `${id}`.toLowerCase() };
59
+ const deployment = {
60
+ apiVersion: 'apps/v1',
61
+ kind: 'Deployment',
62
+ metadata: { name: `${id}`.toLowerCase() },
63
+ spec: {
64
+ selector: { matchLabels: appLabel },
65
+ template: {
66
+ metadata: { labels: appLabel },
67
+ spec: {
68
+ containers: [
69
+ {
70
+ name: `${id}`.toLowerCase(),
71
+ image: image.imageUri,
72
+ ports: [{ containerPort: props.appContainerPort }],
73
+ },
74
+ ],
75
+ },
76
+ },
77
+ },
78
+ };
79
+ const service = {
80
+ apiVersion: 'v1',
81
+ kind: 'Service',
82
+ metadata: { name: `${id}`.toLowerCase() },
83
+ spec: {
84
+ type: 'LoadBalancer',
85
+ ports: [
86
+ {
87
+ name: 'http-port',
88
+ protocol: 'TCP',
89
+ port: 80,
90
+ targetPort: props.appContainerPort,
91
+ },
92
+ ],
93
+ selector: appLabel,
94
+ },
95
+ };
96
+ const cluster = new eks.Cluster(scope, `${id}Cluster`, {
97
+ clusterName: `${id.toLowerCase()}-${scope.props.stage}`,
98
+ defaultCapacity: props.appCapacity,
99
+ defaultCapacityInstance: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.LARGE),
100
+ version: eks.KubernetesVersion.V1_18,
101
+ vpc,
102
+ });
103
+ cluster.addManifest(`${id}Pod`, service, deployment);
104
+ utils.createCfnOutput(`${id}-clusterArn`, scope, cluster.clusterArn);
105
+ utils.createCfnOutput(`${id}-clusterEndpoint`, scope, cluster.clusterEndpoint);
106
+ return cluster;
107
+ }
108
+ }
109
+ exports.EksManager = EksManager;
110
+ //# sourceMappingURL=eks-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eks-manager.js","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/eks-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA0C;AAE1C,yDAA0C;AAG1C,mDAAoC;AAEpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,UAAU;IACrB;;;;;;;OAOG;IACI,mBAAmB,CACxB,EAAU,EACV,KAA6B,EAC7B,KAA4B,EAC5B,KAA2B,EAC3B,GAAa;QAEb,IAAI,CAAC,KAAK;YAAE,MAAM,4BAA4B,CAAA;QAE9C,MAAM,QAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,EAAE,EAAE,CAAA;QAE/C,MAAM,UAAU,GAAG;YACjB,UAAU,EAAE,SAAS;YACrB,IAAI,EAAE,YAAY;YAClB,QAAQ,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,EAAE,EAAE;YACzC,IAAI,EAAE;gBACJ,QAAQ,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE;gBACnC,QAAQ,EAAE;oBACR,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;oBAC9B,IAAI,EAAE;wBACJ,UAAU,EAAE;4BACV;gCACE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,EAAE;gCAC3B,KAAK,EAAE,KAAK,CAAC,QAAQ;gCACrB,KAAK,EAAE,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,gBAAgB,EAAE,CAAC;6BACnD;yBACF;qBACF;iBACF;aACF;SACF,CAAA;QAED,MAAM,OAAO,GAAG;YACd,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,EAAE,EAAE;YACzC,IAAI,EAAE;gBACJ,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE;oBACL;wBACE,IAAI,EAAE,WAAW;wBACjB,QAAQ,EAAE,KAAK;wBACf,IAAI,EAAE,EAAE;wBACR,UAAU,EAAE,KAAK,CAAC,gBAAgB;qBACnC;iBACF;gBACD,QAAQ,EAAE,QAAQ;aACnB;SACF,CAAA;QAED,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE;YACrD,WAAW,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;YACvD,eAAe,EAAE,KAAK,CAAC,WAAW;YAClC,uBAAuB,EAAE,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,EAAE,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC;YAC1F,OAAO,EAAE,GAAG,CAAC,iBAAiB,CAAC,KAAK;YACpC,GAAG;SACJ,CAAC,CAAA;QAEF,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAA;QAEpD,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;QACpE,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE,kBAAkB,EAAE,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;QAE9E,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AA1ED,gCA0EC"}
@@ -0,0 +1,68 @@
1
+ import * as ecs from 'aws-cdk-lib/aws-ecs';
2
+ import * as events from 'aws-cdk-lib/aws-events';
3
+ import * as iam from 'aws-cdk-lib/aws-iam';
4
+ import * as lambda from 'aws-cdk-lib/aws-lambda';
5
+ import * as common from '../../common';
6
+ import * as types from '../../types';
7
+ /**
8
+ * @stability stable
9
+ * @category cdk-utils.event-manager
10
+ * @subcategory Construct
11
+ * @classdesc Provides operations on AWS EventBridge.
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.eventManager.createLambdaRule('MyLambdaRule', this, lambdaFunction)
22
+ * }
23
+ * }
24
+ *
25
+ * @see [CDK EventBridge Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events-readme.html}
26
+ */
27
+ export declare class EventManager {
28
+ /**
29
+ * Method to create an event bus
30
+ * @param {string} id scoped id of the resource
31
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
32
+ * @param {types.EventBusProps} props event bus properties
33
+ */
34
+ createEventBus(id: string, scope: common.CommonConstruct, props: types.EventBusProps): events.EventBus;
35
+ /**
36
+ * Method to create an event rule
37
+ * @param {string} id scoped id of the resource
38
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
39
+ * @param {types.EventRuleProps} props event rule properties
40
+ * @param {events.IEventBus?} eventBus optional custom event bus
41
+ * @param {events.IRuleTarget[]?} targets optional event targets
42
+ */
43
+ createRule(id: string, scope: common.CommonConstruct, props: types.EventRuleProps, eventBus?: events.IEventBus, targets?: events.IRuleTarget[]): events.Rule;
44
+ /**
45
+ * @summary Method to create an eventbridge rule with lambda target
46
+ * @param {string} id scoped id of the resource
47
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
48
+ * @param {types.RuleProps} props
49
+ * @param {lambda.Function} lambdaFunction
50
+ * @param {string} eventBusName
51
+ * @param {any} eventPattern
52
+ * @param {string} scheduleExpression
53
+ */
54
+ createLambdaRule(id: string, scope: common.CommonConstruct, props: types.RuleProps, lambdaFunction: lambda.Function, eventBusName?: string, eventPattern?: any, scheduleExpression?: string): events.CfnRule;
55
+ /**
56
+ * @summary Method to create an eventbridge rule with fargate task target
57
+ * @param {string} id scoped id of the resource
58
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
59
+ * @param {types.RuleProps} props
60
+ * @param {ecs.ICluster} cluster
61
+ * @param {ecs.ITaskDefinition} task
62
+ * @param {string[]} subnetIds
63
+ * @param {iam.Role | iam.CfnRole} role
64
+ * @param {any} eventPattern
65
+ */
66
+ createFargateTaskRule(id: string, scope: common.CommonConstruct, props: types.RuleProps, cluster: ecs.ICluster, task: ecs.ITaskDefinition, subnetIds: string[], role: iam.Role | iam.CfnRole, eventPattern?: any): events.CfnRule;
67
+ }
68
+ //# sourceMappingURL=event-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-manager.d.ts","sourceRoot":"","sources":["../../../../../src/lib/manager/aws/event-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAA;AAChD,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAA;AAC1C,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAA;AAChD,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AAGpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,YAAY;IACvB;;;;;OAKG;IACI,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa;IAa3F;;;;;;;OAOG;IACI,UAAU,CACf,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,KAAK,EAAE,KAAK,CAAC,cAAc,EAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC,SAAS,EAC3B,OAAO,CAAC,EAAE,MAAM,CAAC,WAAW,EAAE;IAsBhC;;;;;;;;;OASG;IACI,gBAAgB,CACrB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,KAAK,EAAE,KAAK,CAAC,SAAS,EACtB,cAAc,EAAE,MAAM,CAAC,QAAQ,EAC/B,YAAY,CAAC,EAAE,MAAM,EACrB,YAAY,CAAC,EAAE,GAAG,EAClB,kBAAkB,CAAC,EAAE,MAAM;IA2B7B;;;;;;;;;;OAUG;IACI,qBAAqB,CAC1B,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,CAAC,eAAe,EAC7B,KAAK,EAAE,KAAK,CAAC,SAAS,EACtB,OAAO,EAAE,GAAG,CAAC,QAAQ,EACrB,IAAI,EAAE,GAAG,CAAC,eAAe,EACzB,SAAS,EAAE,MAAM,EAAE,EACnB,IAAI,EAAE,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,OAAO,EAC5B,YAAY,CAAC,EAAE,GAAG;CA+BrB"}
@@ -0,0 +1,163 @@
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.EventManager = void 0;
23
+ const events = __importStar(require("aws-cdk-lib/aws-events"));
24
+ const iam = __importStar(require("aws-cdk-lib/aws-iam"));
25
+ const lambda = __importStar(require("aws-cdk-lib/aws-lambda"));
26
+ const utils = __importStar(require("../../utils"));
27
+ /**
28
+ * @stability stable
29
+ * @category cdk-utils.event-manager
30
+ * @subcategory Construct
31
+ * @classdesc Provides operations on AWS EventBridge.
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.eventManager.createLambdaRule('MyLambdaRule', this, lambdaFunction)
42
+ * }
43
+ * }
44
+ *
45
+ * @see [CDK EventBridge Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events-readme.html}
46
+ */
47
+ class EventManager {
48
+ /**
49
+ * Method to create an event bus
50
+ * @param {string} id scoped id of the resource
51
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
52
+ * @param {types.EventBusProps} props event bus properties
53
+ */
54
+ createEventBus(id, scope, props) {
55
+ if (!props)
56
+ throw 'EventBus props undefined';
57
+ const eventBus = new events.EventBus(scope, `${id}`, {
58
+ eventBusName: `${props.eventBusName}-${scope.props.stage}`,
59
+ });
60
+ utils.createCfnOutput(`${id}-eventBusName`, scope, eventBus.eventBusName);
61
+ utils.createCfnOutput(`${id}-eventBusArn`, scope, eventBus.eventBusArn);
62
+ return eventBus;
63
+ }
64
+ /**
65
+ * Method to create an event rule
66
+ * @param {string} id scoped id of the resource
67
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
68
+ * @param {types.EventRuleProps} props event rule properties
69
+ * @param {events.IEventBus?} eventBus optional custom event bus
70
+ * @param {events.IRuleTarget[]?} targets optional event targets
71
+ */
72
+ createRule(id, scope, props, eventBus, targets) {
73
+ if (!props)
74
+ throw `EventRule props undefined`;
75
+ const rule = new events.Rule(scope, `${id}`, {
76
+ eventBus: eventBus,
77
+ description: props.description,
78
+ ruleName: `${props.ruleName}-${scope.props.stage}`,
79
+ eventPattern: props.eventPattern,
80
+ });
81
+ if (targets && targets.length > 0) {
82
+ targets.forEach(target => {
83
+ rule.addTarget(target);
84
+ });
85
+ }
86
+ utils.createCfnOutput(`${id}-ruleArn`, scope, rule.ruleArn);
87
+ utils.createCfnOutput(`${id}-ruleName`, scope, rule.ruleName);
88
+ return rule;
89
+ }
90
+ /**
91
+ * @summary Method to create an eventbridge rule with lambda target
92
+ * @param {string} id scoped id of the resource
93
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
94
+ * @param {types.RuleProps} props
95
+ * @param {lambda.Function} lambdaFunction
96
+ * @param {string} eventBusName
97
+ * @param {any} eventPattern
98
+ * @param {string} scheduleExpression
99
+ */
100
+ createLambdaRule(id, scope, props, lambdaFunction, eventBusName, eventPattern, scheduleExpression) {
101
+ if (!props)
102
+ throw `EventRule props undefined`;
103
+ const eventRule = new events.CfnRule(scope, `${id}`, {
104
+ description: 'Rule to send notification to lambda function target',
105
+ eventBusName: eventBusName,
106
+ eventPattern: eventPattern,
107
+ scheduleExpression: scheduleExpression,
108
+ name: `${props.name}-${scope.props.stage}`,
109
+ state: props.state,
110
+ targets: [{ arn: lambdaFunction.functionArn, id: `${id}-${scope.props.stage}` }],
111
+ });
112
+ new lambda.CfnPermission(scope, `${id}LambdaPermission`, {
113
+ action: 'lambda:InvokeFunction',
114
+ functionName: lambdaFunction.functionName,
115
+ principal: 'events.amazonaws.com',
116
+ sourceArn: eventRule.attrArn,
117
+ });
118
+ utils.createCfnOutput(`${id}-ruleArn`, scope, eventRule.attrArn);
119
+ utils.createCfnOutput(`${id}-ruleName`, scope, eventRule.name);
120
+ return eventRule;
121
+ }
122
+ /**
123
+ * @summary Method to create an eventbridge rule with fargate task target
124
+ * @param {string} id scoped id of the resource
125
+ * @param {common.CommonConstruct} scope scope in which this resource is defined
126
+ * @param {types.RuleProps} props
127
+ * @param {ecs.ICluster} cluster
128
+ * @param {ecs.ITaskDefinition} task
129
+ * @param {string[]} subnetIds
130
+ * @param {iam.Role | iam.CfnRole} role
131
+ * @param {any} eventPattern
132
+ */
133
+ createFargateTaskRule(id, scope, props, cluster, task, subnetIds, role, eventPattern) {
134
+ if (!props)
135
+ throw `EventRule props undefined`;
136
+ const eventRule = new events.CfnRule(scope, `${id}`, {
137
+ description: 'Rule to send notification on new objects in data bucket to ecs task target',
138
+ eventPattern: eventPattern,
139
+ name: `${props.name}-${scope.props.stage}`,
140
+ state: props.state,
141
+ targets: [
142
+ {
143
+ arn: cluster.clusterArn,
144
+ id: `${id}-${scope.props.stage}`,
145
+ ecsParameters: {
146
+ launchType: 'FARGATE',
147
+ networkConfiguration: {
148
+ awsVpcConfiguration: { assignPublicIp: 'ENABLED', subnets: subnetIds },
149
+ },
150
+ taskCount: 1,
151
+ taskDefinitionArn: task.taskDefinitionArn,
152
+ },
153
+ roleArn: role instanceof iam.Role ? role.roleArn : role.attrArn,
154
+ },
155
+ ],
156
+ });
157
+ utils.createCfnOutput(`${id}-ruleArn`, scope, eventRule.attrArn);
158
+ utils.createCfnOutput(`${id}-ruleName`, scope, eventRule.name);
159
+ return eventRule;
160
+ }
161
+ }
162
+ exports.EventManager = EventManager;
163
+ //# sourceMappingURL=event-manager.js.map