@takumi-stack/core 1.0.0 → 1.0.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 (810) hide show
  1. package/.dist/common/coordinator.d.ts +18 -0
  2. package/.dist/common/index.d.ts +6 -0
  3. package/.dist/common/modifier.d.ts +4 -0
  4. package/.dist/common/naming/get-deploy-config.d.ts +5 -0
  5. package/.dist/common/naming/get-domain.d.ts +8 -0
  6. package/.dist/common/naming/get-function-entry.d.ts +3 -0
  7. package/.dist/common/naming/get-logical-name.d.ts +2 -0
  8. package/.dist/common/naming/get-resource-name.d.ts +26 -0
  9. package/.dist/common/naming/get-service-name.d.ts +9 -0
  10. package/.dist/common/naming/index.d.ts +8 -0
  11. package/.dist/common/naming/string-parser.d.ts +4 -0
  12. package/.dist/common/service.d.ts +21 -0
  13. package/.dist/common/synth/account-mapping.d.ts +2 -0
  14. package/.dist/common/synth/assume-role.d.ts +17 -0
  15. package/.dist/common/synth/get-global-props.d.ts +4 -0
  16. package/.dist/common/synth/get-service-props.d.ts +3 -0
  17. package/.dist/common/synth/index.d.ts +8 -0
  18. package/.dist/common/synth/pre-script.d.ts +21 -0
  19. package/.dist/common/synth/props-types.d.ts +41 -0
  20. package/.dist/common/synth/synth-error.d.ts +7 -0
  21. package/.dist/index.d.ts +4 -0
  22. package/.dist/package.json +43 -0
  23. package/.dist/prefab/analytics/events/handlers/ingestion-transform/handler.d.ts +3 -0
  24. package/.dist/prefab/analytics/events/index.d.ts +28 -0
  25. package/.dist/prefab/analytics/events/index.d.ts.map +1 -0
  26. package/.dist/prefab/analytics/events/index.js +163 -0
  27. package/.dist/prefab/analytics/events/index.js.map +1 -0
  28. package/.dist/prefab/analytics/index.d.ts +2 -0
  29. package/.dist/prefab/auth/cognito-pool/index.d.ts +57 -0
  30. package/.dist/prefab/auth/cognito-pool/index.d.ts.map +1 -0
  31. package/.dist/prefab/auth/cognito-pool/index.js.map +1 -0
  32. package/.dist/prefab/auth/index.d.ts +2 -0
  33. package/.dist/prefab/cdn/cdn-api/index.d.ts +34 -0
  34. package/.dist/prefab/cdn/cdn-api/index.d.ts.map +1 -0
  35. package/.dist/prefab/cdn/cdn-api/index.js +153 -0
  36. package/.dist/prefab/cdn/cdn-api/index.js.map +1 -0
  37. package/.dist/prefab/cdn/cdn-asset/index.d.ts +24 -0
  38. package/.dist/prefab/cdn/cdn-asset/index.d.ts.map +1 -0
  39. package/.dist/prefab/cdn/cdn-asset/index.js +96 -0
  40. package/.dist/prefab/cdn/cdn-asset/index.js.map +1 -0
  41. package/.dist/prefab/cdn/cdn-spa/index.d.ts +24 -0
  42. package/.dist/prefab/cdn/cdn-spa/index.d.ts.map +1 -0
  43. package/.dist/prefab/cdn/cdn-spa/index.js +138 -0
  44. package/.dist/prefab/cdn/cdn-spa/index.js.map +1 -0
  45. package/.dist/prefab/cdn/cdn-ssr/index.d.ts +33 -0
  46. package/.dist/prefab/cdn/cdn-ssr/index.d.ts.map +1 -0
  47. package/.dist/prefab/cdn/cdn-ssr/index.js +271 -0
  48. package/.dist/prefab/cdn/cdn-ssr/index.js.map +1 -0
  49. package/.dist/prefab/cdn/index.d.ts +5 -0
  50. package/.dist/prefab/compute/fargate/cluster.d.ts +13 -0
  51. package/.dist/prefab/compute/fargate/cluster.d.ts.map +1 -0
  52. package/.dist/prefab/compute/fargate/cluster.js.map +1 -0
  53. package/.dist/prefab/compute/fargate/index.d.ts +3 -0
  54. package/.dist/prefab/compute/fargate/service.d.ts +45 -0
  55. package/.dist/prefab/compute/fargate/service.d.ts.map +1 -0
  56. package/.dist/prefab/compute/fargate/service.js.map +1 -0
  57. package/.dist/prefab/compute/function/api-function/api-aggregate.d.ts +31 -0
  58. package/.dist/prefab/compute/function/api-function/api-aggregate.d.ts.map +1 -0
  59. package/.dist/prefab/compute/function/api-function/api-aggregate.js +53 -0
  60. package/.dist/prefab/compute/function/api-function/api-aggregate.js.map +1 -0
  61. package/.dist/prefab/compute/function/api-function/api-function.d.ts +22 -0
  62. package/.dist/prefab/compute/function/api-function/api-function.d.ts.map +1 -0
  63. package/.dist/prefab/compute/function/api-function/api-function.js +44 -0
  64. package/.dist/prefab/compute/function/api-function/api-function.js.map +1 -0
  65. package/.dist/prefab/compute/function/api-function/index.d.ts +3 -0
  66. package/.dist/prefab/compute/function/base-function/index.d.ts +33 -0
  67. package/.dist/prefab/compute/function/base-function/index.d.ts.map +1 -0
  68. package/.dist/prefab/compute/function/base-function/index.js +70 -0
  69. package/.dist/prefab/compute/function/base-function/index.js.map +1 -0
  70. package/.dist/prefab/compute/function/cognito-function/cognito-aggregate.d.ts +15 -0
  71. package/.dist/prefab/compute/function/cognito-function/cognito-aggregate.d.ts.map +1 -0
  72. package/.dist/prefab/compute/function/cognito-function/cognito-aggregate.js.map +1 -0
  73. package/.dist/prefab/compute/function/cognito-function/cognito-function.d.ts +17 -0
  74. package/.dist/prefab/compute/function/cognito-function/cognito-function.d.ts.map +1 -0
  75. package/.dist/prefab/compute/function/cognito-function/cognito-function.js.map +1 -0
  76. package/.dist/prefab/compute/function/cognito-function/index.d.ts +3 -0
  77. package/.dist/prefab/compute/function/cron-function/cron-aggregate.d.ts +14 -0
  78. package/.dist/prefab/compute/function/cron-function/cron-aggregate.d.ts.map +1 -0
  79. package/.dist/prefab/compute/function/cron-function/cron-aggregate.js.map +1 -0
  80. package/.dist/prefab/compute/function/cron-function/cron-function.d.ts +15 -0
  81. package/.dist/prefab/compute/function/cron-function/cron-function.d.ts.map +1 -0
  82. package/.dist/prefab/compute/function/cron-function/cron-function.js +24 -0
  83. package/.dist/prefab/compute/function/cron-function/cron-function.js.map +1 -0
  84. package/.dist/prefab/compute/function/cron-function/index.d.ts +3 -0
  85. package/.dist/prefab/compute/function/event-function/EventAggregateParams.d.ts +9 -0
  86. package/.dist/prefab/compute/function/event-function/EventAggregateParams.d.ts.map +1 -0
  87. package/.dist/prefab/compute/function/event-function/EventAggregateParams.js +3 -0
  88. package/.dist/prefab/compute/function/event-function/EventAggregateParams.js.map +1 -0
  89. package/.dist/prefab/compute/function/event-function/event-aggregate.d.ts +16 -0
  90. package/.dist/prefab/compute/function/event-function/event-aggregate.d.ts.map +1 -0
  91. package/.dist/prefab/compute/function/event-function/event-aggregate.js.map +1 -0
  92. package/.dist/prefab/compute/function/event-function/event-function.d.ts +14 -0
  93. package/.dist/prefab/compute/function/event-function/event-function.d.ts.map +1 -0
  94. package/.dist/prefab/compute/function/event-function/event-function.js.map +1 -0
  95. package/.dist/prefab/compute/function/event-function/index.d.ts +3 -0
  96. package/.dist/prefab/compute/function/index.d.ts +8 -0
  97. package/.dist/prefab/compute/function/queue-function/index.d.ts +22 -0
  98. package/.dist/prefab/compute/function/queue-function/index.d.ts.map +1 -0
  99. package/.dist/prefab/compute/function/queue-function/index.js +46 -0
  100. package/.dist/prefab/compute/function/queue-function/index.js.map +1 -0
  101. package/.dist/prefab/compute/function/topic-function/index.d.ts +20 -0
  102. package/.dist/prefab/compute/function/topic-function/index.d.ts.map +1 -0
  103. package/.dist/prefab/compute/function/topic-function/index.js +23 -0
  104. package/.dist/prefab/compute/function/topic-function/index.js.map +1 -0
  105. package/.dist/prefab/compute/index.d.ts +3 -0
  106. package/.dist/prefab/database/dynamo/index.d.ts +13 -0
  107. package/.dist/prefab/database/dynamo/index.d.ts.map +1 -0
  108. package/.dist/prefab/database/dynamo/index.js.map +1 -0
  109. package/.dist/prefab/database/index.d.ts +4 -0
  110. package/.dist/prefab/database/rds/handlers/start-cluster/handler.d.ts +2 -0
  111. package/.dist/prefab/database/rds/handlers/stop-cluster/handler.d.ts +2 -0
  112. package/.dist/prefab/database/rds/index.d.ts +51 -0
  113. package/.dist/prefab/database/rds/index.d.ts.map +1 -0
  114. package/.dist/prefab/database/rds/index.js +223 -0
  115. package/.dist/prefab/database/rds/index.js.map +1 -0
  116. package/.dist/prefab/database/timestream/index.d.ts +3 -0
  117. package/.dist/prefab/database/timestream/timestream-database.d.ts +11 -0
  118. package/.dist/prefab/database/timestream/timestream-database.d.ts.map +1 -0
  119. package/.dist/prefab/database/timestream/timestream-database.js.map +1 -0
  120. package/.dist/prefab/database/timestream/timestream-table.d.ts +21 -0
  121. package/.dist/prefab/database/timestream/timestream-table.d.ts.map +1 -0
  122. package/.dist/prefab/database/timestream/timestream-table.js.map +1 -0
  123. package/.dist/prefab/gateway/alb-public/index.d.ts +41 -0
  124. package/.dist/prefab/gateway/alb-public/index.d.ts.map +1 -0
  125. package/.dist/prefab/gateway/alb-public/index.js.map +1 -0
  126. package/.dist/prefab/gateway/api-gateway/api-http.d.ts +27 -0
  127. package/.dist/prefab/gateway/api-gateway/api-http.d.ts.map +1 -0
  128. package/.dist/prefab/gateway/api-gateway/api-http.js.map +1 -0
  129. package/.dist/prefab/gateway/api-gateway/api-rest.d.ts +23 -0
  130. package/.dist/prefab/gateway/api-gateway/api-rest.d.ts.map +1 -0
  131. package/.dist/prefab/gateway/api-gateway/api-rest.js.map +1 -0
  132. package/.dist/prefab/gateway/api-gateway/index.d.ts +3 -0
  133. package/.dist/prefab/gateway/app-sync/index.d.ts +31 -0
  134. package/.dist/prefab/gateway/app-sync/index.d.ts.map +1 -0
  135. package/.dist/prefab/gateway/app-sync/index.js.map +1 -0
  136. package/.dist/prefab/gateway/app-sync/resolver-aggregate.d.ts +33 -0
  137. package/.dist/prefab/gateway/app-sync/resolver-aggregate.d.ts.map +1 -0
  138. package/.dist/prefab/gateway/app-sync/resolver-aggregate.js.map +1 -0
  139. package/.dist/prefab/gateway/app-sync/types.d.ts +29 -0
  140. package/.dist/prefab/gateway/app-sync/types.d.ts.map +1 -0
  141. package/.dist/prefab/gateway/index.d.ts +4 -0
  142. package/.dist/prefab/index.d.ts +11 -0
  143. package/.dist/prefab/integration/event-bus/index.d.ts +18 -0
  144. package/.dist/prefab/integration/event-bus/index.d.ts.map +1 -0
  145. package/.dist/prefab/integration/event-bus/index.js.map +1 -0
  146. package/.dist/prefab/integration/index.d.ts +4 -0
  147. package/.dist/prefab/integration/queue/index.d.ts +29 -0
  148. package/.dist/prefab/integration/queue/index.d.ts.map +1 -0
  149. package/.dist/prefab/integration/queue/index.js.map +1 -0
  150. package/.dist/prefab/integration/topic/index.d.ts +19 -0
  151. package/.dist/prefab/integration/topic/index.d.ts.map +1 -0
  152. package/.dist/prefab/integration/topic/index.js.map +1 -0
  153. package/.dist/prefab/networking/dns-domain-ref/index.d.ts +14 -0
  154. package/.dist/prefab/networking/dns-domain-ref/index.d.ts.map +1 -0
  155. package/.dist/prefab/networking/dns-domain-ref/index.js.map +1 -0
  156. package/.dist/prefab/networking/dns-subdomain-certificate/index.d.ts +11 -0
  157. package/.dist/prefab/networking/dns-subdomain-certificate/index.d.ts.map +1 -0
  158. package/.dist/prefab/networking/dns-subdomain-certificate/index.js.map +1 -0
  159. package/.dist/prefab/networking/dns-subdomain-hosted-zone/index.d.ts +10 -0
  160. package/.dist/prefab/networking/dns-subdomain-hosted-zone/index.d.ts.map +1 -0
  161. package/.dist/prefab/networking/dns-subdomain-hosted-zone/index.js.map +1 -0
  162. package/.dist/prefab/networking/index.d.ts +6 -0
  163. package/.dist/prefab/networking/vpc/index.d.ts +18 -0
  164. package/.dist/prefab/networking/vpc/index.d.ts.map +1 -0
  165. package/.dist/prefab/networking/vpc/index.js.map +1 -0
  166. package/.dist/prefab/networking/waf/index.d.ts +12 -0
  167. package/.dist/prefab/networking/waf/index.d.ts.map +1 -0
  168. package/.dist/prefab/networking/waf/index.js.map +1 -0
  169. package/.dist/prefab/storage/bucket/asset-bucket.d.ts +10 -0
  170. package/.dist/prefab/storage/bucket/asset-bucket.d.ts.map +1 -0
  171. package/.dist/prefab/storage/bucket/index.d.ts +3 -0
  172. package/.dist/prefab/storage/bucket/private-bucket.d.ts +32 -0
  173. package/.dist/prefab/storage/bucket/private-bucket.d.ts.map +1 -0
  174. package/.dist/prefab/storage/bucket/private-bucket.js.map +1 -0
  175. package/.dist/prefab/storage/index.d.ts +2 -0
  176. package/.dist/prefab/utils/config/frontend-env-builder.d.ts +12 -0
  177. package/.dist/prefab/utils/config/frontend-env-builder.d.ts.map +1 -0
  178. package/.dist/prefab/utils/config/frontend-env-builder.js.map +1 -0
  179. package/.dist/prefab/utils/config/index.d.ts +4 -0
  180. package/.dist/prefab/utils/config/parameter-secret.d.ts +19 -0
  181. package/.dist/prefab/utils/config/parameter-secret.d.ts.map +1 -0
  182. package/.dist/prefab/utils/config/parameter-secret.js.map +1 -0
  183. package/.dist/prefab/utils/config/runtime-secret.d.ts.map +1 -0
  184. package/.dist/prefab/utils/config/runtime-secret.js.map +1 -0
  185. package/.dist/prefab/utils/deploy-pipeline/catalog/integrations/index.d.ts +2 -0
  186. package/.dist/prefab/utils/deploy-pipeline/entities/index.d.ts +29 -0
  187. package/.dist/prefab/utils/deploy-pipeline/index.d.ts +13 -0
  188. package/.dist/prefab/utils/deploy-pipeline/index.d.ts.map +1 -0
  189. package/.dist/prefab/utils/deploy-pipeline/index.js.map +1 -0
  190. package/.dist/prefab/utils/deploy-pipeline/platform/get-pipeline-detail.d.ts +6 -0
  191. package/.dist/prefab/utils/deploy-pipeline/platform/get-slack-payload.d.ts +3 -0
  192. package/.dist/prefab/utils/duration.d.ts +2 -0
  193. package/.dist/prefab/utils/index.d.ts +5 -0
  194. package/.dist/prefab/utils/ses/index.d.ts +20 -0
  195. package/.dist/prefab/utils/ses/index.d.ts.map +1 -0
  196. package/.dist/prefab/utils/ses/index.js.map +1 -0
  197. package/.dist/script/config-command/bootstrap.d.ts +3 -0
  198. package/.dist/script/config-command/bootstrap.js +65 -0
  199. package/.dist/script/config-command/bootstrap.js.map +1 -0
  200. package/.dist/script/config-command/deploy-spa.d.ts +3 -0
  201. package/.dist/script/config-command/deploy-spa.d.ts.map +1 -0
  202. package/.dist/script/config-command/deploy-spa.js +82 -0
  203. package/.dist/script/config-command/deploy-spa.js.map +1 -0
  204. package/.dist/script/config-command/deploy.d.ts +3 -0
  205. package/.dist/script/config-command/deploy.js +26 -0
  206. package/.dist/script/config-command/deploy.js.map +1 -0
  207. package/.dist/script/config-command/destroy.d.ts +3 -0
  208. package/.dist/script/config-command/destroy.js +26 -0
  209. package/.dist/script/config-command/destroy.js.map +1 -0
  210. package/.dist/script/config-command/env-ssr.d.ts +3 -0
  211. package/.dist/script/config-command/env-ssr.js +49 -0
  212. package/.dist/script/config-command/env-ssr.js.map +1 -0
  213. package/.dist/script/config-command/invalidation-ssr.d.ts +3 -0
  214. package/.dist/script/config-command/invalidation-ssr.js +53 -0
  215. package/.dist/script/config-command/invalidation-ssr.js.map +1 -0
  216. package/.dist/script/config-command/rds-migration.d.ts +5 -0
  217. package/.dist/script/config-command/rds-migration.js.map +1 -0
  218. package/.dist/script/config-command/rds-sync.d.ts +3 -0
  219. package/.dist/script/config-command/rds-sync.js.map +1 -0
  220. package/.dist/script/config-command/ssm-connect.d.ts +3 -0
  221. package/.dist/script/config-command/ssm-connect.js.map +1 -0
  222. package/.dist/script/config-command/start-spa.d.ts +3 -0
  223. package/.dist/script/config-command/start-spa.js +53 -0
  224. package/.dist/script/config-command/start-spa.js.map +1 -0
  225. package/.dist/script/config-command/start-ssr.d.ts +3 -0
  226. package/.dist/script/config-command/start-ssr.js +53 -0
  227. package/.dist/script/config-command/start-ssr.js.map +1 -0
  228. package/.dist/script/config-command/synth.d.ts +3 -0
  229. package/.dist/script/config-command/synth.js +26 -0
  230. package/.dist/script/config-command/synth.js.map +1 -0
  231. package/.dist/script/index.d.ts +7 -0
  232. package/.dist/script/index.d.ts.map +1 -0
  233. package/.dist/script/output-command/create-user.d.ts +9 -0
  234. package/.dist/script/output-command/create-user.d.ts.map +1 -0
  235. package/.dist/script/output-command/create-user.js.map +1 -0
  236. package/.dist/script/output-command/gen-postman-env.d.ts +9 -0
  237. package/.dist/script/output-command/gen-postman-env.d.ts.map +1 -0
  238. package/.dist/script/output-command/gen-postman-env.js +55 -0
  239. package/.dist/script/output-command/gen-postman-env.js.map +1 -0
  240. package/.dist/tsconfig.tsbuildinfo +1 -0
  241. package/.prettierignore +10 -0
  242. package/.prettierrc.json +12 -0
  243. package/.turbo/turbo-build.log +5 -0
  244. package/.turbo/turbo-release.log +7 -0
  245. package/CHANGELOG.md +8 -0
  246. package/common/coordinator.ts +103 -0
  247. package/common/index.ts +5 -0
  248. package/common/modifier.ts +11 -0
  249. package/common/naming/get-deploy-config.ts +5 -0
  250. package/common/naming/get-domain.ts +14 -0
  251. package/common/naming/get-function-entry.ts +11 -0
  252. package/common/naming/get-logical-name.ts +3 -0
  253. package/common/naming/get-resource-name.ts +77 -0
  254. package/common/naming/get-service-name.ts +13 -0
  255. package/common/naming/index.ts +7 -0
  256. package/common/naming/string-parser.ts +17 -0
  257. package/common/service.ts +48 -0
  258. package/common/synth/account-mapping.ts +16 -0
  259. package/common/synth/assume-role.ts +39 -0
  260. package/common/synth/get-global-props.ts +46 -0
  261. package/common/synth/get-service-props.ts +16 -0
  262. package/common/synth/index.ts +7 -0
  263. package/common/synth/pre-script.ts +103 -0
  264. package/common/synth/props-types.ts +79 -0
  265. package/common/synth/synth-error.ts +13 -0
  266. package/index.ts +3 -0
  267. package/package.json +4 -5
  268. package/prefab/analytics/events/handlers/ingestion-transform/handler.ts +35 -0
  269. package/prefab/analytics/events/index.ts +192 -0
  270. package/prefab/analytics/index.ts +1 -0
  271. package/prefab/auth/cognito-pool/index.ts +263 -0
  272. package/prefab/auth/index.ts +1 -0
  273. package/prefab/cdn/cdn-api/index.ts +169 -0
  274. package/prefab/cdn/cdn-asset/index.ts +89 -0
  275. package/prefab/cdn/cdn-spa/index.ts +136 -0
  276. package/prefab/cdn/cdn-ssr/index.ts +288 -0
  277. package/prefab/cdn/index.ts +4 -0
  278. package/prefab/compute/fargate/cluster.ts +24 -0
  279. package/prefab/compute/fargate/index.ts +2 -0
  280. package/prefab/compute/fargate/service.ts +130 -0
  281. package/prefab/compute/function/api-function/api-aggregate.ts +73 -0
  282. package/prefab/compute/function/api-function/api-function.ts +63 -0
  283. package/prefab/compute/function/api-function/index.ts +2 -0
  284. package/prefab/compute/function/base-function/index.ts +102 -0
  285. package/prefab/compute/function/cognito-function/cognito-aggregate.ts +29 -0
  286. package/prefab/compute/function/cognito-function/cognito-function.ts +36 -0
  287. package/prefab/compute/function/cognito-function/index.ts +2 -0
  288. package/prefab/compute/function/cron-function/cron-aggregate.ts +28 -0
  289. package/prefab/compute/function/cron-function/cron-function.ts +32 -0
  290. package/prefab/compute/function/cron-function/index.ts +2 -0
  291. package/prefab/compute/function/event-function/EventAggregateParams.ts +9 -0
  292. package/prefab/compute/function/event-function/event-aggregate.ts +33 -0
  293. package/prefab/compute/function/event-function/event-function.ts +42 -0
  294. package/prefab/compute/function/event-function/index.ts +2 -0
  295. package/prefab/compute/function/index.ts +7 -0
  296. package/prefab/compute/function/queue-function/index.ts +67 -0
  297. package/prefab/compute/function/topic-function/index.ts +36 -0
  298. package/prefab/compute/index.ts +2 -0
  299. package/prefab/database/dynamo/index.ts +113 -0
  300. package/prefab/database/index.ts +3 -0
  301. package/prefab/database/rds/handlers/start-cluster/handler.ts +7 -0
  302. package/prefab/database/rds/handlers/stop-cluster/handler.ts +7 -0
  303. package/prefab/database/rds/index.ts +248 -0
  304. package/prefab/database/timestream/index.ts +2 -0
  305. package/prefab/database/timestream/timestream-database.ts +24 -0
  306. package/prefab/database/timestream/timestream-table.ts +76 -0
  307. package/prefab/gateway/alb-public/index.ts +124 -0
  308. package/prefab/gateway/api-gateway/api-http.ts +71 -0
  309. package/prefab/gateway/api-gateway/api-rest.ts +93 -0
  310. package/prefab/gateway/api-gateway/index.ts +2 -0
  311. package/prefab/gateway/app-sync/index.ts +117 -0
  312. package/prefab/gateway/app-sync/resolver-aggregate.ts +138 -0
  313. package/prefab/gateway/app-sync/types.ts +29 -0
  314. package/prefab/gateway/index.ts +3 -0
  315. package/prefab/index.ts +10 -0
  316. package/prefab/integration/event-bus/index.ts +52 -0
  317. package/prefab/integration/index.ts +3 -0
  318. package/prefab/integration/queue/index.ts +94 -0
  319. package/prefab/integration/topic/index.ts +57 -0
  320. package/prefab/networking/dns-domain-ref/index.ts +32 -0
  321. package/prefab/networking/dns-subdomain-certificate/index.ts +30 -0
  322. package/prefab/networking/dns-subdomain-hosted-zone/index.ts +30 -0
  323. package/prefab/networking/index.ts +5 -0
  324. package/prefab/networking/vpc/index.ts +39 -0
  325. package/prefab/networking/waf/index.ts +49 -0
  326. package/prefab/storage/bucket/asset-bucket.ts +24 -0
  327. package/prefab/storage/bucket/index.ts +2 -0
  328. package/prefab/storage/bucket/private-bucket.ts +74 -0
  329. package/prefab/storage/index.ts +1 -0
  330. package/prefab/utils/config/frontend-env-builder.ts +30 -0
  331. package/prefab/utils/config/index.ts +3 -0
  332. package/prefab/utils/config/parameter-secret.ts +52 -0
  333. package/prefab/utils/config/runtime-secret.ts +48 -0
  334. package/prefab/utils/deploy-pipeline/catalog/integrations/index.ts +1 -0
  335. package/prefab/utils/deploy-pipeline/catalog/integrations/slack.ts +23 -0
  336. package/prefab/utils/deploy-pipeline/entities/index.ts +23 -0
  337. package/prefab/utils/deploy-pipeline/handlers/send-to-slack/handler.ts +32 -0
  338. package/prefab/utils/deploy-pipeline/index.ts +172 -0
  339. package/prefab/utils/deploy-pipeline/platform/get-pipeline-detail.ts +31 -0
  340. package/prefab/utils/deploy-pipeline/platform/get-slack-payload.ts +38 -0
  341. package/prefab/utils/deploy-pipeline/platform/send-to-slack.ts +16 -0
  342. package/prefab/utils/duration.ts +1 -0
  343. package/prefab/utils/index.ts +4 -0
  344. package/prefab/utils/ses/index.ts +134 -0
  345. package/readme.md +78 -0
  346. package/script/config-command/bootstrap.ts +108 -0
  347. package/script/config-command/deploy-spa.ts +126 -0
  348. package/script/config-command/deploy.ts +50 -0
  349. package/script/config-command/destroy.ts +49 -0
  350. package/script/config-command/env-ssr.ts +85 -0
  351. package/script/config-command/invalidation-ssr.ts +88 -0
  352. package/script/config-command/rds-migration.ts +177 -0
  353. package/script/config-command/rds-sync.ts +108 -0
  354. package/script/config-command/ssm-connect.ts +129 -0
  355. package/script/config-command/start-spa.ts +93 -0
  356. package/script/config-command/start-ssr.ts +91 -0
  357. package/script/config-command/synth.ts +50 -0
  358. package/script/index.ts +86 -0
  359. package/script/output-command/create-user.ts +89 -0
  360. package/script/output-command/gen-postman-env.ts +75 -0
  361. package/tsconfig.json +26 -0
  362. package/common/coordinator.d.ts +0 -28
  363. package/common/index.d.ts +0 -6
  364. package/common/modifier.d.ts +0 -5
  365. package/common/naming/get-deploy-config.d.ts +0 -9
  366. package/common/naming/get-domain.d.ts +0 -9
  367. package/common/naming/get-function-entry.d.ts +0 -4
  368. package/common/naming/get-logical-name.d.ts +0 -2
  369. package/common/naming/get-resource-name.d.ts +0 -47
  370. package/common/naming/get-service-name.d.ts +0 -10
  371. package/common/naming/index.d.ts +0 -8
  372. package/common/naming/string-parser.d.ts +0 -4
  373. package/common/service.d.ts +0 -29
  374. package/common/synth/account-mapping.d.ts +0 -2
  375. package/common/synth/assume-role.d.ts +0 -18
  376. package/common/synth/get-global-props.d.ts +0 -16
  377. package/common/synth/get-service-props.d.ts +0 -11
  378. package/common/synth/index.d.ts +0 -8
  379. package/common/synth/pre-script.d.ts +0 -32
  380. package/common/synth/props-types.d.ts +0 -60
  381. package/common/synth/synth-error.d.ts +0 -8
  382. package/index.d.ts +0 -4
  383. package/prefab/analytics/events/handlers/ingestion-transform/handler.d.ts +0 -4
  384. package/prefab/analytics/events/index.d.ts +0 -31
  385. package/prefab/analytics/events/index.d.ts.map +0 -1
  386. package/prefab/analytics/events/index.js +0 -163
  387. package/prefab/analytics/events/index.js.map +0 -1
  388. package/prefab/analytics/index.d.ts +0 -2
  389. package/prefab/auth/cognito-pool/index.d.ts +0 -65
  390. package/prefab/auth/cognito-pool/index.d.ts.map +0 -1
  391. package/prefab/auth/cognito-pool/index.js.map +0 -1
  392. package/prefab/auth/index.d.ts +0 -2
  393. package/prefab/cdn/cdn-api/index.d.ts +0 -38
  394. package/prefab/cdn/cdn-api/index.d.ts.map +0 -1
  395. package/prefab/cdn/cdn-api/index.js +0 -153
  396. package/prefab/cdn/cdn-api/index.js.map +0 -1
  397. package/prefab/cdn/cdn-asset/index.d.ts +0 -27
  398. package/prefab/cdn/cdn-asset/index.d.ts.map +0 -1
  399. package/prefab/cdn/cdn-asset/index.js +0 -96
  400. package/prefab/cdn/cdn-asset/index.js.map +0 -1
  401. package/prefab/cdn/cdn-spa/index.d.ts +0 -27
  402. package/prefab/cdn/cdn-spa/index.d.ts.map +0 -1
  403. package/prefab/cdn/cdn-spa/index.js +0 -138
  404. package/prefab/cdn/cdn-spa/index.js.map +0 -1
  405. package/prefab/cdn/cdn-ssr/index.d.ts +0 -36
  406. package/prefab/cdn/cdn-ssr/index.d.ts.map +0 -1
  407. package/prefab/cdn/cdn-ssr/index.js +0 -271
  408. package/prefab/cdn/cdn-ssr/index.js.map +0 -1
  409. package/prefab/cdn/index.d.ts +0 -5
  410. package/prefab/compute/fargate/cluster.d.ts +0 -16
  411. package/prefab/compute/fargate/cluster.d.ts.map +0 -1
  412. package/prefab/compute/fargate/cluster.js.map +0 -1
  413. package/prefab/compute/fargate/index.d.ts +0 -3
  414. package/prefab/compute/fargate/service.d.ts +0 -49
  415. package/prefab/compute/fargate/service.d.ts.map +0 -1
  416. package/prefab/compute/fargate/service.js.map +0 -1
  417. package/prefab/compute/function/api-function/api-aggregate.d.ts +0 -32
  418. package/prefab/compute/function/api-function/api-aggregate.d.ts.map +0 -1
  419. package/prefab/compute/function/api-function/api-aggregate.js +0 -54
  420. package/prefab/compute/function/api-function/api-aggregate.js.map +0 -1
  421. package/prefab/compute/function/api-function/api-function.d.ts +0 -22
  422. package/prefab/compute/function/api-function/api-function.d.ts.map +0 -1
  423. package/prefab/compute/function/api-function/api-function.js +0 -45
  424. package/prefab/compute/function/api-function/api-function.js.map +0 -1
  425. package/prefab/compute/function/api-function/index.d.ts +0 -3
  426. package/prefab/compute/function/base-function/index.d.ts +0 -33
  427. package/prefab/compute/function/base-function/index.d.ts.map +0 -1
  428. package/prefab/compute/function/base-function/index.js +0 -70
  429. package/prefab/compute/function/base-function/index.js.map +0 -1
  430. package/prefab/compute/function/cognito-function/cognito-aggregate.d.ts +0 -18
  431. package/prefab/compute/function/cognito-function/cognito-aggregate.d.ts.map +0 -1
  432. package/prefab/compute/function/cognito-function/cognito-aggregate.js.map +0 -1
  433. package/prefab/compute/function/cognito-function/cognito-function.d.ts +0 -19
  434. package/prefab/compute/function/cognito-function/cognito-function.d.ts.map +0 -1
  435. package/prefab/compute/function/cognito-function/cognito-function.js.map +0 -1
  436. package/prefab/compute/function/cognito-function/index.d.ts +0 -3
  437. package/prefab/compute/function/cron-function/cron-aggregate.d.ts +0 -17
  438. package/prefab/compute/function/cron-function/cron-aggregate.d.ts.map +0 -1
  439. package/prefab/compute/function/cron-function/cron-aggregate.js.map +0 -1
  440. package/prefab/compute/function/cron-function/cron-function.d.ts +0 -17
  441. package/prefab/compute/function/cron-function/cron-function.d.ts.map +0 -1
  442. package/prefab/compute/function/cron-function/cron-function.js +0 -24
  443. package/prefab/compute/function/cron-function/cron-function.js.map +0 -1
  444. package/prefab/compute/function/cron-function/index.d.ts +0 -3
  445. package/prefab/compute/function/event-function/event-aggregate.d.ts +0 -20
  446. package/prefab/compute/function/event-function/event-aggregate.d.ts.map +0 -1
  447. package/prefab/compute/function/event-function/event-aggregate.js.map +0 -1
  448. package/prefab/compute/function/event-function/event-function.d.ts +0 -14
  449. package/prefab/compute/function/event-function/event-function.d.ts.map +0 -1
  450. package/prefab/compute/function/event-function/event-function.js.map +0 -1
  451. package/prefab/compute/function/event-function/index.d.ts +0 -3
  452. package/prefab/compute/function/index.d.ts +0 -8
  453. package/prefab/compute/function/queue-function/index.d.ts +0 -25
  454. package/prefab/compute/function/queue-function/index.d.ts.map +0 -1
  455. package/prefab/compute/function/queue-function/index.js +0 -46
  456. package/prefab/compute/function/queue-function/index.js.map +0 -1
  457. package/prefab/compute/function/topic-function/index.d.ts +0 -23
  458. package/prefab/compute/function/topic-function/index.d.ts.map +0 -1
  459. package/prefab/compute/function/topic-function/index.js +0 -23
  460. package/prefab/compute/function/topic-function/index.js.map +0 -1
  461. package/prefab/compute/index.d.ts +0 -3
  462. package/prefab/database/dynamo/index.d.ts +0 -14
  463. package/prefab/database/dynamo/index.d.ts.map +0 -1
  464. package/prefab/database/dynamo/index.js.map +0 -1
  465. package/prefab/database/index.d.ts +0 -4
  466. package/prefab/database/rds/handlers/start-cluster/handler.d.ts +0 -2
  467. package/prefab/database/rds/handlers/stop-cluster/handler.d.ts +0 -2
  468. package/prefab/database/rds/index.d.ts +0 -54
  469. package/prefab/database/rds/index.d.ts.map +0 -1
  470. package/prefab/database/rds/index.js +0 -223
  471. package/prefab/database/rds/index.js.map +0 -1
  472. package/prefab/database/timestream/index.d.ts +0 -3
  473. package/prefab/database/timestream/timestream-database.d.ts +0 -13
  474. package/prefab/database/timestream/timestream-database.d.ts.map +0 -1
  475. package/prefab/database/timestream/timestream-database.js.map +0 -1
  476. package/prefab/database/timestream/timestream-table.d.ts +0 -23
  477. package/prefab/database/timestream/timestream-table.d.ts.map +0 -1
  478. package/prefab/database/timestream/timestream-table.js.map +0 -1
  479. package/prefab/gateway/alb-public/index.d.ts +0 -44
  480. package/prefab/gateway/alb-public/index.d.ts.map +0 -1
  481. package/prefab/gateway/alb-public/index.js.map +0 -1
  482. package/prefab/gateway/api-gateway/api-http.d.ts +0 -27
  483. package/prefab/gateway/api-gateway/api-http.d.ts.map +0 -1
  484. package/prefab/gateway/api-gateway/api-http.js.map +0 -1
  485. package/prefab/gateway/api-gateway/api-rest.d.ts +0 -26
  486. package/prefab/gateway/api-gateway/api-rest.d.ts.map +0 -1
  487. package/prefab/gateway/api-gateway/api-rest.js.map +0 -1
  488. package/prefab/gateway/api-gateway/index.d.ts +0 -3
  489. package/prefab/gateway/app-sync/index.d.ts +0 -36
  490. package/prefab/gateway/app-sync/index.d.ts.map +0 -1
  491. package/prefab/gateway/app-sync/index.js.map +0 -1
  492. package/prefab/gateway/app-sync/resolver-aggregate.d.ts +0 -33
  493. package/prefab/gateway/app-sync/resolver-aggregate.d.ts.map +0 -1
  494. package/prefab/gateway/app-sync/resolver-aggregate.js.map +0 -1
  495. package/prefab/gateway/app-sync/types.d.ts +0 -29
  496. package/prefab/gateway/app-sync/types.d.ts.map +0 -1
  497. package/prefab/gateway/index.d.ts +0 -4
  498. package/prefab/index.d.ts +0 -11
  499. package/prefab/integration/event-bus/index.d.ts +0 -20
  500. package/prefab/integration/event-bus/index.d.ts.map +0 -1
  501. package/prefab/integration/event-bus/index.js.map +0 -1
  502. package/prefab/integration/index.d.ts +0 -4
  503. package/prefab/integration/queue/index.d.ts +0 -29
  504. package/prefab/integration/queue/index.d.ts.map +0 -1
  505. package/prefab/integration/queue/index.js.map +0 -1
  506. package/prefab/integration/topic/index.d.ts +0 -21
  507. package/prefab/integration/topic/index.d.ts.map +0 -1
  508. package/prefab/integration/topic/index.js.map +0 -1
  509. package/prefab/networking/dns-domain-ref/index.d.ts +0 -16
  510. package/prefab/networking/dns-domain-ref/index.d.ts.map +0 -1
  511. package/prefab/networking/dns-domain-ref/index.js.map +0 -1
  512. package/prefab/networking/dns-subdomain-certificate/index.d.ts +0 -13
  513. package/prefab/networking/dns-subdomain-certificate/index.d.ts.map +0 -1
  514. package/prefab/networking/dns-subdomain-certificate/index.js.map +0 -1
  515. package/prefab/networking/dns-subdomain-hosted-zone/index.d.ts +0 -12
  516. package/prefab/networking/dns-subdomain-hosted-zone/index.d.ts.map +0 -1
  517. package/prefab/networking/dns-subdomain-hosted-zone/index.js.map +0 -1
  518. package/prefab/networking/index.d.ts +0 -6
  519. package/prefab/networking/vpc/index.d.ts +0 -20
  520. package/prefab/networking/vpc/index.d.ts.map +0 -1
  521. package/prefab/networking/vpc/index.js.map +0 -1
  522. package/prefab/networking/waf/index.d.ts +0 -14
  523. package/prefab/networking/waf/index.d.ts.map +0 -1
  524. package/prefab/networking/waf/index.js.map +0 -1
  525. package/prefab/storage/bucket/asset-bucket.d.ts +0 -12
  526. package/prefab/storage/bucket/asset-bucket.d.ts.map +0 -1
  527. package/prefab/storage/bucket/index.d.ts +0 -3
  528. package/prefab/storage/bucket/private-bucket.d.ts +0 -26
  529. package/prefab/storage/bucket/private-bucket.d.ts.map +0 -1
  530. package/prefab/storage/bucket/private-bucket.js.map +0 -1
  531. package/prefab/storage/index.d.ts +0 -2
  532. package/prefab/utils/config/frontend-env-builder.d.ts +0 -14
  533. package/prefab/utils/config/frontend-env-builder.d.ts.map +0 -1
  534. package/prefab/utils/config/frontend-env-builder.js.map +0 -1
  535. package/prefab/utils/config/index.d.ts +0 -4
  536. package/prefab/utils/config/parameter-secret.d.ts +0 -21
  537. package/prefab/utils/config/parameter-secret.d.ts.map +0 -1
  538. package/prefab/utils/config/parameter-secret.js.map +0 -1
  539. package/prefab/utils/config/runtime-secret.d.ts.map +0 -1
  540. package/prefab/utils/config/runtime-secret.js.map +0 -1
  541. package/prefab/utils/deploy-pipeline/catalog/integrations/index.d.ts +0 -2
  542. package/prefab/utils/deploy-pipeline/entities/index.d.ts +0 -29
  543. package/prefab/utils/deploy-pipeline/index.d.ts +0 -15
  544. package/prefab/utils/deploy-pipeline/index.d.ts.map +0 -1
  545. package/prefab/utils/deploy-pipeline/index.js.map +0 -1
  546. package/prefab/utils/deploy-pipeline/platform/get-pipeline-detail.d.ts +0 -6
  547. package/prefab/utils/deploy-pipeline/platform/get-slack-payload.d.ts +0 -4
  548. package/prefab/utils/duration.d.ts +0 -2
  549. package/prefab/utils/index.d.ts +0 -5
  550. package/prefab/utils/ses/index.d.ts +0 -22
  551. package/prefab/utils/ses/index.d.ts.map +0 -1
  552. package/prefab/utils/ses/index.js.map +0 -1
  553. package/script/config-command/bootstrap.d.ts +0 -4
  554. package/script/config-command/bootstrap.js +0 -66
  555. package/script/config-command/bootstrap.js.map +0 -1
  556. package/script/config-command/deploy-spa.d.ts +0 -4
  557. package/script/config-command/deploy-spa.d.ts.map +0 -1
  558. package/script/config-command/deploy-spa.js +0 -84
  559. package/script/config-command/deploy-spa.js.map +0 -1
  560. package/script/config-command/deploy.d.ts +0 -4
  561. package/script/config-command/deploy.js +0 -26
  562. package/script/config-command/deploy.js.map +0 -1
  563. package/script/config-command/destroy.d.ts +0 -4
  564. package/script/config-command/destroy.js +0 -26
  565. package/script/config-command/destroy.js.map +0 -1
  566. package/script/config-command/env-ssr.d.ts +0 -4
  567. package/script/config-command/env-ssr.js +0 -51
  568. package/script/config-command/env-ssr.js.map +0 -1
  569. package/script/config-command/invalidation-ssr.d.ts +0 -4
  570. package/script/config-command/invalidation-ssr.js +0 -55
  571. package/script/config-command/invalidation-ssr.js.map +0 -1
  572. package/script/config-command/rds-migration.d.ts +0 -7
  573. package/script/config-command/rds-migration.js.map +0 -1
  574. package/script/config-command/rds-sync.d.ts +0 -4
  575. package/script/config-command/rds-sync.js.map +0 -1
  576. package/script/config-command/ssm-connect.d.ts +0 -4
  577. package/script/config-command/ssm-connect.js.map +0 -1
  578. package/script/config-command/start-spa.d.ts +0 -4
  579. package/script/config-command/start-spa.js +0 -55
  580. package/script/config-command/start-spa.js.map +0 -1
  581. package/script/config-command/start-ssr.d.ts +0 -4
  582. package/script/config-command/start-ssr.js +0 -55
  583. package/script/config-command/start-ssr.js.map +0 -1
  584. package/script/config-command/synth.d.ts +0 -4
  585. package/script/config-command/synth.js +0 -26
  586. package/script/config-command/synth.js.map +0 -1
  587. package/script/index.d.ts +0 -25
  588. package/script/index.d.ts.map +0 -1
  589. package/script/output-command/create-user.d.ts +0 -9
  590. package/script/output-command/create-user.d.ts.map +0 -1
  591. package/script/output-command/create-user.js.map +0 -1
  592. package/script/output-command/gen-postman-env.d.ts +0 -28
  593. package/script/output-command/gen-postman-env.d.ts.map +0 -1
  594. package/script/output-command/gen-postman-env.js +0 -56
  595. package/script/output-command/gen-postman-env.js.map +0 -1
  596. package/tsconfig.tsbuildinfo +0 -1
  597. /package/{common → .dist/common}/coordinator.d.ts.map +0 -0
  598. /package/{common → .dist/common}/coordinator.js +0 -0
  599. /package/{common → .dist/common}/coordinator.js.map +0 -0
  600. /package/{common → .dist/common}/index.d.ts.map +0 -0
  601. /package/{common → .dist/common}/index.js +0 -0
  602. /package/{common → .dist/common}/index.js.map +0 -0
  603. /package/{common → .dist/common}/modifier.d.ts.map +0 -0
  604. /package/{common → .dist/common}/modifier.js +0 -0
  605. /package/{common → .dist/common}/modifier.js.map +0 -0
  606. /package/{common → .dist/common}/naming/get-deploy-config.d.ts.map +0 -0
  607. /package/{common → .dist/common}/naming/get-deploy-config.js +0 -0
  608. /package/{common → .dist/common}/naming/get-deploy-config.js.map +0 -0
  609. /package/{common → .dist/common}/naming/get-domain.d.ts.map +0 -0
  610. /package/{common → .dist/common}/naming/get-domain.js +0 -0
  611. /package/{common → .dist/common}/naming/get-domain.js.map +0 -0
  612. /package/{common → .dist/common}/naming/get-function-entry.d.ts.map +0 -0
  613. /package/{common → .dist/common}/naming/get-function-entry.js +0 -0
  614. /package/{common → .dist/common}/naming/get-function-entry.js.map +0 -0
  615. /package/{common → .dist/common}/naming/get-logical-name.d.ts.map +0 -0
  616. /package/{common → .dist/common}/naming/get-logical-name.js +0 -0
  617. /package/{common → .dist/common}/naming/get-logical-name.js.map +0 -0
  618. /package/{common → .dist/common}/naming/get-resource-name.d.ts.map +0 -0
  619. /package/{common → .dist/common}/naming/get-resource-name.js +0 -0
  620. /package/{common → .dist/common}/naming/get-resource-name.js.map +0 -0
  621. /package/{common → .dist/common}/naming/get-service-name.d.ts.map +0 -0
  622. /package/{common → .dist/common}/naming/get-service-name.js +0 -0
  623. /package/{common → .dist/common}/naming/get-service-name.js.map +0 -0
  624. /package/{common → .dist/common}/naming/index.d.ts.map +0 -0
  625. /package/{common → .dist/common}/naming/index.js +0 -0
  626. /package/{common → .dist/common}/naming/index.js.map +0 -0
  627. /package/{common → .dist/common}/naming/string-parser.d.ts.map +0 -0
  628. /package/{common → .dist/common}/naming/string-parser.js +0 -0
  629. /package/{common → .dist/common}/naming/string-parser.js.map +0 -0
  630. /package/{common → .dist/common}/service.d.ts.map +0 -0
  631. /package/{common → .dist/common}/service.js +0 -0
  632. /package/{common → .dist/common}/service.js.map +0 -0
  633. /package/{common → .dist/common}/synth/account-mapping.d.ts.map +0 -0
  634. /package/{common → .dist/common}/synth/account-mapping.js +0 -0
  635. /package/{common → .dist/common}/synth/account-mapping.js.map +0 -0
  636. /package/{common → .dist/common}/synth/assume-role.d.ts.map +0 -0
  637. /package/{common → .dist/common}/synth/assume-role.js +0 -0
  638. /package/{common → .dist/common}/synth/assume-role.js.map +0 -0
  639. /package/{common → .dist/common}/synth/get-global-props.d.ts.map +0 -0
  640. /package/{common → .dist/common}/synth/get-global-props.js +0 -0
  641. /package/{common → .dist/common}/synth/get-global-props.js.map +0 -0
  642. /package/{common → .dist/common}/synth/get-service-props.d.ts.map +0 -0
  643. /package/{common → .dist/common}/synth/get-service-props.js +0 -0
  644. /package/{common → .dist/common}/synth/get-service-props.js.map +0 -0
  645. /package/{common → .dist/common}/synth/index.d.ts.map +0 -0
  646. /package/{common → .dist/common}/synth/index.js +0 -0
  647. /package/{common → .dist/common}/synth/index.js.map +0 -0
  648. /package/{common → .dist/common}/synth/pre-script.d.ts.map +0 -0
  649. /package/{common → .dist/common}/synth/pre-script.js +0 -0
  650. /package/{common → .dist/common}/synth/pre-script.js.map +0 -0
  651. /package/{common → .dist/common}/synth/props-types.d.ts.map +0 -0
  652. /package/{common → .dist/common}/synth/props-types.js +0 -0
  653. /package/{common → .dist/common}/synth/props-types.js.map +0 -0
  654. /package/{common → .dist/common}/synth/synth-error.d.ts.map +0 -0
  655. /package/{common → .dist/common}/synth/synth-error.js +0 -0
  656. /package/{common → .dist/common}/synth/synth-error.js.map +0 -0
  657. /package/{index.d.ts.map → .dist/index.d.ts.map} +0 -0
  658. /package/{index.js → .dist/index.js} +0 -0
  659. /package/{index.js.map → .dist/index.js.map} +0 -0
  660. /package/{prefab → .dist/prefab}/analytics/events/handlers/ingestion-transform/handler.d.ts.map +0 -0
  661. /package/{prefab → .dist/prefab}/analytics/events/handlers/ingestion-transform/handler.js +0 -0
  662. /package/{prefab → .dist/prefab}/analytics/events/handlers/ingestion-transform/handler.js.map +0 -0
  663. /package/{prefab → .dist/prefab}/analytics/index.d.ts.map +0 -0
  664. /package/{prefab → .dist/prefab}/analytics/index.js +0 -0
  665. /package/{prefab → .dist/prefab}/analytics/index.js.map +0 -0
  666. /package/{prefab → .dist/prefab}/auth/cognito-pool/index.js +0 -0
  667. /package/{prefab → .dist/prefab}/auth/index.d.ts.map +0 -0
  668. /package/{prefab → .dist/prefab}/auth/index.js +0 -0
  669. /package/{prefab → .dist/prefab}/auth/index.js.map +0 -0
  670. /package/{prefab → .dist/prefab}/cdn/index.d.ts.map +0 -0
  671. /package/{prefab → .dist/prefab}/cdn/index.js +0 -0
  672. /package/{prefab → .dist/prefab}/cdn/index.js.map +0 -0
  673. /package/{prefab → .dist/prefab}/compute/fargate/cluster.js +0 -0
  674. /package/{prefab → .dist/prefab}/compute/fargate/index.d.ts.map +0 -0
  675. /package/{prefab → .dist/prefab}/compute/fargate/index.js +0 -0
  676. /package/{prefab → .dist/prefab}/compute/fargate/index.js.map +0 -0
  677. /package/{prefab → .dist/prefab}/compute/fargate/service.js +0 -0
  678. /package/{prefab → .dist/prefab}/compute/function/api-function/index.d.ts.map +0 -0
  679. /package/{prefab → .dist/prefab}/compute/function/api-function/index.js +0 -0
  680. /package/{prefab → .dist/prefab}/compute/function/api-function/index.js.map +0 -0
  681. /package/{prefab → .dist/prefab}/compute/function/cognito-function/cognito-aggregate.js +0 -0
  682. /package/{prefab → .dist/prefab}/compute/function/cognito-function/cognito-function.js +0 -0
  683. /package/{prefab → .dist/prefab}/compute/function/cognito-function/index.d.ts.map +0 -0
  684. /package/{prefab → .dist/prefab}/compute/function/cognito-function/index.js +0 -0
  685. /package/{prefab → .dist/prefab}/compute/function/cognito-function/index.js.map +0 -0
  686. /package/{prefab → .dist/prefab}/compute/function/cron-function/cron-aggregate.js +0 -0
  687. /package/{prefab → .dist/prefab}/compute/function/cron-function/index.d.ts.map +0 -0
  688. /package/{prefab → .dist/prefab}/compute/function/cron-function/index.js +0 -0
  689. /package/{prefab → .dist/prefab}/compute/function/cron-function/index.js.map +0 -0
  690. /package/{prefab → .dist/prefab}/compute/function/event-function/event-aggregate.js +0 -0
  691. /package/{prefab → .dist/prefab}/compute/function/event-function/event-function.js +0 -0
  692. /package/{prefab → .dist/prefab}/compute/function/event-function/index.d.ts.map +0 -0
  693. /package/{prefab → .dist/prefab}/compute/function/event-function/index.js +0 -0
  694. /package/{prefab → .dist/prefab}/compute/function/event-function/index.js.map +0 -0
  695. /package/{prefab → .dist/prefab}/compute/function/index.d.ts.map +0 -0
  696. /package/{prefab → .dist/prefab}/compute/function/index.js +0 -0
  697. /package/{prefab → .dist/prefab}/compute/function/index.js.map +0 -0
  698. /package/{prefab → .dist/prefab}/compute/index.d.ts.map +0 -0
  699. /package/{prefab → .dist/prefab}/compute/index.js +0 -0
  700. /package/{prefab → .dist/prefab}/compute/index.js.map +0 -0
  701. /package/{prefab → .dist/prefab}/database/dynamo/index.js +0 -0
  702. /package/{prefab → .dist/prefab}/database/index.d.ts.map +0 -0
  703. /package/{prefab → .dist/prefab}/database/index.js +0 -0
  704. /package/{prefab → .dist/prefab}/database/index.js.map +0 -0
  705. /package/{prefab → .dist/prefab}/database/rds/handlers/start-cluster/handler.d.ts.map +0 -0
  706. /package/{prefab → .dist/prefab}/database/rds/handlers/start-cluster/handler.js +0 -0
  707. /package/{prefab → .dist/prefab}/database/rds/handlers/start-cluster/handler.js.map +0 -0
  708. /package/{prefab → .dist/prefab}/database/rds/handlers/stop-cluster/handler.d.ts.map +0 -0
  709. /package/{prefab → .dist/prefab}/database/rds/handlers/stop-cluster/handler.js +0 -0
  710. /package/{prefab → .dist/prefab}/database/rds/handlers/stop-cluster/handler.js.map +0 -0
  711. /package/{prefab → .dist/prefab}/database/timestream/index.d.ts.map +0 -0
  712. /package/{prefab → .dist/prefab}/database/timestream/index.js +0 -0
  713. /package/{prefab → .dist/prefab}/database/timestream/index.js.map +0 -0
  714. /package/{prefab → .dist/prefab}/database/timestream/timestream-database.js +0 -0
  715. /package/{prefab → .dist/prefab}/database/timestream/timestream-table.js +0 -0
  716. /package/{prefab → .dist/prefab}/gateway/alb-public/index.js +0 -0
  717. /package/{prefab → .dist/prefab}/gateway/api-gateway/api-http.js +0 -0
  718. /package/{prefab → .dist/prefab}/gateway/api-gateway/api-rest.js +0 -0
  719. /package/{prefab → .dist/prefab}/gateway/api-gateway/index.d.ts.map +0 -0
  720. /package/{prefab → .dist/prefab}/gateway/api-gateway/index.js +0 -0
  721. /package/{prefab → .dist/prefab}/gateway/api-gateway/index.js.map +0 -0
  722. /package/{prefab → .dist/prefab}/gateway/app-sync/index.js +0 -0
  723. /package/{prefab → .dist/prefab}/gateway/app-sync/resolver-aggregate.js +0 -0
  724. /package/{prefab → .dist/prefab}/gateway/app-sync/types.js +0 -0
  725. /package/{prefab → .dist/prefab}/gateway/app-sync/types.js.map +0 -0
  726. /package/{prefab → .dist/prefab}/gateway/index.d.ts.map +0 -0
  727. /package/{prefab → .dist/prefab}/gateway/index.js +0 -0
  728. /package/{prefab → .dist/prefab}/gateway/index.js.map +0 -0
  729. /package/{prefab → .dist/prefab}/index.d.ts.map +0 -0
  730. /package/{prefab → .dist/prefab}/index.js +0 -0
  731. /package/{prefab → .dist/prefab}/index.js.map +0 -0
  732. /package/{prefab → .dist/prefab}/integration/event-bus/index.js +0 -0
  733. /package/{prefab → .dist/prefab}/integration/index.d.ts.map +0 -0
  734. /package/{prefab → .dist/prefab}/integration/index.js +0 -0
  735. /package/{prefab → .dist/prefab}/integration/index.js.map +0 -0
  736. /package/{prefab → .dist/prefab}/integration/queue/index.js +0 -0
  737. /package/{prefab → .dist/prefab}/integration/topic/index.js +0 -0
  738. /package/{prefab → .dist/prefab}/networking/dns-domain-ref/index.js +0 -0
  739. /package/{prefab → .dist/prefab}/networking/dns-subdomain-certificate/index.js +0 -0
  740. /package/{prefab → .dist/prefab}/networking/dns-subdomain-hosted-zone/index.js +0 -0
  741. /package/{prefab → .dist/prefab}/networking/index.d.ts.map +0 -0
  742. /package/{prefab → .dist/prefab}/networking/index.js +0 -0
  743. /package/{prefab → .dist/prefab}/networking/index.js.map +0 -0
  744. /package/{prefab → .dist/prefab}/networking/vpc/index.js +0 -0
  745. /package/{prefab → .dist/prefab}/networking/waf/index.js +0 -0
  746. /package/{prefab → .dist/prefab}/storage/bucket/asset-bucket.js +0 -0
  747. /package/{prefab → .dist/prefab}/storage/bucket/asset-bucket.js.map +0 -0
  748. /package/{prefab → .dist/prefab}/storage/bucket/index.d.ts.map +0 -0
  749. /package/{prefab → .dist/prefab}/storage/bucket/index.js +0 -0
  750. /package/{prefab → .dist/prefab}/storage/bucket/index.js.map +0 -0
  751. /package/{prefab → .dist/prefab}/storage/bucket/private-bucket.js +0 -0
  752. /package/{prefab → .dist/prefab}/storage/index.d.ts.map +0 -0
  753. /package/{prefab → .dist/prefab}/storage/index.js +0 -0
  754. /package/{prefab → .dist/prefab}/storage/index.js.map +0 -0
  755. /package/{prefab → .dist/prefab}/utils/config/frontend-env-builder.js +0 -0
  756. /package/{prefab → .dist/prefab}/utils/config/index.d.ts.map +0 -0
  757. /package/{prefab → .dist/prefab}/utils/config/index.js +0 -0
  758. /package/{prefab → .dist/prefab}/utils/config/index.js.map +0 -0
  759. /package/{prefab → .dist/prefab}/utils/config/parameter-secret.js +0 -0
  760. /package/{prefab → .dist/prefab}/utils/config/runtime-secret.d.ts +0 -0
  761. /package/{prefab → .dist/prefab}/utils/config/runtime-secret.js +0 -0
  762. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/catalog/integrations/index.d.ts.map +0 -0
  763. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/catalog/integrations/index.js +0 -0
  764. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/catalog/integrations/index.js.map +0 -0
  765. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/catalog/integrations/slack.d.ts +0 -0
  766. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/catalog/integrations/slack.d.ts.map +0 -0
  767. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/catalog/integrations/slack.js +0 -0
  768. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/catalog/integrations/slack.js.map +0 -0
  769. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/entities/index.d.ts.map +0 -0
  770. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/entities/index.js +0 -0
  771. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/entities/index.js.map +0 -0
  772. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/handlers/send-to-slack/handler.d.ts +0 -0
  773. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/handlers/send-to-slack/handler.d.ts.map +0 -0
  774. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/handlers/send-to-slack/handler.js +0 -0
  775. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/handlers/send-to-slack/handler.js.map +0 -0
  776. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/index.js +0 -0
  777. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/get-pipeline-detail.d.ts.map +0 -0
  778. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/get-pipeline-detail.js +0 -0
  779. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/get-pipeline-detail.js.map +0 -0
  780. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/get-slack-payload.d.ts.map +0 -0
  781. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/get-slack-payload.js +0 -0
  782. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/get-slack-payload.js.map +0 -0
  783. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/send-to-slack.d.ts +0 -0
  784. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/send-to-slack.d.ts.map +0 -0
  785. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/send-to-slack.js +0 -0
  786. /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/send-to-slack.js.map +0 -0
  787. /package/{prefab → .dist/prefab}/utils/duration.d.ts.map +0 -0
  788. /package/{prefab → .dist/prefab}/utils/duration.js +0 -0
  789. /package/{prefab → .dist/prefab}/utils/duration.js.map +0 -0
  790. /package/{prefab → .dist/prefab}/utils/index.d.ts.map +0 -0
  791. /package/{prefab → .dist/prefab}/utils/index.js +0 -0
  792. /package/{prefab → .dist/prefab}/utils/index.js.map +0 -0
  793. /package/{prefab → .dist/prefab}/utils/ses/index.js +0 -0
  794. /package/{script → .dist/script}/config-command/bootstrap.d.ts.map +0 -0
  795. /package/{script → .dist/script}/config-command/deploy.d.ts.map +0 -0
  796. /package/{script → .dist/script}/config-command/destroy.d.ts.map +0 -0
  797. /package/{script → .dist/script}/config-command/env-ssr.d.ts.map +0 -0
  798. /package/{script → .dist/script}/config-command/invalidation-ssr.d.ts.map +0 -0
  799. /package/{script → .dist/script}/config-command/rds-migration.d.ts.map +0 -0
  800. /package/{script → .dist/script}/config-command/rds-migration.js +0 -0
  801. /package/{script → .dist/script}/config-command/rds-sync.d.ts.map +0 -0
  802. /package/{script → .dist/script}/config-command/rds-sync.js +0 -0
  803. /package/{script → .dist/script}/config-command/ssm-connect.d.ts.map +0 -0
  804. /package/{script → .dist/script}/config-command/ssm-connect.js +0 -0
  805. /package/{script → .dist/script}/config-command/start-spa.d.ts.map +0 -0
  806. /package/{script → .dist/script}/config-command/start-ssr.d.ts.map +0 -0
  807. /package/{script → .dist/script}/config-command/synth.d.ts.map +0 -0
  808. /package/{script → .dist/script}/index.js +0 -0
  809. /package/{script → .dist/script}/index.js.map +0 -0
  810. /package/{script → .dist/script}/output-command/create-user.js +0 -0
@@ -0,0 +1,24 @@
1
+ import * as awsECS from 'aws-cdk-lib/aws-ecs';
2
+ import { Construct } from 'constructs';
3
+
4
+ import { VpcPrefab } from '../../..';
5
+ import { ServiceStack, getLogicalName, getResourceName } from '../../../common';
6
+
7
+ export type FargateClusterPrefabParams = {
8
+ name: string;
9
+ vpcPrefab: VpcPrefab;
10
+ };
11
+
12
+ export class FargateClusterPrefab extends Construct {
13
+ public readonly cluster: awsECS.Cluster;
14
+
15
+ constructor(service: ServiceStack, params: FargateClusterPrefabParams) {
16
+ super(service, getLogicalName(params.name, FargateClusterPrefab.name));
17
+
18
+ this.cluster = new awsECS.Cluster(this, getLogicalName(params.name, 'cluster'), {
19
+ containerInsights: true,
20
+ clusterName: getResourceName('cluster', { ...service.props, serviceName: params.name }),
21
+ vpc: params.vpcPrefab.vpc,
22
+ });
23
+ }
24
+ }
@@ -0,0 +1,2 @@
1
+ export * from './cluster';
2
+ export * from './service';
@@ -0,0 +1,130 @@
1
+ import * as awsECS from 'aws-cdk-lib/aws-ecs';
2
+ import * as awsALB from 'aws-cdk-lib/aws-elasticloadbalancingv2';
3
+ import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
4
+ import { IRepository, Repository } from 'aws-cdk-lib/aws-ecr';
5
+ import { FargatePlatformVersion, HealthCheck, Secret } from 'aws-cdk-lib/aws-ecs';
6
+ import { Effect, PolicyStatement } from 'aws-cdk-lib/aws-iam';
7
+ import { LogGroup } from 'aws-cdk-lib/aws-logs';
8
+ import { Construct } from 'constructs';
9
+
10
+ import { ServiceStack, SynthError, getLogicalName, getResourceName } from '../../../common';
11
+ import { PublicAlbPrefab } from '../../gateway';
12
+ import { VpcPrefab } from '../../networking';
13
+ import { FargateClusterPrefab } from './cluster';
14
+
15
+ export type FargateContainerHealthCheck = HealthCheck;
16
+
17
+ export type FargatePerformanceTunning = {
18
+ taskCpu: string;
19
+ taskMemory: string;
20
+ containerDesiredCount: number;
21
+ taskAutoScaleMin: number;
22
+ taskAutoScaleMax: number;
23
+ taskAutoScalePercent: number;
24
+ containerMaxMemory: number;
25
+ };
26
+
27
+ export type FargateServicePrefabParams = {
28
+ name: string;
29
+ fargateClusterPrefab: FargateClusterPrefab;
30
+ vpcPrefab: VpcPrefab;
31
+ albPrefab: PublicAlbPrefab;
32
+ mappingPort: number;
33
+ basePath: string;
34
+ fixedPriority?: number;
35
+ healthCheckPath: string;
36
+ certificate: ICertificate;
37
+ containerHealthCheck?: FargateContainerHealthCheck;
38
+ containerEnv?: Record<string, string>;
39
+ containerSecrets?: Record<string, Secret>;
40
+ dockerBuildFolder?: string;
41
+ externalRepository?: {
42
+ repositoryName: string;
43
+ tag?: string;
44
+ };
45
+ performanceTunning: FargatePerformanceTunning;
46
+ };
47
+
48
+ export class FargateServicePrefab extends Construct {
49
+ public readonly repository!: IRepository;
50
+ public readonly targetGroup!: awsALB.ApplicationTargetGroup;
51
+
52
+ constructor(service: ServiceStack, params: FargateServicePrefabParams) {
53
+ super(service, getLogicalName(params.name, FargateServicePrefab.name));
54
+
55
+ if (!params.dockerBuildFolder && !params.externalRepository) throw new SynthError('dockerBuildFolder or externalRepository should exist');
56
+
57
+ if (params.externalRepository) {
58
+ this.repository = Repository.fromRepositoryName(this, getLogicalName(params.name, 'repo'), params.externalRepository.repositoryName);
59
+ }
60
+
61
+ // CONTAINER TASK DEFINITION
62
+ const taskDefinition = new awsECS.TaskDefinition(this, getLogicalName(params.name, 'taskDefinition'), {
63
+ family: getResourceName('task-definition', { ...service.props, serviceName: params.name }),
64
+ compatibility: awsECS.Compatibility.FARGATE,
65
+ networkMode: awsECS.NetworkMode.AWS_VPC,
66
+ cpu: params.performanceTunning.taskCpu || '256',
67
+ memoryMiB: params.performanceTunning.taskMemory || '512',
68
+ });
69
+
70
+ taskDefinition.addContainer(getLogicalName(params.name, 'container'), {
71
+ containerName: params.name,
72
+ image: params.dockerBuildFolder
73
+ ? awsECS.ContainerImage.fromAsset(params.dockerBuildFolder)
74
+ : awsECS.ContainerImage.fromEcrRepository(this.repository, params.externalRepository?.tag || 'latest'),
75
+ // memoryLimitMiB: params.performanceTunning.containerMaxMemory,
76
+ secrets: params.containerSecrets,
77
+ healthCheck: params.containerHealthCheck,
78
+ environment: { BASE_PATH: params.basePath, ...params.containerEnv },
79
+ logging: awsECS.LogDriver.awsLogs({
80
+ streamPrefix: params.name,
81
+ logGroup: new LogGroup(this, getLogicalName(params.name, 'logGroup'), {
82
+ logGroupName: getResourceName('', service.props),
83
+ }),
84
+ }),
85
+ portMappings: [{ containerPort: params.mappingPort }],
86
+ });
87
+
88
+ taskDefinition.addToTaskRolePolicy(
89
+ new PolicyStatement({
90
+ effect: Effect.ALLOW,
91
+ actions: [
92
+ 'ssmmessages:CreateControlChannel',
93
+ 'ssmmessages:CreateDataChannel',
94
+ 'ssmmessages:OpenControlChannel',
95
+ 'ssmmessages:OpenDataChannel',
96
+ ],
97
+ resources: ['*'],
98
+ })
99
+ );
100
+ if (params.externalRepository) this.repository.grantPull(taskDefinition.taskRole);
101
+
102
+ // FARGATE SERVICE
103
+ const fargateService = new awsECS.FargateService(this, getLogicalName(params.name, 'fargateService'), {
104
+ serviceName: getResourceName('service', { ...service.props, serviceName: params.name }),
105
+ platformVersion: FargatePlatformVersion.LATEST,
106
+ cluster: params.fargateClusterPrefab.cluster,
107
+ desiredCount: params.performanceTunning.containerDesiredCount,
108
+ taskDefinition,
109
+ securityGroups: [params.albPrefab.getAlbToClusterSG()],
110
+ assignPublicIp: true,
111
+ circuitBreaker: { rollback: true },
112
+ capacityProviderStrategies: [{ capacityProvider: 'FARGATE' }],
113
+ });
114
+
115
+ // AUTOSCALING
116
+ const scalableTarget = fargateService.autoScaleTaskCount({
117
+ minCapacity: params.performanceTunning.taskAutoScaleMin,
118
+ maxCapacity: params.performanceTunning.taskAutoScaleMax,
119
+ });
120
+ scalableTarget.scaleOnMemoryUtilization(getLogicalName(params.name, 'ScaleUpMem'), {
121
+ targetUtilizationPercent: params.performanceTunning.taskAutoScalePercent,
122
+ });
123
+ scalableTarget.scaleOnCpuUtilization(getLogicalName(params.name, 'ScaleUpCPU'), {
124
+ targetUtilizationPercent: params.performanceTunning.taskAutoScalePercent,
125
+ });
126
+
127
+ // CONNECT TO ALB
128
+ params.albPrefab.appendTargetGroup({ ...params, fargateService });
129
+ }
130
+ }
@@ -0,0 +1,73 @@
1
+ import { UserPool, UserPoolClient } from 'aws-cdk-lib/aws-cognito';
2
+ import { IFunction } from 'aws-cdk-lib/aws-lambda';
3
+ import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';
4
+ import { Construct } from 'constructs';
5
+
6
+ import { TableStoreBuilder } from '@takumi-stack/sdk';
7
+
8
+ import { ServiceStack, getLogicalName, SynthError } from '../../../../common';
9
+ import { CdnApiPrefab } from '../../../cdn';
10
+ import { DynamoTablePrefab } from '../../../database';
11
+ import { ApiRestPrefab, ApiHttpPrefab } from '../../../gateway';
12
+ import { BaseAggregateParams } from '../base-function';
13
+ import { ApiHandlerParams, ApiFunction } from './api-function';
14
+
15
+ export type ApiAuthPoolParams = {
16
+ userPool?: UserPool;
17
+ userPoolClient?: UserPoolClient;
18
+ };
19
+
20
+ export type ApiAggregateParams<HandlerName extends string = string> = BaseAggregateParams & {
21
+ basePath: string;
22
+ handlers: Record<HandlerName, ApiHandlerParams>;
23
+ cdnApiPrefab: CdnApiPrefab | undefined;
24
+ authPool?: ApiAuthPoolParams;
25
+ customAuthorizerHandler?: IFunction;
26
+ useRestApi?: true;
27
+ tableBuilder?: typeof TableStoreBuilder<any>;
28
+ };
29
+
30
+ export class ApiAggregate<HandlerName extends string = string> extends Construct {
31
+ public readonly apiPrefab: ApiRestPrefab | ApiHttpPrefab;
32
+ public readonly tablePrefab?: DynamoTablePrefab;
33
+ public readonly handlers: Record<HandlerName, NodejsFunction> = {} as Record<HandlerName, NodejsFunction>;
34
+
35
+ constructor(service: ServiceStack, params: ApiAggregateParams) {
36
+ super(service, getLogicalName('ApiAggregate'));
37
+
38
+ if (params.useRestApi) {
39
+ this.apiPrefab = new ApiRestPrefab(service, {
40
+ ...params,
41
+ ...params.authPool,
42
+ customAuthorizerHandler: params.customAuthorizerHandler,
43
+ });
44
+ } else {
45
+ this.apiPrefab = new ApiHttpPrefab(service, {
46
+ ...params,
47
+ ...params.authPool,
48
+ customAuthorizerHandler: params.customAuthorizerHandler,
49
+ });
50
+ }
51
+
52
+ if (params.tableBuilder && params.tablePrefab)
53
+ throw new SynthError('Invalid params: tableBuilder and tablePrefab are mutually exclusive', service.props);
54
+ if (params.tablePrefab) this.tablePrefab = params.tablePrefab;
55
+ if (params.tableBuilder) this.tablePrefab = new DynamoTablePrefab(service, params.tableBuilder);
56
+
57
+ Object.keys(params.handlers).forEach((handler: string) => {
58
+ if (params.basePath !== params.handlers[handler]!.basePath)
59
+ throw new SynthError(`[ApiService] Invalid basePath: '${params.handlers[handler]!.basePath}' in '${handler}' function.`, service.props);
60
+ this.handlers[handler as HandlerName] = new ApiFunction(service, {
61
+ ...params,
62
+ ...params.handlers[handler]!,
63
+ tablePrefab: this.tablePrefab,
64
+ apiPrefab: this.apiPrefab,
65
+ modifiers: [...(params.modifiers || []), ...(params.handlers[handler]!.modifiers || [])],
66
+ environment: {
67
+ ...params.environment,
68
+ ...params.handlers[handler]!.environment,
69
+ },
70
+ }).lambdaFunction;
71
+ });
72
+ }
73
+ }
@@ -0,0 +1,63 @@
1
+ import { Duration } from 'aws-cdk-lib';
2
+ import { LambdaIntegration } from 'aws-cdk-lib/aws-apigateway';
3
+ import { HttpLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
4
+ import { HttpMethod } from 'aws-cdk-lib/aws-events';
5
+ import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';
6
+ import { Construct } from 'constructs';
7
+
8
+ import { ApiDefinition, ApiInterface } from '@takumi-stack/sdk';
9
+
10
+ import { ServiceStack, getLogicalName, SynthError } from '../../../../common';
11
+ import { ApiRestPrefab, ApiHttpPrefab } from '../../../gateway';
12
+ import { BaseAggregateParams } from '../base-function';
13
+ import { BaseFunction, BaseHandlerParams } from '../base-function';
14
+
15
+ export type ApiHandlerParams = BaseHandlerParams & {
16
+ basePath: ApiDefinition<ApiInterface>['basePath'];
17
+ path: ApiDefinition<ApiInterface>['path'];
18
+ method: ApiDefinition<ApiInterface>['method'];
19
+ isPublic?: ApiDefinition<ApiInterface>['isPublic'];
20
+ cacheMaxAge?: number;
21
+ };
22
+
23
+ export type ApiFunctionParams = BaseAggregateParams & {
24
+ apiPrefab: ApiRestPrefab | ApiHttpPrefab;
25
+ };
26
+
27
+ export class ApiFunction extends Construct {
28
+ public readonly lambdaFunction: NodejsFunction;
29
+
30
+ constructor(service: ServiceStack, params: ApiHandlerParams & ApiFunctionParams) {
31
+ super(service, getLogicalName(ApiFunction.name, params.name));
32
+
33
+ const baseFunction = new BaseFunction(service, {
34
+ ...params,
35
+ environment: { ...params.environment, CC_FUNCTION_TYPE: 'API' },
36
+ });
37
+
38
+ this.lambdaFunction = baseFunction.lambdaFunction;
39
+ this.lambdaFunction.addEnvironment('CC_CACHE_MAX_AGE', params.cacheMaxAge?.toString() || '10');
40
+
41
+ if (this.lambdaFunction.timeout && this.lambdaFunction.timeout.toSeconds() > Duration.seconds(28).toSeconds()) {
42
+ throw new SynthError('Lambda timeout must be less than 28 seconds in ApiFunctions', service.props);
43
+ }
44
+
45
+ if (params.apiPrefab instanceof ApiHttpPrefab) {
46
+ const path = params.path === '/' ? '' : params.path;
47
+ params.apiPrefab.api.addRoutes({
48
+ path: `/${params.basePath}${path}`,
49
+ methods: [params.method as HttpMethod],
50
+ integration: new HttpLambdaIntegration(ApiFunction.name, baseFunction.aliasFunction),
51
+ ...(params.isPublic ? {} : { authorizer: params.apiPrefab.authorizer }),
52
+ });
53
+ }
54
+ if (params.apiPrefab instanceof ApiRestPrefab) {
55
+ params.apiPrefab.api.root
56
+ .resourceForPath(`${params.basePath}${params.path}`)
57
+ .addMethod(params.method, new LambdaIntegration(baseFunction.aliasFunction), {
58
+ operationName: this.lambdaFunction.functionName,
59
+ ...(params.isPublic ? {} : { authorizer: params.apiPrefab.authorizer }),
60
+ });
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,2 @@
1
+ export * from './api-aggregate';
2
+ export * from './api-function';
@@ -0,0 +1,102 @@
1
+ import { Duration } from 'aws-cdk-lib';
2
+ import { PolicyStatement, Role, ServicePrincipal } from 'aws-cdk-lib/aws-iam';
3
+ import { Alias, Architecture, Runtime, Tracing, Version } from 'aws-cdk-lib/aws-lambda';
4
+ import { NodejsFunction, NodejsFunctionProps } from 'aws-cdk-lib/aws-lambda-nodejs';
5
+ import { Construct } from 'constructs';
6
+
7
+ import { ApiDefinition, ApiInterface, TablePermission } from '@takumi-stack/sdk';
8
+
9
+ import { Modifier, ServiceStack, getFunctionEntry, getLogicalName, getShortResourceName } from '../../../../common';
10
+ import { DynamoTablePrefab } from '../../../database';
11
+ import { EventBusPrefab } from '../../../integration';
12
+
13
+ export const FUNCTION_DEFAULT_TIMEOUT = 6;
14
+
15
+ export type BaseHandlerParams = NodejsFunctionProps & {
16
+ name: ApiDefinition<ApiInterface>['name'];
17
+ modifiers?: Modifier[];
18
+ environment?: Record<string, string>;
19
+ architecture?: Architecture;
20
+ tablePermission?: TablePermission;
21
+ provisionedConcurrentExecutions?: number;
22
+ };
23
+
24
+ export type BaseAggregateParams = {
25
+ baseFunctionFolder?: string;
26
+ baseFunctionString?: string;
27
+ globalConfigs?: NodejsFunctionProps;
28
+ eventBus?: EventBusPrefab;
29
+ tablePrefab?: DynamoTablePrefab;
30
+ modifiers?: Modifier[];
31
+ environment?: Record<string, string>;
32
+ compiled?: true;
33
+ tracingDisabled?: true;
34
+ };
35
+
36
+ export class BaseFunction extends Construct {
37
+ public readonly lambdaFunction: NodejsFunction;
38
+ public readonly aliasFunction: Alias;
39
+
40
+ constructor(service: ServiceStack, params: BaseHandlerParams & BaseAggregateParams) {
41
+ super(service, getLogicalName(BaseFunction.name, params.name));
42
+
43
+ const role = new Role(this, getLogicalName('role', params.name), {
44
+ assumedBy: new ServicePrincipal('lambda.amazonaws.com'),
45
+ roleName: getShortResourceName(params.name, service.props),
46
+ });
47
+ role.addManagedPolicy({ managedPolicyArn: 'arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole' });
48
+
49
+ const ccEnv = service.props.ephemeralEnvName ? `${service.props.ephemeralEnvName}-${service.props.envName}` : service.props.envName;
50
+
51
+ this.lambdaFunction = new NodejsFunction(this, params.name, {
52
+ runtime: Runtime.NODEJS_18_X,
53
+ logRetention: 30,
54
+ handler: 'handler',
55
+ role,
56
+ tracing: params.tracingDisabled ? Tracing.DISABLED : Tracing.ACTIVE,
57
+ timeout: Duration.seconds(FUNCTION_DEFAULT_TIMEOUT),
58
+ functionName: getShortResourceName(params.name, service.props),
59
+ entry: params.baseFunctionString || getFunctionEntry(params.baseFunctionFolder!, params.name, params.compiled),
60
+ architecture: params.architecture || Architecture.ARM_64,
61
+ ...params.globalConfigs,
62
+ ...params,
63
+ environment: {
64
+ CC_SERVICE: service.props.serviceName,
65
+ CC_ENV: ccEnv,
66
+ CC_LOG_LEVEL: 'error',
67
+ ...params.environment,
68
+ },
69
+ });
70
+
71
+ const version = Version.fromVersionArn(this, 'LambdaVersion', this.lambdaFunction.currentVersion.functionArn);
72
+
73
+ this.aliasFunction = new Alias(this, 'LambdaAlias', {
74
+ aliasName: service.props.envName,
75
+ version,
76
+ provisionedConcurrentExecutions: params.provisionedConcurrentExecutions || 0,
77
+ });
78
+
79
+ this.lambdaFunction.addEnvironment('CC_FUNCTION_TIMEOUT', this.lambdaFunction.timeout!.toSeconds().toString());
80
+ if (!params.tracingDisabled) this.lambdaFunction.addEnvironment('CC_TRACING', 'true');
81
+
82
+ if (this.lambdaFunction.isBoundToVpc) {
83
+ role.addToPolicy(
84
+ new PolicyStatement({
85
+ actions: [
86
+ 'ec2:DescribeNetworkInterfaces',
87
+ 'ec2:CreateNetworkInterface',
88
+ 'ec2:DeleteNetworkInterface',
89
+ 'ec2:DescribeInstances',
90
+ 'ec2:AttachNetworkInterface',
91
+ ],
92
+ resources: ['*'],
93
+ })
94
+ );
95
+ }
96
+
97
+ params.modifiers?.map((fn) => fn(this.lambdaFunction));
98
+
99
+ DynamoTablePrefab.addTable(this.lambdaFunction, params.tablePrefab, params.tablePermission);
100
+ EventBusPrefab.addBus(this.lambdaFunction, params.eventBus?.bus);
101
+ }
102
+ }
@@ -0,0 +1,29 @@
1
+ import { UserPool } from 'aws-cdk-lib/aws-cognito';
2
+ import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';
3
+ import { Construct } from 'constructs';
4
+
5
+ import { ServiceStack, getLogicalName } from '../../../../common';
6
+ import { BaseAggregateParams } from '../base-function';
7
+ import { CognitoFunction, CognitoHandlerParams } from './cognito-function';
8
+
9
+ export type CognitoAggregateParams<HandlerName extends string = string> = BaseAggregateParams & {
10
+ handlers: Record<HandlerName, CognitoHandlerParams>;
11
+ userPool: UserPool;
12
+ };
13
+
14
+ export class CognitoAggregate<HandlerName extends string = string> extends Construct {
15
+ public readonly handlers: Record<HandlerName, NodejsFunction> = {} as Record<HandlerName, NodejsFunction>;
16
+
17
+ constructor(service: ServiceStack, params: CognitoAggregateParams<HandlerName>) {
18
+ super(service, getLogicalName(CognitoAggregate.name));
19
+
20
+ Object.keys(params.handlers).forEach((handler) => {
21
+ this.handlers[handler as HandlerName] = new CognitoFunction(service, {
22
+ ...params,
23
+ ...params.handlers[handler as HandlerName],
24
+ modifiers: [...(params.modifiers || []), ...(params.handlers[handler as HandlerName].modifiers || [])],
25
+ environment: { ...params.environment, ...params.handlers[handler as HandlerName].environment },
26
+ }).lambdaFunction;
27
+ });
28
+ }
29
+ }
@@ -0,0 +1,36 @@
1
+ import { Duration } from 'aws-cdk-lib';
2
+ import { UserPool, UserPoolOperation } from 'aws-cdk-lib/aws-cognito';
3
+ import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';
4
+ import { Construct } from 'constructs';
5
+
6
+ import { ServiceStack, getLogicalName, SynthError } from '../../../../common';
7
+ import { BaseAggregateParams } from '../base-function';
8
+ import { BaseFunction, BaseHandlerParams } from '../base-function';
9
+
10
+ export type CognitoHandlerParams = BaseHandlerParams & {
11
+ operation: UserPoolOperation;
12
+ };
13
+
14
+ export type CognitoFunctionParams = BaseAggregateParams & {
15
+ userPool: UserPool;
16
+ };
17
+
18
+ export class CognitoFunction extends Construct {
19
+ public readonly lambdaFunction: NodejsFunction;
20
+
21
+ constructor(service: ServiceStack, params: CognitoFunctionParams & CognitoHandlerParams) {
22
+ super(service, getLogicalName(CognitoFunction.name, params.name));
23
+
24
+ this.lambdaFunction = new BaseFunction(service, {
25
+ ...params,
26
+ timeout: Duration.seconds(5),
27
+ environment: { ...params.environment, CC_FUNCTION_TYPE: 'COGNITO' },
28
+ }).lambdaFunction;
29
+
30
+ if (this.lambdaFunction.timeout && this.lambdaFunction.timeout.toSeconds() > Duration.seconds(5).toSeconds()) {
31
+ throw new SynthError('Lambda timeout must be less than 5 seconds in CognitoFunction', service.props);
32
+ }
33
+
34
+ params.userPool.addTrigger(params.operation, this.lambdaFunction);
35
+ }
36
+ }
@@ -0,0 +1,2 @@
1
+ export * from './cognito-aggregate';
2
+ export * from './cognito-function';
@@ -0,0 +1,28 @@
1
+ import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';
2
+ import { Construct } from 'constructs';
3
+
4
+ import { ServiceStack, getLogicalName } from '../../../../common';
5
+ import { BaseAggregateParams } from '../base-function';
6
+ import { CronFunction, CronHandlerParams } from './cron-function';
7
+
8
+ export type CronAggregateParams<HandlerName extends string = string> = BaseAggregateParams & {
9
+ name?: string;
10
+ handlers: Record<HandlerName, CronHandlerParams>;
11
+ };
12
+
13
+ export class CronAggregate<HandlerName extends string = string> extends Construct {
14
+ public readonly handlers: Record<HandlerName, NodejsFunction> = {} as Record<HandlerName, NodejsFunction>;
15
+
16
+ constructor(service: ServiceStack, params: CronAggregateParams<HandlerName>) {
17
+ super(service, getLogicalName(CronAggregate.name, params.name));
18
+
19
+ Object.keys(params.handlers).forEach((handler: string) => {
20
+ this.handlers[handler as HandlerName] = new CronFunction(service, {
21
+ ...params,
22
+ ...params.handlers[handler as HandlerName],
23
+ modifiers: [...(params.modifiers || []), ...(params.handlers[handler as HandlerName].modifiers || [])],
24
+ environment: { ...params.environment, ...params.handlers[handler as HandlerName].environment },
25
+ }).lambdaFunction;
26
+ });
27
+ }
28
+ }
@@ -0,0 +1,32 @@
1
+ import { CronOptions, Rule, Schedule } from 'aws-cdk-lib/aws-events';
2
+ import { LambdaFunction } from 'aws-cdk-lib/aws-events-targets';
3
+ import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';
4
+ import { Construct } from 'constructs';
5
+
6
+ import { ServiceStack, getLogicalName } from '../../../../common';
7
+ import { BaseAggregateParams } from '../base-function';
8
+ import { BaseFunction, BaseHandlerParams } from '../base-function';
9
+
10
+ export type CronHandlerParams = BaseHandlerParams & {
11
+ cronOptions: CronOptions;
12
+ };
13
+
14
+ export type CronFunctionParams = BaseAggregateParams;
15
+
16
+ export class CronFunction extends Construct {
17
+ public readonly lambdaFunction: NodejsFunction;
18
+
19
+ constructor(service: ServiceStack, params: CronFunctionParams & CronHandlerParams) {
20
+ super(service, getLogicalName(CronFunction.name, params.name));
21
+
22
+ this.lambdaFunction = new BaseFunction(service, {
23
+ ...params,
24
+ environment: { ...params.environment, CC_FUNCTION_TYPE: 'CRON' },
25
+ }).lambdaFunction;
26
+
27
+ new Rule(service, getLogicalName('EventProcessorRule', params.name), {
28
+ schedule: Schedule.cron(params.cronOptions),
29
+ targets: [new LambdaFunction(this.lambdaFunction)],
30
+ });
31
+ }
32
+ }
@@ -0,0 +1,2 @@
1
+ export * from './cron-aggregate';
2
+ export * from './cron-function';
@@ -0,0 +1,9 @@
1
+ import { EventBusPrefab } from '../../../integration';
2
+ import { BaseAggregateParams } from '../base-function';
3
+ import { EventHandlerParams } from './event-function';
4
+
5
+ export type EventAggregateParams<HandlerName extends string = string> = BaseAggregateParams & {
6
+ name?: string;
7
+ handlers: Record<HandlerName, EventHandlerParams>;
8
+ eventBus: EventBusPrefab;
9
+ };
@@ -0,0 +1,33 @@
1
+ import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';
2
+ import { Construct } from 'constructs';
3
+
4
+ import { EventBusPrefab } from '../../../..';
5
+ import { ServiceStack, getLogicalName } from '../../../../common';
6
+ import { BaseAggregateParams } from '../base-function';
7
+ import { EventFunction, EventHandlerParams } from './event-function';
8
+
9
+ export type EventAggregateParams<HandlerName extends string = string> = BaseAggregateParams & {
10
+ name?: string;
11
+ handlers: Record<HandlerName, EventHandlerParams>;
12
+ eventBus: EventBusPrefab;
13
+ };
14
+
15
+ export class EventAggregate<HandlerName extends string = string> extends Construct {
16
+ public readonly handlers: Record<HandlerName, NodejsFunction> = {} as Record<HandlerName, NodejsFunction>;
17
+
18
+ constructor(service: ServiceStack, params: EventAggregateParams<HandlerName>) {
19
+ super(service, getLogicalName(EventAggregate.name, params.name));
20
+
21
+ Object.keys(params.handlers).forEach((handler: string) => {
22
+ this.handlers[handler as HandlerName] = new EventFunction(service, {
23
+ ...params,
24
+ ...params.handlers[handler as HandlerName],
25
+ modifiers: [...(params.modifiers || []), ...(params.handlers[handler as HandlerName].modifiers || [])],
26
+ environment: {
27
+ ...params.environment,
28
+ ...params.handlers[handler as HandlerName].environment,
29
+ },
30
+ }).lambdaFunction;
31
+ });
32
+ }
33
+ }
@@ -0,0 +1,42 @@
1
+ import { Rule } from 'aws-cdk-lib/aws-events';
2
+ import { LambdaFunction } from 'aws-cdk-lib/aws-events-targets';
3
+ import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';
4
+ import { Construct } from 'constructs';
5
+
6
+ import { EventConfig } from '@takumi-stack/sdk';
7
+
8
+ import { ServiceStack, getLogicalName, getShortResourceName } from '../../../../common';
9
+ import { BaseFunction, BaseAggregateParams, BaseHandlerParams } from '../base-function';
10
+
11
+ export type EventHandlerParams = BaseHandlerParams & {
12
+ eventConfig: EventConfig[];
13
+ };
14
+
15
+ export type EventFunctionParams = BaseAggregateParams;
16
+ export class EventFunction extends Construct {
17
+ public readonly lambdaFunction: NodejsFunction;
18
+
19
+ constructor(service: ServiceStack, params: EventFunctionParams & EventHandlerParams) {
20
+ super(service, getLogicalName(EventFunction.name, params.name));
21
+
22
+ this.lambdaFunction = new BaseFunction(service, {
23
+ ...params,
24
+ environment: { ...params.environment, CC_FUNCTION_TYPE: 'EVENT' },
25
+ }).lambdaFunction;
26
+
27
+ const source = params.eventConfig.map((e) => e.source);
28
+ const detailType = params.eventConfig.map((e) => e.name);
29
+ const detailRules = params.eventConfig.reduce((memo, e) => ({ ...memo, ...(e.detail || {}) }), {});
30
+
31
+ new Rule(service, getLogicalName('EventProcessorRule', params.name), {
32
+ ruleName: getShortResourceName(params.name, service.props),
33
+ eventBus: params.eventBus?.bus,
34
+ eventPattern: {
35
+ ...(source.filter((e) => !!e).length > 0 ? { source } : {}),
36
+ ...(detailType.filter((e) => !!e).length > 0 ? { detailType } : {}),
37
+ ...(Object.keys(detailRules).length > 0 ? { detail: detailRules } : {}),
38
+ },
39
+ targets: [new LambdaFunction(this.lambdaFunction)],
40
+ });
41
+ }
42
+ }
@@ -0,0 +1,2 @@
1
+ export * from './event-aggregate';
2
+ export * from './event-function';
@@ -0,0 +1,7 @@
1
+ export * from './api-function';
2
+ export * from './base-function';
3
+ export * from './cognito-function';
4
+ export * from './cron-function';
5
+ export * from './event-function';
6
+ export * from './queue-function';
7
+ export * from './topic-function';