@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,271 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.SsrPrefab = void 0;
30
+ const awsCloudfront = __importStar(require("aws-cdk-lib/aws-cloudfront"));
31
+ const lambda = __importStar(require("aws-cdk-lib/aws-lambda"));
32
+ const aws_cdk_lib_1 = require("aws-cdk-lib");
33
+ const aws_cloudfront_origins_1 = require("aws-cdk-lib/aws-cloudfront-origins");
34
+ const aws_iam_1 = require("aws-cdk-lib/aws-iam");
35
+ const aws_logs_1 = require("aws-cdk-lib/aws-logs");
36
+ const aws_route53_1 = require("aws-cdk-lib/aws-route53");
37
+ const aws_route53_targets_1 = require("aws-cdk-lib/aws-route53-targets");
38
+ const aws_s3_1 = require("aws-cdk-lib/aws-s3");
39
+ const aws_s3_deployment_1 = require("aws-cdk-lib/aws-s3-deployment");
40
+ const aws_ssm_1 = require("aws-cdk-lib/aws-ssm");
41
+ const constructs_1 = require("constructs");
42
+ const child_process_1 = require("child_process");
43
+ const fs_1 = __importDefault(require("fs"));
44
+ const path_1 = __importDefault(require("path"));
45
+ const common_1 = require("../../../common");
46
+ const storage_1 = require("../../storage");
47
+ const utils_1 = require("../../utils");
48
+ class SsrPrefab extends constructs_1.Construct {
49
+ domain;
50
+ baseUrl;
51
+ distribution;
52
+ bucket;
53
+ serverFunction;
54
+ imageFunction;
55
+ constructor(service, params) {
56
+ super(service, (0, common_1.getLogicalName)(SsrPrefab.name, params.subDomain));
57
+ const command = `npx dotenv -e .env.${service.props.envName} open-next build`;
58
+ (0, child_process_1.execSync)(command, { stdio: 'inherit', cwd: `${process.cwd()}/${params.baseDir}` });
59
+ this.domain = (0, common_1.getDomain)(params.subDomain, service.props);
60
+ this.baseUrl = `https://${this.domain}/`;
61
+ this.bucket = new storage_1.PrivateBucketPrefab(service, {
62
+ bucketName: 'ssr',
63
+ bucketProps: {
64
+ removalPolicy: aws_cdk_lib_1.RemovalPolicy.DESTROY,
65
+ autoDeleteObjects: true,
66
+ cors: [
67
+ {
68
+ allowedMethods: [aws_s3_1.HttpMethods.GET, aws_s3_1.HttpMethods.HEAD],
69
+ allowedOrigins: ['*'],
70
+ allowedHeaders: ['*'],
71
+ },
72
+ ],
73
+ },
74
+ });
75
+ new aws_s3_deployment_1.BucketDeployment(this, 'DeployAssetsBucket', {
76
+ sources: [aws_s3_deployment_1.Source.asset(params.filesPathAssets)],
77
+ destinationBucket: this.bucket.bucket,
78
+ destinationKeyPrefix: '',
79
+ prune: true,
80
+ retainOnDelete: false,
81
+ });
82
+ // NextJS Server Function
83
+ this.serverFunction = new lambda.Function(this, 'SSRServerFunction', {
84
+ functionName: (0, common_1.getShortResourceName)('server-function', service.props),
85
+ handler: 'index.handler',
86
+ currentVersionOptions: {
87
+ removalPolicy: aws_cdk_lib_1.RemovalPolicy.DESTROY,
88
+ },
89
+ logRetention: aws_logs_1.RetentionDays.FIVE_DAYS,
90
+ runtime: lambda.Runtime.NODEJS_18_X,
91
+ memorySize: 2048,
92
+ timeout: aws_cdk_lib_1.Duration.seconds(5),
93
+ code: lambda.Code.fromAsset(params.filesPathNextFunction),
94
+ environment: {
95
+ ...params.calculatedSecrets,
96
+ },
97
+ });
98
+ // Image Optimization Function
99
+ this.imageFunction = new lambda.Function(this, 'SSRImageFunction', {
100
+ functionName: (0, common_1.getShortResourceName)('image-function', service.props),
101
+ handler: 'index.handler',
102
+ currentVersionOptions: {
103
+ removalPolicy: aws_cdk_lib_1.RemovalPolicy.DESTROY,
104
+ },
105
+ logRetention: aws_logs_1.RetentionDays.FIVE_DAYS,
106
+ runtime: lambda.Runtime.NODEJS_18_X,
107
+ memorySize: 1536,
108
+ code: lambda.Code.fromAsset(params.filesPathImageFunction),
109
+ architecture: lambda.Architecture.ARM_64,
110
+ timeout: aws_cdk_lib_1.Duration.seconds(25),
111
+ environment: {
112
+ BUCKET_NAME: this.bucket.bucket.bucketName,
113
+ // TODO: Add allowed domains here. These are on the nextjs config file.
114
+ NEXT_IMAGE_ALLOWED_DOMAINS: '',
115
+ ...params.calculatedSecrets,
116
+ },
117
+ initialPolicy: [
118
+ new aws_iam_1.PolicyStatement({
119
+ actions: ['s3:GetObject'],
120
+ resources: [this.bucket.bucket.arnForObjects('*')],
121
+ }),
122
+ ],
123
+ });
124
+ // Middleware Function (for redirects)
125
+ const oai = new awsCloudfront.OriginAccessIdentity(this, (0, common_1.getResourceName)('oai', service.props));
126
+ this.bucket.bucket.grantRead(oai);
127
+ // Create origin group with the bucket and server function
128
+ const origin = new aws_cloudfront_origins_1.S3Origin(this.bucket.bucket, {
129
+ originId: (0, common_1.getResourceName)('OriginId', service.props),
130
+ originAccessIdentity: oai,
131
+ });
132
+ // Create server behavior for the origin group with the server function and middleware function (for redirects)
133
+ const serverFnUrl = this.serverFunction.addFunctionUrl({
134
+ authType: lambda.FunctionUrlAuthType.NONE,
135
+ });
136
+ // Create server behavior for the origin group with the server function
137
+ const serverBehavior = {
138
+ viewerProtocolPolicy: awsCloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
139
+ origin: new aws_cloudfront_origins_1.HttpOrigin(aws_cdk_lib_1.Fn.parseDomainName(serverFnUrl.url)),
140
+ allowedMethods: awsCloudfront.AllowedMethods.ALLOW_ALL,
141
+ cachedMethods: awsCloudfront.CachedMethods.CACHE_GET_HEAD_OPTIONS,
142
+ compress: true,
143
+ cachePolicy: this.createCloudFrontServerCachePolicy(),
144
+ };
145
+ // Create image optimization behavior for the origin group with the image function
146
+ const imageFnUrl = this.imageFunction.addFunctionUrl({
147
+ authType: lambda.FunctionUrlAuthType.NONE,
148
+ });
149
+ // Create image optimization behavior for the origin group with the image function
150
+ const imageBehavior = {
151
+ viewerProtocolPolicy: awsCloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
152
+ origin: new aws_cloudfront_origins_1.HttpOrigin(aws_cdk_lib_1.Fn.parseDomainName(imageFnUrl.url)),
153
+ allowedMethods: awsCloudfront.AllowedMethods.ALLOW_ALL,
154
+ cachedMethods: awsCloudfront.CachedMethods.CACHE_GET_HEAD_OPTIONS,
155
+ compress: true,
156
+ cachePolicy: serverBehavior.cachePolicy,
157
+ };
158
+ const domains = [this.domain];
159
+ if (params.wwwRedirectEnabled) {
160
+ if (params.subDomain)
161
+ throw new common_1.SynthError('wwwRedirectEnabled is only allowed in the root domain', service.props);
162
+ domains.push(`www.${this.domain}`);
163
+ }
164
+ // Create default behavior
165
+ // default handler for requests that don't match any other path:
166
+ // - try lambda handler first first
167
+ // - if failed, fall back to S3
168
+ const fallbackOriginGroup = new aws_cloudfront_origins_1.OriginGroup({
169
+ primaryOrigin: serverBehavior.origin,
170
+ fallbackOrigin: origin,
171
+ fallbackStatusCodes: [404],
172
+ });
173
+ const defaultBehavior = {
174
+ origin: fallbackOriginGroup,
175
+ viewerProtocolPolicy: awsCloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
176
+ compress: true,
177
+ cachePolicy: serverBehavior.cachePolicy,
178
+ // TODO: Add edge lambdas here
179
+ // edgeLambdas: serverBehavior.edgeLambdas,
180
+ };
181
+ // Create statics behavior for the origin group with the bucket
182
+ const staticFileBehavior = {
183
+ origin,
184
+ viewerProtocolPolicy: awsCloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
185
+ allowedMethods: awsCloudfront.AllowedMethods.ALLOW_GET_HEAD_OPTIONS,
186
+ cachedMethods: awsCloudfront.CachedMethods.CACHE_GET_HEAD_OPTIONS,
187
+ compress: true,
188
+ cachePolicy: awsCloudfront.CachePolicy.CACHING_OPTIMIZED,
189
+ };
190
+ const staticsBehaviorsStatic = {};
191
+ const publicDir = path_1.default.join(params.filesPathAssets);
192
+ // Get all files and folders in the public directory
193
+ // and create a behavior for each one
194
+ for (const item of fs_1.default.readdirSync(publicDir)) {
195
+ if (fs_1.default.statSync(path_1.default.join(publicDir, item)).isDirectory()) {
196
+ staticsBehaviorsStatic[`${item}/*`] = staticFileBehavior;
197
+ }
198
+ else {
199
+ staticsBehaviorsStatic[item] = staticFileBehavior;
200
+ }
201
+ }
202
+ this.distribution = new awsCloudfront.Distribution(this, 'Distribution', {
203
+ defaultRootObject: '',
204
+ domainNames: domains,
205
+ certificate: params.certificate,
206
+ comment: (0, common_1.getResourceName)('cdn', service.props),
207
+ enableIpv6: false,
208
+ enabled: true,
209
+ httpVersion: awsCloudfront.HttpVersion.HTTP2,
210
+ priceClass: awsCloudfront.PriceClass.PRICE_CLASS_100,
211
+ minimumProtocolVersion: awsCloudfront.SecurityPolicyProtocol.TLS_V1_2_2021,
212
+ sslSupportMethod: awsCloudfront.SSLMethod.SNI,
213
+ defaultBehavior: defaultBehavior,
214
+ additionalBehaviors: {
215
+ 'api/*': serverBehavior,
216
+ '_next/data/*': serverBehavior,
217
+ '_next/image*': imageBehavior,
218
+ '_next/*': staticFileBehavior,
219
+ // all other static files
220
+ ...staticsBehaviorsStatic,
221
+ },
222
+ });
223
+ if (!params.skipRecord) {
224
+ const hostedZone = aws_route53_1.HostedZone.fromLookup(this, 'HostedZoneEnvDns', { domainName: (0, common_1.getDomain)('', service.props) });
225
+ domains.map((d) => {
226
+ new aws_route53_1.ARecord(service, d.split('.')[0], {
227
+ zone: hostedZone,
228
+ target: aws_route53_1.RecordTarget.fromAlias(new aws_route53_targets_1.CloudFrontTarget(this.distribution)),
229
+ recordName: d,
230
+ });
231
+ });
232
+ }
233
+ new utils_1.FrontendEnvBuilder(service, { ...params, name: params.subDomain });
234
+ new aws_ssm_1.StringParameter(this, 'Config', {
235
+ simpleName: true,
236
+ parameterName: (0, common_1.getResourceName)('config', service.props),
237
+ stringValue: JSON.stringify({
238
+ domain: this.domain,
239
+ distributionBucket: this.bucket.bucket.bucketName,
240
+ distributionId: this.distribution.distributionId,
241
+ assetMaxAge: params.assetMaxAge || '300',
242
+ indexMaxAge: params.indexMaxAge || '1800',
243
+ baseDir: params.baseDir || `frontend/${service.props.serviceName}`,
244
+ distDir: params.distDir || 'build',
245
+ }),
246
+ });
247
+ new aws_cdk_lib_1.CfnOutput(this, 'Domain', { value: this.domain });
248
+ new aws_cdk_lib_1.CfnOutput(this, 'BaseUrl', { value: this.baseUrl });
249
+ }
250
+ createCloudFrontServerCachePolicy() {
251
+ return new awsCloudfront.CachePolicy(this, 'ServerCache', {
252
+ queryStringBehavior: awsCloudfront.CacheQueryStringBehavior.all(),
253
+ headerBehavior: awsCloudfront.CacheHeaderBehavior.allowList(
254
+ // required by image optimization request
255
+ 'Accept',
256
+ // required by server request
257
+ 'x-op-middleware-request-headers', 'x-op-middleware-response-headers', 'x-nextjs-data', 'x-middleware-prefetch',
258
+ // required by server request (in-place routing)
259
+ 'rsc', 'next-router-prefetch', 'next-router-state-tree'),
260
+ cookieBehavior: awsCloudfront.CacheCookieBehavior.all(),
261
+ defaultTtl: aws_cdk_lib_1.Duration.days(0),
262
+ maxTtl: aws_cdk_lib_1.Duration.days(365),
263
+ minTtl: aws_cdk_lib_1.Duration.days(0),
264
+ enableAcceptEncodingBrotli: true,
265
+ enableAcceptEncodingGzip: true,
266
+ comment: 'Server response cache policy',
267
+ });
268
+ }
269
+ }
270
+ exports.SsrPrefab = SsrPrefab;
271
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../prefab/cdn/cdn-ssr/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAA4D;AAC5D,+DAAiD;AACjD,6CAAqE;AAErE,+EAAuF;AACvF,iDAAsD;AACtD,mDAAqD;AACrD,yDAA4E;AAC5E,yEAAmE;AACnE,+CAAiD;AACjD,qEAAyE;AACzE,iDAAsD;AACtD,2CAAuC;AAEvC,iDAAyC;AACzC,4CAAoB;AACpB,gDAAwB;AAExB,4CAA6H;AAE7H,2CAAoD;AACpD,uCAAiD;AAkBjD,MAAa,SAAU,SAAQ,sBAAS;IACtB,MAAM,CAAS;IACf,OAAO,CAAS;IAChB,YAAY,CAA6B;IACzC,MAAM,CAAsB;IAC5B,cAAc,CAAkB;IAChC,aAAa,CAAkB;IAE/C,YAAY,OAAqB,EAAE,MAAuB;QACxD,KAAK,CAAC,OAAO,EAAE,IAAA,uBAAc,EAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;QAEjE,MAAM,OAAO,GAAG,sBAAsB,OAAO,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC;QAC9E,IAAA,wBAAQ,EAAC,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,IAAI,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAEnF,IAAI,CAAC,MAAM,GAAG,IAAA,kBAAS,EAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QACzD,IAAI,CAAC,OAAO,GAAG,WAAW,IAAI,CAAC,MAAM,GAAG,CAAC;QAEzC,IAAI,CAAC,MAAM,GAAG,IAAI,6BAAmB,CAAC,OAAO,EAAE;YAC7C,UAAU,EAAE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AAa,EAAE;YACxD,mBAAmB,EAAE,aAAa,CAAC,wBAAwB,CAAC,GAAG,EAAE;YACjE,cAAc,EAAE,aAAa,CAAC,mBAAmB,CAAC,SAAS;YACzD,yCAAyC;YACzC,QAAQ;YACR,6BAA6B;YAC7B,iCAAiC,EACjC,kCAAkC,EAClC,eAAe,EACf,uBAAuB;YACvB,gDAAgD;YAChD,KAAK,EACL,sBAAsB,EACtB,wBAAwB,CACzB;YACD,cAAc,EAAE,aAAa,CAAC,mBAAmB,CAAC,GAAG,EAAE;YACvD,UAAU,EAAE,sBAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;YAC5B,MAAM,EAAE,sBAAQ,CAAC,IAAI,CAAC,GAAG,CAAC;YAC1B,MAAM,EAAE,sBAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;YACxB,0BAA0B,EAAE,IAAI;YAChC,wBAAwB,EAAE,IAAI;YAC9B,OAAO,EAAE,8BAA8B;SACxC,CAAC,CAAC;IACL,CAAC;CACF;AAxPD,8BAwPC"}
@@ -0,0 +1,5 @@
1
+ export * from './cdn-api';
2
+ export * from './cdn-asset';
3
+ export * from './cdn-spa';
4
+ export * from './cdn-ssr';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,13 @@
1
+ import * as awsECS from 'aws-cdk-lib/aws-ecs';
2
+ import { Construct } from 'constructs';
3
+ import { VpcPrefab } from '../../..';
4
+ import { ServiceStack } from '../../../common';
5
+ export type FargateClusterPrefabParams = {
6
+ name: string;
7
+ vpcPrefab: VpcPrefab;
8
+ };
9
+ export declare class FargateClusterPrefab extends Construct {
10
+ readonly cluster: awsECS.Cluster;
11
+ constructor(service: ServiceStack, params: FargateClusterPrefabParams);
12
+ }
13
+ //# sourceMappingURL=cluster.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cluster.d.ts","sourceRoot":"","sources":["../../../../prefab/compute/fargate/cluster.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,YAAY,EAAmC,MAAM,iBAAiB,CAAC;AAEhF,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,qBAAa,oBAAqB,SAAQ,SAAS;IACjD,SAAgB,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC;gBAE5B,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,0BAA0B;CAStE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cluster.js","sourceRoot":"","sources":["../../../../prefab/compute/fargate/cluster.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAA8C;AAC9C,2CAAuC;AAGvC,4CAAgF;AAOhF,MAAa,oBAAqB,SAAQ,sBAAS;IACjC,OAAO,CAAiB;IAExC,YAAY,OAAqB,EAAE,MAAkC;QACnE,KAAK,CAAC,OAAO,EAAE,IAAA,uBAAc,EAAC,MAAM,CAAC,IAAI,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC;QAEvE,IAAI,CAAC,OAAO,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,IAAA,uBAAc,EAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE;YAC9E,iBAAiB,EAAE,IAAI;YACvB,WAAW,EAAE,IAAA,wBAAe,EAAC,SAAS,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;YACvF,GAAG,EAAE,MAAM,CAAC,SAAS,CAAC,GAAG;SAC1B,CAAC,CAAC;IACL,CAAC;CACF;AAZD,oDAYC"}
@@ -0,0 +1,3 @@
1
+ export * from './cluster';
2
+ export * from './service';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,45 @@
1
+ import * as awsALB from 'aws-cdk-lib/aws-elasticloadbalancingv2';
2
+ import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
3
+ import { IRepository } from 'aws-cdk-lib/aws-ecr';
4
+ import { HealthCheck, Secret } from 'aws-cdk-lib/aws-ecs';
5
+ import { Construct } from 'constructs';
6
+ import { ServiceStack } from '../../../common';
7
+ import { PublicAlbPrefab } from '../../gateway';
8
+ import { VpcPrefab } from '../../networking';
9
+ import { FargateClusterPrefab } from './cluster';
10
+ export type FargateContainerHealthCheck = HealthCheck;
11
+ export type FargatePerformanceTunning = {
12
+ taskCpu: string;
13
+ taskMemory: string;
14
+ containerDesiredCount: number;
15
+ taskAutoScaleMin: number;
16
+ taskAutoScaleMax: number;
17
+ taskAutoScalePercent: number;
18
+ containerMaxMemory: number;
19
+ };
20
+ export type FargateServicePrefabParams = {
21
+ name: string;
22
+ fargateClusterPrefab: FargateClusterPrefab;
23
+ vpcPrefab: VpcPrefab;
24
+ albPrefab: PublicAlbPrefab;
25
+ mappingPort: number;
26
+ basePath: string;
27
+ fixedPriority?: number;
28
+ healthCheckPath: string;
29
+ certificate: ICertificate;
30
+ containerHealthCheck?: FargateContainerHealthCheck;
31
+ containerEnv?: Record<string, string>;
32
+ containerSecrets?: Record<string, Secret>;
33
+ dockerBuildFolder?: string;
34
+ externalRepository?: {
35
+ repositoryName: string;
36
+ tag?: string;
37
+ };
38
+ performanceTunning: FargatePerformanceTunning;
39
+ };
40
+ export declare class FargateServicePrefab extends Construct {
41
+ readonly repository: IRepository;
42
+ readonly targetGroup: awsALB.ApplicationTargetGroup;
43
+ constructor(service: ServiceStack, params: FargateServicePrefabParams);
44
+ }
45
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../prefab/compute/fargate/service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,wCAAwC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AG,cAAc,CAAC,kBAAkB,CAAC;YACvD,WAAW,EAAE,MAAM,CAAC,kBAAkB,CAAC,gBAAgB;YACvD,WAAW,EAAE,MAAM,CAAC,kBAAkB,CAAC,gBAAgB;SACxD,CAAC,CAAC;QACH,cAAc,CAAC,wBAAwB,CAAC,IAAA,uBAAc,EAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE;YACjF,wBAAwB,EAAE,MAAM,CAAC,kBAAkB,CAAC,oBAAoB;SACzE,CAAC,CAAC;QACH,cAAc,CAAC,qBAAqB,CAAC,IAAA,uBAAc,EAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE;YAC9E,wBAAwB,EAAE,MAAM,CAAC,kBAAkB,CAAC,oBAAoB;SACzE,CAAC,CAAC;QAEH,iBAAiB;QACjB,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,GAAG,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;IACpE,CAAC;CACF;AAlFD,oDAkFC"}
@@ -0,0 +1,31 @@
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
+ import { TableStoreBuilder } from '@takumi-stack/sdk';
6
+ import { ServiceStack } from '../../../../common';
7
+ import { CdnApiPrefab } from '../../../cdn';
8
+ import { DynamoTablePrefab } from '../../../database';
9
+ import { ApiRestPrefab, ApiHttpPrefab } from '../../../gateway';
10
+ import { BaseAggregateParams } from '../base-function';
11
+ import { ApiHandlerParams } from './api-function';
12
+ export type ApiAuthPoolParams = {
13
+ userPool?: UserPool;
14
+ userPoolClient?: UserPoolClient;
15
+ };
16
+ export type ApiAggregateParams<HandlerName extends string = string> = BaseAggregateParams & {
17
+ basePath: string;
18
+ handlers: Record<HandlerName, ApiHandlerParams>;
19
+ cdnApiPrefab: CdnApiPrefab | undefined;
20
+ authPool?: ApiAuthPoolParams;
21
+ customAuthorizerHandler?: IFunction;
22
+ useRestApi?: true;
23
+ tableBuilder?: typeof TableStoreBuilder<any>;
24
+ };
25
+ export declare class ApiAggregate<HandlerName extends string = string> extends Construct {
26
+ readonly apiPrefab: ApiRestPrefab | ApiHttpPrefab;
27
+ readonly tablePrefab?: DynamoTablePrefab;
28
+ readonly handlers: Record<HandlerName, NodejsFunction>;
29
+ constructor(service: ServiceStack, params: ApiAggregateParams);
30
+ }
31
+ //# sourceMappingURL=api-aggregate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-aggregate.d.ts","sourceRoot":"","sources":["../../../../../prefab/compute/function/api-function/api-aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAA8B,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAe,MAAM,gBAAgB,CAAC;AAE/D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,WAAW,SAAS,MAAM,GAAG,MAAM,IAAI,mBAAmB,GAAG;IAC1F,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;IAChD,YAAY,EAAE,YAAY,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,uBAAuB,CAAC,EAAE,SAAS,CAAC;IACpC,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,iBAAiB,CAAC,GAAG,CAAC,CAAC;CAC9C,CAAC;AAEF,qBAAa,YAAY,CAAC,WAAW,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,SAAS;IAC9E,SAAgB,SAAS,EAAE,aAAa,GAAG,aAAa,CAAC;IACzD,SAAgB,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChD,SAAgB,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,CAA6C;gBAE9F,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,kBAAkB;CAsC9D"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApiAggregate = void 0;
4
+ const constructs_1 = require("constructs");
5
+ const common_1 = require("../../../../common");
6
+ const database_1 = require("../../../database");
7
+ const gateway_1 = require("../../../gateway");
8
+ const api_function_1 = require("./api-function");
9
+ class ApiAggregate extends constructs_1.Construct {
10
+ apiPrefab;
11
+ tablePrefab;
12
+ handlers = {};
13
+ constructor(service, params) {
14
+ super(service, (0, common_1.getLogicalName)('ApiAggregate'));
15
+ if (params.useRestApi) {
16
+ this.apiPrefab = new gateway_1.ApiRestPrefab(service, {
17
+ ...params,
18
+ ...params.authPool,
19
+ customAuthorizerHandler: params.customAuthorizerHandler,
20
+ });
21
+ }
22
+ else {
23
+ this.apiPrefab = new gateway_1.ApiHttpPrefab(service, {
24
+ ...params,
25
+ ...params.authPool,
26
+ customAuthorizerHandler: params.customAuthorizerHandler,
27
+ });
28
+ }
29
+ if (params.tableBuilder && params.tablePrefab)
30
+ throw new common_1.SynthError('Invalid params: tableBuilder and tablePrefab are mutually exclusive', service.props);
31
+ if (params.tablePrefab)
32
+ this.tablePrefab = params.tablePrefab;
33
+ if (params.tableBuilder)
34
+ this.tablePrefab = new database_1.DynamoTablePrefab(service, params.tableBuilder);
35
+ Object.keys(params.handlers).forEach((handler) => {
36
+ if (params.basePath !== params.handlers[handler].basePath)
37
+ throw new common_1.SynthError(`[ApiService] Invalid basePath: '${params.handlers[handler].basePath}' in '${handler}' function.`, service.props);
38
+ this.handlers[handler] = new api_function_1.ApiFunction(service, {
39
+ ...params,
40
+ ...params.handlers[handler],
41
+ tablePrefab: this.tablePrefab,
42
+ apiPrefab: this.apiPrefab,
43
+ modifiers: [...(params.modifiers || []), ...(params.handlers[handler].modifiers || [])],
44
+ environment: {
45
+ ...params.environment,
46
+ ...params.handlers[handler].environment,
47
+ },
48
+ }).lambdaFunction;
49
+ });
50
+ }
51
+ }
52
+ exports.ApiAggregate = ApiAggregate;
53
+ //# sourceMappingURL=api-aggregate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-aggregate.js","sourceRoot":"","sources":["../../../../../prefab/compute/function/api-function/api-aggregate.ts"],"names":[],"mappings":";;;AAGA,2CAAuC;AAIvC,+CAA8E;AAE9E,gDAAsD;AACtD,8CAAgE;AAEhE,iDAA+D;AAiB/D,MAAa,YAAkD,SAAQ,sBAAS;IAC9D,SAAS,CAAgC;IACzC,WAAW,CAAqB;IAChC,QAAQ,GAAwC,EAAyC,CAAC;IAE1G,YAAY,OAAqB,EAAE,MAA0B;QAC3D,KAAK,CAAC,OAAO,EAAE,IAAA,uBAAc,EAAC,cAAc,CAAC,CAAC,CAAC;QAE/C,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;YACtB,IAAI,CAAC,SAAS,GAAG,IAAI,uBAAa,CAAC,OAAO,EAAE;gBAC1C,GAAG,MAAM;gBACT,GA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,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAE,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;gBACxF,WAAW,EAAE;oBACX,GAAG,MAAM,CAAC,WAAW;oBACrB,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAE,CAAC,WAAW;iBACzC;aACF,CAAC,CAAC,cAAc,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA3CD,oCA2CC"}
@@ -0,0 +1,22 @@
1
+ import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';
2
+ import { Construct } from 'constructs';
3
+ import { ApiDefinition, ApiInterface } from '@takumi-stack/sdk';
4
+ import { ServiceStack } from '../../../../common';
5
+ import { ApiRestPrefab, ApiHttpPrefab } from '../../../gateway';
6
+ import { BaseAggregateParams } from '../base-function';
7
+ import { BaseHandlerParams } from '../base-function';
8
+ export type ApiHandlerParams = BaseHandlerParams & {
9
+ basePath: ApiDefinition<ApiInterface>['basePath'];
10
+ path: ApiDefinition<ApiInterface>['path'];
11
+ method: ApiDefinition<ApiInterface>['method'];
12
+ isPublic?: ApiDefinition<ApiInterface>['isPublic'];
13
+ cacheMaxAge?: number;
14
+ };
15
+ export type ApiFunctionParams = BaseAggregateParams & {
16
+ apiPrefab: ApiRestPrefab | ApiHttpPrefab;
17
+ };
18
+ export declare class ApiFunction extends Construct {
19
+ readonly lambdaFunction: NodejsFunction;
20
+ constructor(service: ServiceStack, params: ApiHandlerParams & ApiFunctionParams);
21
+ }
22
+ //# sourceMappingURL=api-function.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-function.d.ts","sourceRoot":"","sources":["../../../../../prefab/compute/function/api-function/api-function.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EAAE,YAAY,EAA8B,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAgB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEnE,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,GAAG;IACjD,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC,UAAU,CAAC,CAAC;IAClD,IAAI,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC9C,QAAQ,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC,UAAU,CAAC,CAAC;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,GAAG;IACpD,SAAS,EAAE,aAAa,GAAG,aAAa,CAAC;CAC1C,CAAC;AAEF,qBAAa,WAAY,SAAQ,SAAS;IACxC,SAAgB,cAAc,EAAE,cAAc,CAAC;gBAEnC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,gBAAgB,GAAG,iBAAiB;CAiChF"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApiFunction = void 0;
4
+ const aws_cdk_lib_1 = require("aws-cdk-lib");
5
+ const aws_apigateway_1 = require("aws-cdk-lib/aws-apigateway");
6
+ const aws_apigatewayv2_integrations_1 = require("aws-cdk-lib/aws-apigatewayv2-integrations");
7
+ const constructs_1 = require("constructs");
8
+ const common_1 = require("../../../../common");
9
+ const gateway_1 = require("../../../gateway");
10
+ const base_function_1 = require("../base-function");
11
+ class ApiFunction extends constructs_1.Construct {
12
+ lambdaFunction;
13
+ constructor(service, params) {
14
+ super(service, (0, common_1.getLogicalName)(ApiFunction.name, params.name));
15
+ const baseFunction = new base_function_1.BaseFunction(service, {
16
+ ...params,
17
+ environment: { ...params.environment, CC_FUNCTION_TYPE: 'API' },
18
+ });
19
+ this.lambdaFunction = baseFunction.lambdaFunction;
20
+ this.lambdaFunction.addEnvironment('CC_CACHE_MAX_AGE', params.cacheMaxAge?.toString() || '10');
21
+ if (this.lambdaFunction.timeout && this.lambdaFunction.timeout.toSeconds() > aws_cdk_lib_1.Duration.seconds(28).toSeconds()) {
22
+ throw new common_1.SynthError('Lambda timeout must be less than 28 seconds in ApiFunctions', service.props);
23
+ }
24
+ if (params.apiPrefab instanceof gateway_1.ApiHttpPrefab) {
25
+ const path = params.path === '/' ? '' : params.path;
26
+ params.apiPrefab.api.addRoutes({
27
+ path: `/${params.basePath}${path}`,
28
+ methods: [params.method],
29
+ integration: new aws_apigatewayv2_integrations_1.HttpLambdaIntegration(ApiFunction.name, baseFunction.aliasFunction),
30
+ ...(params.isPublic ? {} : { authorizer: params.apiPrefab.authorizer }),
31
+ });
32
+ }
33
+ if (params.apiPrefab instanceof gateway_1.ApiRestPrefab) {
34
+ params.apiPrefab.api.root
35
+ .resourceForPath(`${params.basePath}${params.path}`)
36
+ .addMethod(params.method, new aws_apigateway_1.LambdaIntegration(baseFunction.aliasFunction), {
37
+ operationName: this.lambdaFunction.functionName,
38
+ ...(params.isPublic ? {} : { authorizer: params.apiPrefab.authorizer }),
39
+ });
40
+ }
41
+ }
42
+ }
43
+ exports.ApiFunction = ApiFunction;
44
+ //# sourceMappingURL=api-function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-function.js","sourceRoot":"","sources":["../../../../../prefab/compute/function/api-function/api-function.ts"],"names":[],"mappings":";;;AAAA,6CAAuC;AACvC,+DAA+D;AAC/D,6FAAkF;AAGlF,2CAAuC;AAIvC,+CAA8E;AAC9E,8CAAgE;AA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AAC,aAAa,CAAC;gBACpF,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;aACxE,CAAC,CAAC;QACL,CAAC;QACD,IAAI,MAAM,CAAC,SAAS,YAAY,uBAAa,EAAE,CAAC;YAC9C,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI;iBACtB,eAAe,CAAC,GAAG,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;iBACnD,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,kCAAiB,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE;gBAC3E,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,YAAY;gBAC/C,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;aACxE,CAAC,CAAC;QACP,CAAC;IACH,CAAC;CACF;AApCD,kCAoCC"}
@@ -0,0 +1,3 @@
1
+ export * from './api-aggregate';
2
+ export * from './api-function';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,33 @@
1
+ import { Alias, Architecture } from 'aws-cdk-lib/aws-lambda';
2
+ import { NodejsFunction, NodejsFunctionProps } from 'aws-cdk-lib/aws-lambda-nodejs';
3
+ import { Construct } from 'constructs';
4
+ import { ApiDefinition, ApiInterface, TablePermission } from '@takumi-stack/sdk';
5
+ import { Modifier, ServiceStack } from '../../../../common';
6
+ import { DynamoTablePrefab } from '../../../database';
7
+ import { EventBusPrefab } from '../../../integration';
8
+ export declare const FUNCTION_DEFAULT_TIMEOUT = 6;
9
+ export type BaseHandlerParams = NodejsFunctionProps & {
10
+ name: ApiDefinition<ApiInterface>['name'];
11
+ modifiers?: Modifier[];
12
+ environment?: Record<string, string>;
13
+ architecture?: Architecture;
14
+ tablePermission?: TablePermission;
15
+ provisionedConcurrentExecutions?: number;
16
+ };
17
+ export type BaseAggregateParams = {
18
+ baseFunctionFolder?: string;
19
+ baseFunctionString?: string;
20
+ globalConfigs?: NodejsFunctionProps;
21
+ eventBus?: EventBusPrefab;
22
+ tablePrefab?: DynamoTablePrefab;
23
+ modifiers?: Modifier[];
24
+ environment?: Record<string, string>;
25
+ compiled?: true;
26
+ tracingDisabled?: true;
27
+ };
28
+ export declare class BaseFunction extends Construct {
29
+ readonly lambdaFunction: NodejsFunction;
30
+ readonly aliasFunction: Alias;
31
+ constructor(service: ServiceStack, params: BaseHandlerParams & BaseAggregateParams);
32
+ }
33
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../prefab/compute/function/base-function/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,YAAY,EAA6B,MAAM,wBAAwB,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEjF,OAAO,EAAE,QAAQ,EAAE,YAAY,EAA0D,MAAM,oBAAoB,CAAC;AACpH,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,GAAG;IACpD,IAAI,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;IAC1C,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAA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