@sst-community/sst 4.21.1 → 5.0.0-alpha.2

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 (832) hide show
  1. package/README.md +86 -52
  2. package/package.json +35 -11
  3. package/platform/js/chunks/chunk-HIZZCEDS.js +328 -0
  4. package/platform/js/chunks/chunk-HIZZCEDS.js.map +6 -0
  5. package/platform/js/chunks/chunk-KOKHGKJ2.js +639 -0
  6. package/platform/js/chunks/chunk-KOKHGKJ2.js.map +6 -0
  7. package/platform/js/chunks/chunk-MR4XM5XA.js +473 -0
  8. package/platform/js/chunks/chunk-MR4XM5XA.js.map +6 -0
  9. package/platform/js/chunks/chunk-ONNI4XNK.js +367 -0
  10. package/platform/js/chunks/chunk-ONNI4XNK.js.map +6 -0
  11. package/platform/js/chunks/chunk-VIFHC73J.js +108 -0
  12. package/platform/js/chunks/chunk-VIFHC73J.js.map +6 -0
  13. package/platform/js/chunks/chunk-WJ6BVA46.js +10 -0
  14. package/platform/js/chunks/chunk-WJ6BVA46.js.map +6 -0
  15. package/platform/js/chunks/component-32FCLIRK.js +26 -0
  16. package/platform/js/chunks/component-32FCLIRK.js.map +6 -0
  17. package/platform/js/chunks/config-CRGKEDQW.js +10 -0
  18. package/platform/js/chunks/config-CRGKEDQW.js.map +6 -0
  19. package/platform/js/chunks/link-OJ3RNGQ3.js +9 -0
  20. package/platform/js/chunks/link-OJ3RNGQ3.js.map +6 -0
  21. package/platform/js/components/aws/index.js +35399 -0
  22. package/platform/js/components/aws/index.js.map +6 -0
  23. package/platform/js/components/cloudflare/index.js +3246 -0
  24. package/platform/js/components/cloudflare/index.js.map +6 -0
  25. package/platform/js/components/core.js +114 -0
  26. package/platform/js/components/core.js.map +6 -0
  27. package/platform/js/components/vercel/index.js +120 -0
  28. package/platform/js/components/vercel/index.js.map +6 -0
  29. package/platform/js/testing/index.js +569 -0
  30. package/platform/js/testing/index.js.map +6 -0
  31. package/platform/package.json +25 -0
  32. package/platform/src/ast/add.mjs +190 -0
  33. package/platform/src/auto/run.ts +109 -0
  34. package/platform/src/components/README.md +652 -0
  35. package/platform/src/components/args.ts +133 -0
  36. package/platform/src/components/aws/alb.ts +577 -0
  37. package/platform/src/components/aws/analog.ts +462 -0
  38. package/platform/src/components/aws/apigateway-websocket-route.ts +206 -0
  39. package/platform/src/components/aws/apigateway-websocket.ts +894 -0
  40. package/platform/src/components/aws/apigatewayv1-api-key.ts +90 -0
  41. package/platform/src/components/aws/apigatewayv1-authorizer.ts +178 -0
  42. package/platform/src/components/aws/apigatewayv1-base-route.ts +78 -0
  43. package/platform/src/components/aws/apigatewayv1-integration-route.ts +92 -0
  44. package/platform/src/components/aws/apigatewayv1-lambda-route.ts +152 -0
  45. package/platform/src/components/aws/apigatewayv1-usage-plan.ts +109 -0
  46. package/platform/src/components/aws/apigatewayv1.ts +1691 -0
  47. package/platform/src/components/aws/apigatewayv2-authorizer.ts +199 -0
  48. package/platform/src/components/aws/apigatewayv2-base-route.ts +69 -0
  49. package/platform/src/components/aws/apigatewayv2-lambda-route.ts +141 -0
  50. package/platform/src/components/aws/apigatewayv2-private-route.ts +101 -0
  51. package/platform/src/components/aws/apigatewayv2-url-route.ts +90 -0
  52. package/platform/src/components/aws/apigatewayv2.ts +1439 -0
  53. package/platform/src/components/aws/app-sync-data-source.ts +264 -0
  54. package/platform/src/components/aws/app-sync-function.ts +79 -0
  55. package/platform/src/components/aws/app-sync-resolver.ts +110 -0
  56. package/platform/src/components/aws/app-sync.ts +849 -0
  57. package/platform/src/components/aws/astro.ts +580 -0
  58. package/platform/src/components/aws/aurora.ts +1356 -0
  59. package/platform/src/components/aws/auth-v1.ts +69 -0
  60. package/platform/src/components/aws/auth.ts +417 -0
  61. package/platform/src/components/aws/bucket-lambda-subscriber.ts +162 -0
  62. package/platform/src/components/aws/bucket-notification.ts +254 -0
  63. package/platform/src/components/aws/bucket-queue-subscriber.ts +122 -0
  64. package/platform/src/components/aws/bucket-topic-subscriber.ts +144 -0
  65. package/platform/src/components/aws/bucket.ts +2046 -0
  66. package/platform/src/components/aws/bus-base-subscriber.ts +52 -0
  67. package/platform/src/components/aws/bus-lambda-subscriber.ts +125 -0
  68. package/platform/src/components/aws/bus-queue-subscriber.ts +88 -0
  69. package/platform/src/components/aws/bus.ts +630 -0
  70. package/platform/src/components/aws/cdn.ts +561 -0
  71. package/platform/src/components/aws/cluster-v1.ts +932 -0
  72. package/platform/src/components/aws/cluster.ts +584 -0
  73. package/platform/src/components/aws/cognito-identity-pool.ts +433 -0
  74. package/platform/src/components/aws/cognito-identity-provider.ts +96 -0
  75. package/platform/src/components/aws/cognito-user-pool-client.ts +114 -0
  76. package/platform/src/components/aws/cognito-user-pool.ts +1089 -0
  77. package/platform/src/components/aws/cron-v2.ts +555 -0
  78. package/platform/src/components/aws/cron.ts +435 -0
  79. package/platform/src/components/aws/dns-validated-certificate.ts +108 -0
  80. package/platform/src/components/aws/dns.ts +221 -0
  81. package/platform/src/components/aws/dsql.ts +741 -0
  82. package/platform/src/components/aws/dynamo-lambda-subscriber.ts +124 -0
  83. package/platform/src/components/aws/dynamo.ts +929 -0
  84. package/platform/src/components/aws/efs.ts +410 -0
  85. package/platform/src/components/aws/email.ts +673 -0
  86. package/platform/src/components/aws/fargate.ts +1279 -0
  87. package/platform/src/components/aws/function.ts +3280 -0
  88. package/platform/src/components/aws/helpers/apigateway-account.ts +78 -0
  89. package/platform/src/components/aws/helpers/apigatewayv2-domain.ts +144 -0
  90. package/platform/src/components/aws/helpers/arn.ts +182 -0
  91. package/platform/src/components/aws/helpers/bootstrap.ts +16 -0
  92. package/platform/src/components/aws/helpers/client.ts +76 -0
  93. package/platform/src/components/aws/helpers/container-builder.ts +33 -0
  94. package/platform/src/components/aws/helpers/custom-domain.ts +128 -0
  95. package/platform/src/components/aws/helpers/event-source.ts +41 -0
  96. package/platform/src/components/aws/helpers/fargate.ts +727 -0
  97. package/platform/src/components/aws/helpers/function-builder.ts +133 -0
  98. package/platform/src/components/aws/helpers/function-code.ts +224 -0
  99. package/platform/src/components/aws/helpers/function-part.ts +212 -0
  100. package/platform/src/components/aws/helpers/function-permission.ts +29 -0
  101. package/platform/src/components/aws/helpers/load-balancer-args.ts +88 -0
  102. package/platform/src/components/aws/helpers/load-balancer.ts +17 -0
  103. package/platform/src/components/aws/helpers/provider.ts +36 -0
  104. package/platform/src/components/aws/helpers/queue-policy.ts +33 -0
  105. package/platform/src/components/aws/helpers/rds.ts +212 -0
  106. package/platform/src/components/aws/helpers/site-builder.ts +41 -0
  107. package/platform/src/components/aws/helpers/subscriber.ts +23 -0
  108. package/platform/src/components/aws/helpers/vpc.ts +27 -0
  109. package/platform/src/components/aws/https-redirect.ts +216 -0
  110. package/platform/src/components/aws/iam-edit.ts +50 -0
  111. package/platform/src/components/aws/index.ts +61 -0
  112. package/platform/src/components/aws/kinesis-stream-lambda-subscriber.ts +122 -0
  113. package/platform/src/components/aws/kinesis-stream.ts +416 -0
  114. package/platform/src/components/aws/linkable.ts +32 -0
  115. package/platform/src/components/aws/logging.ts +25 -0
  116. package/platform/src/components/aws/microvm.ts +988 -0
  117. package/platform/src/components/aws/mysql.ts +1050 -0
  118. package/platform/src/components/aws/nextjs.ts +1052 -0
  119. package/platform/src/components/aws/nuxt.ts +527 -0
  120. package/platform/src/components/aws/open-search.ts +603 -0
  121. package/platform/src/components/aws/opencontrol.ts +235 -0
  122. package/platform/src/components/aws/permission.ts +80 -0
  123. package/platform/src/components/aws/postgres-v1.ts +537 -0
  124. package/platform/src/components/aws/postgres.ts +1074 -0
  125. package/platform/src/components/aws/providers/bucket-files.ts +32 -0
  126. package/platform/src/components/aws/providers/distribution-deployment-waiter.ts +27 -0
  127. package/platform/src/components/aws/providers/distribution-invalidation.ts +24 -0
  128. package/platform/src/components/aws/providers/function-environment-update.ts +46 -0
  129. package/platform/src/components/aws/providers/hosted-zone-lookup.ts +25 -0
  130. package/platform/src/components/aws/providers/kv-keys.ts +15 -0
  131. package/platform/src/components/aws/providers/kv-routes-update.ts +24 -0
  132. package/platform/src/components/aws/providers/microvm-image-prune.ts +48 -0
  133. package/platform/src/components/aws/providers/origin-access-control.ts +21 -0
  134. package/platform/src/components/aws/providers/rds-role-lookup.ts +21 -0
  135. package/platform/src/components/aws/providers/vector-table.ts +25 -0
  136. package/platform/src/components/aws/queue-lambda-subscriber.ts +135 -0
  137. package/platform/src/components/aws/queue.ts +712 -0
  138. package/platform/src/components/aws/react.ts +510 -0
  139. package/platform/src/components/aws/realtime-lambda-subscriber.ts +129 -0
  140. package/platform/src/components/aws/realtime.ts +345 -0
  141. package/platform/src/components/aws/redis-v1.ts +595 -0
  142. package/platform/src/components/aws/redis.ts +1078 -0
  143. package/platform/src/components/aws/remix.ts +576 -0
  144. package/platform/src/components/aws/router-base-route.ts +83 -0
  145. package/platform/src/components/aws/router-bucket-route.ts +63 -0
  146. package/platform/src/components/aws/router-url-route.ts +75 -0
  147. package/platform/src/components/aws/router.ts +3294 -0
  148. package/platform/src/components/aws/service-v1.ts +876 -0
  149. package/platform/src/components/aws/service.ts +2994 -0
  150. package/platform/src/components/aws/sns-topic-lambda-subscriber.ts +127 -0
  151. package/platform/src/components/aws/sns-topic-queue-subscriber.ts +105 -0
  152. package/platform/src/components/aws/sns-topic.ts +700 -0
  153. package/platform/src/components/aws/solid-start.ts +467 -0
  154. package/platform/src/components/aws/ssr-site.ts +2204 -0
  155. package/platform/src/components/aws/static-site.ts +1389 -0
  156. package/platform/src/components/aws/step-functions/choice.ts +123 -0
  157. package/platform/src/components/aws/step-functions/fail.ts +69 -0
  158. package/platform/src/components/aws/step-functions/map.ts +264 -0
  159. package/platform/src/components/aws/step-functions/parallel.ts +170 -0
  160. package/platform/src/components/aws/step-functions/pass.ts +48 -0
  161. package/platform/src/components/aws/step-functions/state.ts +376 -0
  162. package/platform/src/components/aws/step-functions/succeed.ts +31 -0
  163. package/platform/src/components/aws/step-functions/task.ts +538 -0
  164. package/platform/src/components/aws/step-functions/wait.ts +105 -0
  165. package/platform/src/components/aws/step-functions.ts +804 -0
  166. package/platform/src/components/aws/svelte-kit.ts +563 -0
  167. package/platform/src/components/aws/takeover/alb.ts +9 -0
  168. package/platform/src/components/aws/takeover/apigatewayv2.ts +43 -0
  169. package/platform/src/components/aws/takeover/app-sync.ts +45 -0
  170. package/platform/src/components/aws/takeover/aurora.ts +19 -0
  171. package/platform/src/components/aws/takeover/bucket.ts +94 -0
  172. package/platform/src/components/aws/takeover/bus.ts +43 -0
  173. package/platform/src/components/aws/takeover/cognito-user-pool.ts +21 -0
  174. package/platform/src/components/aws/takeover/cron-v2.ts +9 -0
  175. package/platform/src/components/aws/takeover/dsql.ts +12 -0
  176. package/platform/src/components/aws/takeover/dynamo.ts +31 -0
  177. package/platform/src/components/aws/takeover/efs.ts +9 -0
  178. package/platform/src/components/aws/takeover/function.ts +21 -0
  179. package/platform/src/components/aws/takeover/helpers.ts +26 -0
  180. package/platform/src/components/aws/takeover/index.ts +27 -0
  181. package/platform/src/components/aws/takeover/mysql.ts +17 -0
  182. package/platform/src/components/aws/takeover/postgres.ts +17 -0
  183. package/platform/src/components/aws/takeover/queue.ts +21 -0
  184. package/platform/src/components/aws/takeover/redis.ts +10 -0
  185. package/platform/src/components/aws/takeover/service.ts +22 -0
  186. package/platform/src/components/aws/takeover/sns-topic.ts +27 -0
  187. package/platform/src/components/aws/takeover/task.ts +13 -0
  188. package/platform/src/components/aws/tan-stack-start.ts +479 -0
  189. package/platform/src/components/aws/task.ts +571 -0
  190. package/platform/src/components/aws/v5/alb.ts +310 -0
  191. package/platform/src/components/aws/v5/apigatewayv2.ts +845 -0
  192. package/platform/src/components/aws/v5/app-sync.ts +673 -0
  193. package/platform/src/components/aws/v5/aurora.ts +855 -0
  194. package/platform/src/components/aws/v5/bucket.ts +1001 -0
  195. package/platform/src/components/aws/v5/bus.ts +321 -0
  196. package/platform/src/components/aws/v5/cluster.ts +230 -0
  197. package/platform/src/components/aws/v5/cognito-user-pool-client.ts +100 -0
  198. package/platform/src/components/aws/v5/cognito-user-pool.ts +693 -0
  199. package/platform/src/components/aws/v5/cron-v2.ts +316 -0
  200. package/platform/src/components/aws/v5/dsql.ts +665 -0
  201. package/platform/src/components/aws/v5/dynamo.ts +477 -0
  202. package/platform/src/components/aws/v5/efs.ts +311 -0
  203. package/platform/src/components/aws/v5/function.ts +1546 -0
  204. package/platform/src/components/aws/v5/index.ts +26 -0
  205. package/platform/src/components/aws/v5/mysql.ts +604 -0
  206. package/platform/src/components/aws/v5/postgres.ts +612 -0
  207. package/platform/src/components/aws/v5/queue.ts +271 -0
  208. package/platform/src/components/aws/v5/redis.ts +550 -0
  209. package/platform/src/components/aws/v5/service.ts +2209 -0
  210. package/platform/src/components/aws/v5/sns-topic.ts +284 -0
  211. package/platform/src/components/aws/v5/task.ts +549 -0
  212. package/platform/src/components/aws/vector.ts +316 -0
  213. package/platform/src/components/aws/vpc-v1.ts +580 -0
  214. package/platform/src/components/aws/vpc.ts +1641 -0
  215. package/platform/src/components/aws/workflow.ts +421 -0
  216. package/platform/src/components/base/base-site.ts +101 -0
  217. package/platform/src/components/base/base-ssr-site.ts +120 -0
  218. package/platform/src/components/base/base-static-site.ts +314 -0
  219. package/platform/src/components/cloudflare/account-id.ts +1 -0
  220. package/platform/src/components/cloudflare/ai.ts +77 -0
  221. package/platform/src/components/cloudflare/astro.ts +355 -0
  222. package/platform/src/components/cloudflare/auth.ts +69 -0
  223. package/platform/src/components/cloudflare/binding.ts +132 -0
  224. package/platform/src/components/cloudflare/bucket.ts +142 -0
  225. package/platform/src/components/cloudflare/cron.ts +207 -0
  226. package/platform/src/components/cloudflare/d1.ts +230 -0
  227. package/platform/src/components/cloudflare/dns.ts +253 -0
  228. package/platform/src/components/cloudflare/durable-object.ts +144 -0
  229. package/platform/src/components/cloudflare/experimental/index.ts +3 -0
  230. package/platform/src/components/cloudflare/experimental/solid-start.ts +288 -0
  231. package/platform/src/components/cloudflare/experimental/static-site.ts +4 -0
  232. package/platform/src/components/cloudflare/helpers/compatibility.ts +44 -0
  233. package/platform/src/components/cloudflare/helpers/fetch.ts +81 -0
  234. package/platform/src/components/cloudflare/helpers/validation.ts +74 -0
  235. package/platform/src/components/cloudflare/helpers/worker-builder.ts +57 -0
  236. package/platform/src/components/cloudflare/helpers/wrangler.ts +222 -0
  237. package/platform/src/components/cloudflare/hyperdrive.ts +402 -0
  238. package/platform/src/components/cloudflare/index.ts +25 -0
  239. package/platform/src/components/cloudflare/kv.ts +218 -0
  240. package/platform/src/components/cloudflare/providers/dns-record.ts +43 -0
  241. package/platform/src/components/cloudflare/providers/kv-data.ts +107 -0
  242. package/platform/src/components/cloudflare/providers/worker-assets.ts +41 -0
  243. package/platform/src/components/cloudflare/providers/worker-placement.ts +93 -0
  244. package/platform/src/components/cloudflare/providers/worker-script.ts +47 -0
  245. package/platform/src/components/cloudflare/providers/worker-url.ts +109 -0
  246. package/platform/src/components/cloudflare/providers/zone-lookup.ts +85 -0
  247. package/platform/src/components/cloudflare/queue-worker-subscriber.ts +192 -0
  248. package/platform/src/components/cloudflare/queue.ts +310 -0
  249. package/platform/src/components/cloudflare/rate-limit.ts +178 -0
  250. package/platform/src/components/cloudflare/react-router.ts +322 -0
  251. package/platform/src/components/cloudflare/ssr-site.ts +293 -0
  252. package/platform/src/components/cloudflare/static-site-v2.ts +428 -0
  253. package/platform/src/components/cloudflare/static-site.ts +470 -0
  254. package/platform/src/components/cloudflare/tan-stack-start.ts +408 -0
  255. package/platform/src/components/cloudflare/worker.ts +1080 -0
  256. package/platform/src/components/cloudflare/workflow.ts +319 -0
  257. package/platform/src/components/component.ts +242 -0
  258. package/platform/src/components/core.ts +43 -0
  259. package/platform/src/components/cpu.ts +10 -0
  260. package/platform/src/components/dns.ts +82 -0
  261. package/platform/src/components/duration.ts +67 -0
  262. package/platform/src/components/error.ts +5 -0
  263. package/platform/src/components/esbuild.ts +15 -0
  264. package/platform/src/components/experimental/dev-command.ts +127 -0
  265. package/platform/src/components/experimental/index.ts +1 -0
  266. package/platform/src/components/groups.ts +9 -0
  267. package/platform/src/components/index.ts +9 -0
  268. package/platform/src/components/input.ts +2 -0
  269. package/platform/src/components/link.ts +201 -0
  270. package/platform/src/components/linkable.ts +360 -0
  271. package/platform/src/components/naming-rules.ts +299 -0
  272. package/platform/src/components/naming.ts +189 -0
  273. package/platform/src/components/parts-component.ts +662 -0
  274. package/platform/src/components/parts.ts +299 -0
  275. package/platform/src/components/path.ts +5 -0
  276. package/platform/src/components/rpc/rpc.ts +110 -0
  277. package/platform/src/components/secret.ts +159 -0
  278. package/platform/src/components/size.ts +28 -0
  279. package/platform/src/components/takeover.ts +131 -0
  280. package/platform/src/components/transform.ts +107 -0
  281. package/platform/src/components/vercel/account-id.ts +1 -0
  282. package/platform/src/components/vercel/dns.ts +171 -0
  283. package/platform/src/components/vercel/index.ts +2 -0
  284. package/platform/src/components/vercel/providers/dns-record.ts +34 -0
  285. package/platform/src/config.ts +1463 -0
  286. package/platform/src/global-aliases.d.ts +37 -0
  287. package/platform/src/global.d.ts +374 -0
  288. package/platform/src/internal.d.ts +18 -0
  289. package/platform/src/runtime/worker/unenv.d.ts +14 -0
  290. package/platform/src/runtime/worker/unenv.mjs +26 -0
  291. package/platform/src/shim/run.js +25 -0
  292. package/platform/src/testing/global.ts +83 -0
  293. package/platform/src/testing/index.ts +103 -0
  294. package/platform/src/testing/mock.ts +646 -0
  295. package/platform/src/testing/vitest.ts +36 -0
  296. package/platform/src/util/compare-semver.ts +23 -0
  297. package/platform/src/util/fs.ts +49 -0
  298. package/platform/src/util/lazy.ts +12 -0
  299. package/platform/src/util/minify.ts +10 -0
  300. package/platform/src/util/package.ts +29 -0
  301. package/platform/src/util/semaphore.ts +29 -0
  302. package/platform/src/util/warn.ts +7 -0
  303. package/platform/types/auto/run.d.ts +9 -0
  304. package/platform/types/auto/run.d.ts.map +1 -0
  305. package/platform/types/components/args.d.ts +77 -0
  306. package/platform/types/components/args.d.ts.map +1 -0
  307. package/platform/types/components/aws/alb.d.ts +283 -0
  308. package/platform/types/components/aws/alb.d.ts.map +1 -0
  309. package/platform/types/components/aws/analog.d.ts +408 -0
  310. package/platform/types/components/aws/analog.d.ts.map +1 -0
  311. package/platform/types/components/aws/apigateway-websocket-route.d.ts +74 -0
  312. package/platform/types/components/aws/apigateway-websocket-route.d.ts.map +1 -0
  313. package/platform/types/components/aws/apigateway-websocket.d.ts +560 -0
  314. package/platform/types/components/aws/apigateway-websocket.d.ts.map +1 -0
  315. package/platform/types/components/aws/apigatewayv1-api-key.d.ts +48 -0
  316. package/platform/types/components/aws/apigatewayv1-api-key.d.ts.map +1 -0
  317. package/platform/types/components/aws/apigatewayv1-authorizer.d.ts +55 -0
  318. package/platform/types/components/aws/apigatewayv1-authorizer.d.ts.map +1 -0
  319. package/platform/types/components/aws/apigatewayv1-base-route.d.ts +36 -0
  320. package/platform/types/components/aws/apigatewayv1-base-route.d.ts.map +1 -0
  321. package/platform/types/components/aws/apigatewayv1-integration-route.d.ts +39 -0
  322. package/platform/types/components/aws/apigatewayv1-integration-route.d.ts.map +1 -0
  323. package/platform/types/components/aws/apigatewayv1-lambda-route.d.ts +53 -0
  324. package/platform/types/components/aws/apigatewayv1-lambda-route.d.ts.map +1 -0
  325. package/platform/types/components/aws/apigatewayv1-usage-plan.d.ts +53 -0
  326. package/platform/types/components/aws/apigatewayv1-usage-plan.d.ts.map +1 -0
  327. package/platform/types/components/aws/apigatewayv1.d.ts +1028 -0
  328. package/platform/types/components/aws/apigatewayv1.d.ts.map +1 -0
  329. package/platform/types/components/aws/apigatewayv2-authorizer.d.ts +54 -0
  330. package/platform/types/components/aws/apigatewayv2-authorizer.d.ts.map +1 -0
  331. package/platform/types/components/aws/apigatewayv2-base-route.d.ts +28 -0
  332. package/platform/types/components/aws/apigatewayv2-base-route.d.ts.map +1 -0
  333. package/platform/types/components/aws/apigatewayv2-lambda-route.d.ts +59 -0
  334. package/platform/types/components/aws/apigatewayv2-lambda-route.d.ts.map +1 -0
  335. package/platform/types/components/aws/apigatewayv2-private-route.d.ts +54 -0
  336. package/platform/types/components/aws/apigatewayv2-private-route.d.ts.map +1 -0
  337. package/platform/types/components/aws/apigatewayv2-url-route.d.ts +44 -0
  338. package/platform/types/components/aws/apigatewayv2-url-route.d.ts.map +1 -0
  339. package/platform/types/components/aws/apigatewayv2.d.ts +955 -0
  340. package/platform/types/components/aws/apigatewayv2.d.ts.map +1 -0
  341. package/platform/types/components/aws/app-sync-data-source.d.ts +52 -0
  342. package/platform/types/components/aws/app-sync-data-source.d.ts.map +1 -0
  343. package/platform/types/components/aws/app-sync-function.d.ts +33 -0
  344. package/platform/types/components/aws/app-sync-function.d.ts.map +1 -0
  345. package/platform/types/components/aws/app-sync-resolver.d.ts +41 -0
  346. package/platform/types/components/aws/app-sync-resolver.d.ts.map +1 -0
  347. package/platform/types/components/aws/app-sync.d.ts +638 -0
  348. package/platform/types/components/aws/app-sync.d.ts.map +1 -0
  349. package/platform/types/components/aws/astro.d.ts +409 -0
  350. package/platform/types/components/aws/astro.d.ts.map +1 -0
  351. package/platform/types/components/aws/aurora.d.ts +720 -0
  352. package/platform/types/components/aws/aurora.d.ts.map +1 -0
  353. package/platform/types/components/aws/auth-v1.d.ts +26 -0
  354. package/platform/types/components/aws/auth-v1.d.ts.map +1 -0
  355. package/platform/types/components/aws/auth.d.ts +295 -0
  356. package/platform/types/components/aws/auth.d.ts.map +1 -0
  357. package/platform/types/components/aws/bucket-lambda-subscriber.d.ts +61 -0
  358. package/platform/types/components/aws/bucket-lambda-subscriber.d.ts.map +1 -0
  359. package/platform/types/components/aws/bucket-notification.d.ts +47 -0
  360. package/platform/types/components/aws/bucket-notification.d.ts.map +1 -0
  361. package/platform/types/components/aws/bucket-queue-subscriber.d.ts +55 -0
  362. package/platform/types/components/aws/bucket-queue-subscriber.d.ts.map +1 -0
  363. package/platform/types/components/aws/bucket-topic-subscriber.d.ts +55 -0
  364. package/platform/types/components/aws/bucket-topic-subscriber.d.ts.map +1 -0
  365. package/platform/types/components/aws/bucket.d.ts +1356 -0
  366. package/platform/types/components/aws/bucket.d.ts.map +1 -0
  367. package/platform/types/components/aws/bus-base-subscriber.d.ts +20 -0
  368. package/platform/types/components/aws/bus-base-subscriber.d.ts.map +1 -0
  369. package/platform/types/components/aws/bus-lambda-subscriber.d.ts +50 -0
  370. package/platform/types/components/aws/bus-lambda-subscriber.d.ts.map +1 -0
  371. package/platform/types/components/aws/bus-queue-subscriber.d.ts +44 -0
  372. package/platform/types/components/aws/bus-queue-subscriber.d.ts.map +1 -0
  373. package/platform/types/components/aws/bus.d.ts +447 -0
  374. package/platform/types/components/aws/bus.d.ts.map +1 -0
  375. package/platform/types/components/aws/cdn.d.ts +310 -0
  376. package/platform/types/components/aws/cdn.d.ts.map +1 -0
  377. package/platform/types/components/aws/cluster-v1.d.ts +885 -0
  378. package/platform/types/components/aws/cluster-v1.d.ts.map +1 -0
  379. package/platform/types/components/aws/cluster.d.ts +364 -0
  380. package/platform/types/components/aws/cluster.d.ts.map +1 -0
  381. package/platform/types/components/aws/cognito-identity-pool.d.ts +199 -0
  382. package/platform/types/components/aws/cognito-identity-pool.d.ts.map +1 -0
  383. package/platform/types/components/aws/cognito-identity-provider.d.ts +38 -0
  384. package/platform/types/components/aws/cognito-identity-provider.d.ts.map +1 -0
  385. package/platform/types/components/aws/cognito-user-pool-client.d.ts +50 -0
  386. package/platform/types/components/aws/cognito-user-pool-client.d.ts.map +1 -0
  387. package/platform/types/components/aws/cognito-user-pool.d.ts +703 -0
  388. package/platform/types/components/aws/cognito-user-pool.d.ts.map +1 -0
  389. package/platform/types/components/aws/cron-v2.d.ts +325 -0
  390. package/platform/types/components/aws/cron-v2.d.ts.map +1 -0
  391. package/platform/types/components/aws/cron.d.ts +259 -0
  392. package/platform/types/components/aws/cron.d.ts.map +1 -0
  393. package/platform/types/components/aws/dns-validated-certificate.d.ts +27 -0
  394. package/platform/types/components/aws/dns-validated-certificate.d.ts.map +1 -0
  395. package/platform/types/components/aws/dns.d.ts +94 -0
  396. package/platform/types/components/aws/dns.d.ts.map +1 -0
  397. package/platform/types/components/aws/dsql.d.ts +369 -0
  398. package/platform/types/components/aws/dsql.d.ts.map +1 -0
  399. package/platform/types/components/aws/dynamo-lambda-subscriber.d.ts +55 -0
  400. package/platform/types/components/aws/dynamo-lambda-subscriber.d.ts.map +1 -0
  401. package/platform/types/components/aws/dynamo.d.ts +628 -0
  402. package/platform/types/components/aws/dynamo.d.ts.map +1 -0
  403. package/platform/types/components/aws/efs.d.ts +217 -0
  404. package/platform/types/components/aws/efs.d.ts.map +1 -0
  405. package/platform/types/components/aws/email.d.ts +370 -0
  406. package/platform/types/components/aws/email.d.ts.map +1 -0
  407. package/platform/types/components/aws/fargate.d.ts +894 -0
  408. package/platform/types/components/aws/fargate.d.ts.map +1 -0
  409. package/platform/types/components/aws/function.d.ts +1780 -0
  410. package/platform/types/components/aws/function.d.ts.map +1 -0
  411. package/platform/types/components/aws/helpers/apigateway-account.d.ts +3 -0
  412. package/platform/types/components/aws/helpers/apigateway-account.d.ts.map +1 -0
  413. package/platform/types/components/aws/helpers/apigatewayv2-domain.d.ts +144 -0
  414. package/platform/types/components/aws/helpers/apigatewayv2-domain.d.ts.map +1 -0
  415. package/platform/types/components/aws/helpers/arn.d.ts +51 -0
  416. package/platform/types/components/aws/helpers/arn.d.ts.map +1 -0
  417. package/platform/types/components/aws/helpers/bootstrap.d.ts +13 -0
  418. package/platform/types/components/aws/helpers/bootstrap.d.ts.map +1 -0
  419. package/platform/types/components/aws/helpers/client.d.ts +7 -0
  420. package/platform/types/components/aws/helpers/client.d.ts.map +1 -0
  421. package/platform/types/components/aws/helpers/container-builder.d.ts +4 -0
  422. package/platform/types/components/aws/helpers/container-builder.d.ts.map +1 -0
  423. package/platform/types/components/aws/helpers/custom-domain.d.ts +111 -0
  424. package/platform/types/components/aws/helpers/custom-domain.d.ts.map +1 -0
  425. package/platform/types/components/aws/helpers/event-source.d.ts +26 -0
  426. package/platform/types/components/aws/helpers/event-source.d.ts.map +1 -0
  427. package/platform/types/components/aws/helpers/fargate.d.ts +225 -0
  428. package/platform/types/components/aws/helpers/fargate.d.ts.map +1 -0
  429. package/platform/types/components/aws/helpers/function-builder.d.ts +14 -0
  430. package/platform/types/components/aws/helpers/function-builder.d.ts.map +1 -0
  431. package/platform/types/components/aws/helpers/function-code.d.ts +80 -0
  432. package/platform/types/components/aws/helpers/function-code.d.ts.map +1 -0
  433. package/platform/types/components/aws/helpers/function-part.d.ts +61 -0
  434. package/platform/types/components/aws/helpers/function-part.d.ts.map +1 -0
  435. package/platform/types/components/aws/helpers/function-permission.d.ts +17 -0
  436. package/platform/types/components/aws/helpers/function-permission.d.ts.map +1 -0
  437. package/platform/types/components/aws/helpers/load-balancer-args.d.ts +40 -0
  438. package/platform/types/components/aws/helpers/load-balancer-args.d.ts.map +1 -0
  439. package/platform/types/components/aws/helpers/load-balancer.d.ts +9 -0
  440. package/platform/types/components/aws/helpers/load-balancer.d.ts.map +1 -0
  441. package/platform/types/components/aws/helpers/provider.d.ts +3 -0
  442. package/platform/types/components/aws/helpers/provider.d.ts.map +1 -0
  443. package/platform/types/components/aws/helpers/queue-policy.d.ts +11 -0
  444. package/platform/types/components/aws/helpers/queue-policy.d.ts.map +1 -0
  445. package/platform/types/components/aws/helpers/rds.d.ts +98 -0
  446. package/platform/types/components/aws/helpers/rds.d.ts.map +1 -0
  447. package/platform/types/components/aws/helpers/site-builder.d.ts +4 -0
  448. package/platform/types/components/aws/helpers/site-builder.d.ts.map +1 -0
  449. package/platform/types/components/aws/helpers/subscriber.d.ts +6 -0
  450. package/platform/types/components/aws/helpers/subscriber.d.ts.map +1 -0
  451. package/platform/types/components/aws/helpers/vpc.d.ts +14 -0
  452. package/platform/types/components/aws/helpers/vpc.d.ts.map +1 -0
  453. package/platform/types/components/aws/https-redirect.d.ts +38 -0
  454. package/platform/types/components/aws/https-redirect.d.ts.map +1 -0
  455. package/platform/types/components/aws/iam-edit.d.ts +39 -0
  456. package/platform/types/components/aws/iam-edit.d.ts.map +1 -0
  457. package/platform/types/components/aws/index.d.ts +56 -0
  458. package/platform/types/components/aws/index.d.ts.map +1 -0
  459. package/platform/types/components/aws/kinesis-stream-lambda-subscriber.d.ts +49 -0
  460. package/platform/types/components/aws/kinesis-stream-lambda-subscriber.d.ts.map +1 -0
  461. package/platform/types/components/aws/kinesis-stream.d.ts +254 -0
  462. package/platform/types/components/aws/kinesis-stream.d.ts.map +1 -0
  463. package/platform/types/components/aws/linkable.d.ts +17 -0
  464. package/platform/types/components/aws/linkable.d.ts.map +1 -0
  465. package/platform/types/components/aws/logging.d.ts +26 -0
  466. package/platform/types/components/aws/logging.d.ts.map +1 -0
  467. package/platform/types/components/aws/microvm.d.ts +439 -0
  468. package/platform/types/components/aws/microvm.d.ts.map +1 -0
  469. package/platform/types/components/aws/mysql.d.ts +528 -0
  470. package/platform/types/components/aws/mysql.d.ts.map +1 -0
  471. package/platform/types/components/aws/nextjs.d.ts +534 -0
  472. package/platform/types/components/aws/nextjs.d.ts.map +1 -0
  473. package/platform/types/components/aws/nuxt.d.ts +480 -0
  474. package/platform/types/components/aws/nuxt.d.ts.map +1 -0
  475. package/platform/types/components/aws/open-search.d.ts +306 -0
  476. package/platform/types/components/aws/open-search.d.ts.map +1 -0
  477. package/platform/types/components/aws/opencontrol.d.ts +169 -0
  478. package/platform/types/components/aws/opencontrol.d.ts.map +1 -0
  479. package/platform/types/components/aws/permission.d.ts +80 -0
  480. package/platform/types/components/aws/permission.d.ts.map +1 -0
  481. package/platform/types/components/aws/postgres-v1.d.ts +328 -0
  482. package/platform/types/components/aws/postgres-v1.d.ts.map +1 -0
  483. package/platform/types/components/aws/postgres.d.ts +529 -0
  484. package/platform/types/components/aws/postgres.d.ts.map +1 -0
  485. package/platform/types/components/aws/providers/bucket-files.d.ts +18 -0
  486. package/platform/types/components/aws/providers/bucket-files.d.ts.map +1 -0
  487. package/platform/types/components/aws/providers/distribution-deployment-waiter.d.ts +13 -0
  488. package/platform/types/components/aws/providers/distribution-deployment-waiter.d.ts.map +1 -0
  489. package/platform/types/components/aws/providers/distribution-invalidation.d.ts +11 -0
  490. package/platform/types/components/aws/providers/distribution-invalidation.d.ts.map +1 -0
  491. package/platform/types/components/aws/providers/function-environment-update.d.ts +33 -0
  492. package/platform/types/components/aws/providers/function-environment-update.d.ts.map +1 -0
  493. package/platform/types/components/aws/providers/hosted-zone-lookup.d.ts +11 -0
  494. package/platform/types/components/aws/providers/hosted-zone-lookup.d.ts.map +1 -0
  495. package/platform/types/components/aws/providers/kv-keys.d.ts +11 -0
  496. package/platform/types/components/aws/providers/kv-keys.d.ts.map +1 -0
  497. package/platform/types/components/aws/providers/kv-routes-update.d.ts +11 -0
  498. package/platform/types/components/aws/providers/kv-routes-update.d.ts.map +1 -0
  499. package/platform/types/components/aws/providers/microvm-image-prune.d.ts +35 -0
  500. package/platform/types/components/aws/providers/microvm-image-prune.d.ts.map +1 -0
  501. package/platform/types/components/aws/providers/origin-access-control.d.ts +8 -0
  502. package/platform/types/components/aws/providers/origin-access-control.d.ts.map +1 -0
  503. package/platform/types/components/aws/providers/rds-role-lookup.d.ts +8 -0
  504. package/platform/types/components/aws/providers/rds-role-lookup.d.ts.map +1 -0
  505. package/platform/types/components/aws/providers/vector-table.d.ts +12 -0
  506. package/platform/types/components/aws/providers/vector-table.d.ts.map +1 -0
  507. package/platform/types/components/aws/queue-lambda-subscriber.d.ts +53 -0
  508. package/platform/types/components/aws/queue-lambda-subscriber.d.ts.map +1 -0
  509. package/platform/types/components/aws/queue.d.ts +494 -0
  510. package/platform/types/components/aws/queue.d.ts.map +1 -0
  511. package/platform/types/components/aws/react.d.ts +407 -0
  512. package/platform/types/components/aws/react.d.ts.map +1 -0
  513. package/platform/types/components/aws/realtime-lambda-subscriber.d.ts +53 -0
  514. package/platform/types/components/aws/realtime-lambda-subscriber.d.ts.map +1 -0
  515. package/platform/types/components/aws/realtime.d.ts +237 -0
  516. package/platform/types/components/aws/realtime.d.ts.map +1 -0
  517. package/platform/types/components/aws/redis-v1.d.ts +348 -0
  518. package/platform/types/components/aws/redis-v1.d.ts.map +1 -0
  519. package/platform/types/components/aws/redis.d.ts +545 -0
  520. package/platform/types/components/aws/redis.d.ts.map +1 -0
  521. package/platform/types/components/aws/remix.d.ts +408 -0
  522. package/platform/types/components/aws/remix.d.ts.map +1 -0
  523. package/platform/types/components/aws/router-base-route.d.ts +28 -0
  524. package/platform/types/components/aws/router-base-route.d.ts.map +1 -0
  525. package/platform/types/components/aws/router-bucket-route.d.ts +29 -0
  526. package/platform/types/components/aws/router-bucket-route.d.ts.map +1 -0
  527. package/platform/types/components/aws/router-url-route.d.ts +28 -0
  528. package/platform/types/components/aws/router-url-route.d.ts.map +1 -0
  529. package/platform/types/components/aws/router.d.ts +1767 -0
  530. package/platform/types/components/aws/router.d.ts.map +1 -0
  531. package/platform/types/components/aws/service-v1.d.ts +78 -0
  532. package/platform/types/components/aws/service-v1.d.ts.map +1 -0
  533. package/platform/types/components/aws/service.d.ts +1756 -0
  534. package/platform/types/components/aws/service.d.ts.map +1 -0
  535. package/platform/types/components/aws/sns-topic-lambda-subscriber.d.ts +53 -0
  536. package/platform/types/components/aws/sns-topic-lambda-subscriber.d.ts.map +1 -0
  537. package/platform/types/components/aws/sns-topic-queue-subscriber.d.ts +55 -0
  538. package/platform/types/components/aws/sns-topic-queue-subscriber.d.ts.map +1 -0
  539. package/platform/types/components/aws/sns-topic.d.ts +394 -0
  540. package/platform/types/components/aws/sns-topic.d.ts.map +1 -0
  541. package/platform/types/components/aws/solid-start.d.ts +399 -0
  542. package/platform/types/components/aws/solid-start.d.ts.map +1 -0
  543. package/platform/types/components/aws/ssr-site.d.ts +895 -0
  544. package/platform/types/components/aws/ssr-site.d.ts.map +1 -0
  545. package/platform/types/components/aws/static-site.d.ts +744 -0
  546. package/platform/types/components/aws/static-site.d.ts.map +1 -0
  547. package/platform/types/components/aws/step-functions/choice.d.ts +73 -0
  548. package/platform/types/components/aws/step-functions/choice.d.ts.map +1 -0
  549. package/platform/types/components/aws/step-functions/fail.d.ts +63 -0
  550. package/platform/types/components/aws/step-functions/fail.d.ts.map +1 -0
  551. package/platform/types/components/aws/step-functions/map.d.ts +236 -0
  552. package/platform/types/components/aws/step-functions/map.d.ts.map +1 -0
  553. package/platform/types/components/aws/step-functions/parallel.d.ts +127 -0
  554. package/platform/types/components/aws/step-functions/parallel.d.ts.map +1 -0
  555. package/platform/types/components/aws/step-functions/pass.d.ts +39 -0
  556. package/platform/types/components/aws/step-functions/pass.d.ts.map +1 -0
  557. package/platform/types/components/aws/step-functions/state.d.ts +231 -0
  558. package/platform/types/components/aws/step-functions/state.d.ts.map +1 -0
  559. package/platform/types/components/aws/step-functions/succeed.d.ts +26 -0
  560. package/platform/types/components/aws/step-functions/succeed.d.ts.map +1 -0
  561. package/platform/types/components/aws/step-functions/task.d.ts +485 -0
  562. package/platform/types/components/aws/step-functions/task.d.ts.map +1 -0
  563. package/platform/types/components/aws/step-functions/wait.d.ts +91 -0
  564. package/platform/types/components/aws/step-functions/wait.d.ts.map +1 -0
  565. package/platform/types/components/aws/step-functions.d.ts +478 -0
  566. package/platform/types/components/aws/step-functions.d.ts.map +1 -0
  567. package/platform/types/components/aws/svelte-kit.d.ts +456 -0
  568. package/platform/types/components/aws/svelte-kit.d.ts.map +1 -0
  569. package/platform/types/components/aws/takeover/alb.d.ts +2 -0
  570. package/platform/types/components/aws/takeover/alb.d.ts.map +1 -0
  571. package/platform/types/components/aws/takeover/apigatewayv2.d.ts +2 -0
  572. package/platform/types/components/aws/takeover/apigatewayv2.d.ts.map +1 -0
  573. package/platform/types/components/aws/takeover/app-sync.d.ts +2 -0
  574. package/platform/types/components/aws/takeover/app-sync.d.ts.map +1 -0
  575. package/platform/types/components/aws/takeover/aurora.d.ts +2 -0
  576. package/platform/types/components/aws/takeover/aurora.d.ts.map +1 -0
  577. package/platform/types/components/aws/takeover/bucket.d.ts +2 -0
  578. package/platform/types/components/aws/takeover/bucket.d.ts.map +1 -0
  579. package/platform/types/components/aws/takeover/bus.d.ts +2 -0
  580. package/platform/types/components/aws/takeover/bus.d.ts.map +1 -0
  581. package/platform/types/components/aws/takeover/cognito-user-pool.d.ts +2 -0
  582. package/platform/types/components/aws/takeover/cognito-user-pool.d.ts.map +1 -0
  583. package/platform/types/components/aws/takeover/cron-v2.d.ts +2 -0
  584. package/platform/types/components/aws/takeover/cron-v2.d.ts.map +1 -0
  585. package/platform/types/components/aws/takeover/dsql.d.ts +2 -0
  586. package/platform/types/components/aws/takeover/dsql.d.ts.map +1 -0
  587. package/platform/types/components/aws/takeover/dynamo.d.ts +2 -0
  588. package/platform/types/components/aws/takeover/dynamo.d.ts.map +1 -0
  589. package/platform/types/components/aws/takeover/efs.d.ts +2 -0
  590. package/platform/types/components/aws/takeover/efs.d.ts.map +1 -0
  591. package/platform/types/components/aws/takeover/function.d.ts +2 -0
  592. package/platform/types/components/aws/takeover/function.d.ts.map +1 -0
  593. package/platform/types/components/aws/takeover/helpers.d.ts +16 -0
  594. package/platform/types/components/aws/takeover/helpers.d.ts.map +1 -0
  595. package/platform/types/components/aws/takeover/index.d.ts +28 -0
  596. package/platform/types/components/aws/takeover/index.d.ts.map +1 -0
  597. package/platform/types/components/aws/takeover/mysql.d.ts +2 -0
  598. package/platform/types/components/aws/takeover/mysql.d.ts.map +1 -0
  599. package/platform/types/components/aws/takeover/postgres.d.ts +2 -0
  600. package/platform/types/components/aws/takeover/postgres.d.ts.map +1 -0
  601. package/platform/types/components/aws/takeover/queue.d.ts +2 -0
  602. package/platform/types/components/aws/takeover/queue.d.ts.map +1 -0
  603. package/platform/types/components/aws/takeover/redis.d.ts +2 -0
  604. package/platform/types/components/aws/takeover/redis.d.ts.map +1 -0
  605. package/platform/types/components/aws/takeover/service.d.ts +2 -0
  606. package/platform/types/components/aws/takeover/service.d.ts.map +1 -0
  607. package/platform/types/components/aws/takeover/sns-topic.d.ts +2 -0
  608. package/platform/types/components/aws/takeover/sns-topic.d.ts.map +1 -0
  609. package/platform/types/components/aws/takeover/task.d.ts +2 -0
  610. package/platform/types/components/aws/takeover/task.d.ts.map +1 -0
  611. package/platform/types/components/aws/tan-stack-start.d.ts +359 -0
  612. package/platform/types/components/aws/tan-stack-start.d.ts.map +1 -0
  613. package/platform/types/components/aws/task.d.ts +342 -0
  614. package/platform/types/components/aws/task.d.ts.map +1 -0
  615. package/platform/types/components/aws/v5/alb.d.ts +177 -0
  616. package/platform/types/components/aws/v5/alb.d.ts.map +1 -0
  617. package/platform/types/components/aws/v5/apigatewayv2.d.ts +482 -0
  618. package/platform/types/components/aws/v5/apigatewayv2.d.ts.map +1 -0
  619. package/platform/types/components/aws/v5/app-sync.d.ts +424 -0
  620. package/platform/types/components/aws/v5/app-sync.d.ts.map +1 -0
  621. package/platform/types/components/aws/v5/aurora.d.ts +459 -0
  622. package/platform/types/components/aws/v5/aurora.d.ts.map +1 -0
  623. package/platform/types/components/aws/v5/bucket.d.ts +578 -0
  624. package/platform/types/components/aws/v5/bucket.d.ts.map +1 -0
  625. package/platform/types/components/aws/v5/bus.d.ts +255 -0
  626. package/platform/types/components/aws/v5/bus.d.ts.map +1 -0
  627. package/platform/types/components/aws/v5/cluster.d.ts +167 -0
  628. package/platform/types/components/aws/v5/cluster.d.ts.map +1 -0
  629. package/platform/types/components/aws/v5/cognito-user-pool-client.d.ts +69 -0
  630. package/platform/types/components/aws/v5/cognito-user-pool-client.d.ts.map +1 -0
  631. package/platform/types/components/aws/v5/cognito-user-pool.d.ts +396 -0
  632. package/platform/types/components/aws/v5/cognito-user-pool.d.ts.map +1 -0
  633. package/platform/types/components/aws/v5/cron-v2.d.ts +206 -0
  634. package/platform/types/components/aws/v5/cron-v2.d.ts.map +1 -0
  635. package/platform/types/components/aws/v5/dsql.d.ts +453 -0
  636. package/platform/types/components/aws/v5/dsql.d.ts.map +1 -0
  637. package/platform/types/components/aws/v5/dynamo.d.ts +328 -0
  638. package/platform/types/components/aws/v5/dynamo.d.ts.map +1 -0
  639. package/platform/types/components/aws/v5/efs.d.ts +178 -0
  640. package/platform/types/components/aws/v5/efs.d.ts.map +1 -0
  641. package/platform/types/components/aws/v5/function.d.ts +586 -0
  642. package/platform/types/components/aws/v5/function.d.ts.map +1 -0
  643. package/platform/types/components/aws/v5/index.d.ts +27 -0
  644. package/platform/types/components/aws/v5/index.d.ts.map +1 -0
  645. package/platform/types/components/aws/v5/mysql.d.ts +347 -0
  646. package/platform/types/components/aws/v5/mysql.d.ts.map +1 -0
  647. package/platform/types/components/aws/v5/postgres.d.ts +348 -0
  648. package/platform/types/components/aws/v5/postgres.d.ts.map +1 -0
  649. package/platform/types/components/aws/v5/queue.d.ts +190 -0
  650. package/platform/types/components/aws/v5/queue.d.ts.map +1 -0
  651. package/platform/types/components/aws/v5/redis.d.ts +214 -0
  652. package/platform/types/components/aws/v5/redis.d.ts.map +1 -0
  653. package/platform/types/components/aws/v5/service.d.ts +1347 -0
  654. package/platform/types/components/aws/v5/service.d.ts.map +1 -0
  655. package/platform/types/components/aws/v5/sns-topic.d.ts +226 -0
  656. package/platform/types/components/aws/v5/sns-topic.d.ts.map +1 -0
  657. package/platform/types/components/aws/v5/task.d.ts +346 -0
  658. package/platform/types/components/aws/v5/task.d.ts.map +1 -0
  659. package/platform/types/components/aws/vector.d.ts +163 -0
  660. package/platform/types/components/aws/vector.d.ts.map +1 -0
  661. package/platform/types/components/aws/vpc-v1.d.ts +208 -0
  662. package/platform/types/components/aws/vpc-v1.d.ts.map +1 -0
  663. package/platform/types/components/aws/vpc.d.ts +491 -0
  664. package/platform/types/components/aws/vpc.d.ts.map +1 -0
  665. package/platform/types/components/aws/workflow.d.ts +331 -0
  666. package/platform/types/components/aws/workflow.d.ts.map +1 -0
  667. package/platform/types/components/base/base-site.d.ts +53 -0
  668. package/platform/types/components/base/base-site.d.ts.map +1 -0
  669. package/platform/types/components/base/base-ssr-site.d.ts +13 -0
  670. package/platform/types/components/base/base-ssr-site.d.ts.map +1 -0
  671. package/platform/types/components/base/base-static-site.d.ts +199 -0
  672. package/platform/types/components/base/base-static-site.d.ts.map +1 -0
  673. package/platform/types/components/cloudflare/account-id.d.ts +2 -0
  674. package/platform/types/components/cloudflare/account-id.d.ts.map +1 -0
  675. package/platform/types/components/cloudflare/ai.d.ts +68 -0
  676. package/platform/types/components/cloudflare/ai.d.ts.map +1 -0
  677. package/platform/types/components/cloudflare/astro.d.ts +249 -0
  678. package/platform/types/components/cloudflare/astro.d.ts.map +1 -0
  679. package/platform/types/components/cloudflare/auth.d.ts +22 -0
  680. package/platform/types/components/cloudflare/auth.d.ts.map +1 -0
  681. package/platform/types/components/cloudflare/binding.d.ts +109 -0
  682. package/platform/types/components/cloudflare/binding.d.ts.map +1 -0
  683. package/platform/types/components/cloudflare/bucket.d.ts +98 -0
  684. package/platform/types/components/cloudflare/bucket.d.ts.map +1 -0
  685. package/platform/types/components/cloudflare/cron.d.ts +151 -0
  686. package/platform/types/components/cloudflare/cron.d.ts.map +1 -0
  687. package/platform/types/components/cloudflare/d1.d.ts +142 -0
  688. package/platform/types/components/cloudflare/d1.d.ts.map +1 -0
  689. package/platform/types/components/cloudflare/dns.d.ts +100 -0
  690. package/platform/types/components/cloudflare/dns.d.ts.map +1 -0
  691. package/platform/types/components/cloudflare/durable-object.d.ts +125 -0
  692. package/platform/types/components/cloudflare/durable-object.d.ts.map +1 -0
  693. package/platform/types/components/cloudflare/experimental/index.d.ts +4 -0
  694. package/platform/types/components/cloudflare/experimental/index.d.ts.map +1 -0
  695. package/platform/types/components/cloudflare/experimental/solid-start.d.ts +219 -0
  696. package/platform/types/components/cloudflare/experimental/solid-start.d.ts.map +1 -0
  697. package/platform/types/components/cloudflare/experimental/static-site.d.ts +3 -0
  698. package/platform/types/components/cloudflare/experimental/static-site.d.ts.map +1 -0
  699. package/platform/types/components/cloudflare/helpers/compatibility.d.ts +21 -0
  700. package/platform/types/components/cloudflare/helpers/compatibility.d.ts.map +1 -0
  701. package/platform/types/components/cloudflare/helpers/fetch.d.ts +19 -0
  702. package/platform/types/components/cloudflare/helpers/fetch.d.ts.map +1 -0
  703. package/platform/types/components/cloudflare/helpers/validation.d.ts +15 -0
  704. package/platform/types/components/cloudflare/helpers/validation.d.ts.map +1 -0
  705. package/platform/types/components/cloudflare/helpers/worker-builder.d.ts +10 -0
  706. package/platform/types/components/cloudflare/helpers/worker-builder.d.ts.map +1 -0
  707. package/platform/types/components/cloudflare/helpers/wrangler.d.ts +31 -0
  708. package/platform/types/components/cloudflare/helpers/wrangler.d.ts.map +1 -0
  709. package/platform/types/components/cloudflare/hyperdrive.d.ts +302 -0
  710. package/platform/types/components/cloudflare/hyperdrive.d.ts.map +1 -0
  711. package/platform/types/components/cloudflare/index.d.ts +25 -0
  712. package/platform/types/components/cloudflare/index.d.ts.map +1 -0
  713. package/platform/types/components/cloudflare/kv.d.ts +140 -0
  714. package/platform/types/components/cloudflare/kv.d.ts.map +1 -0
  715. package/platform/types/components/cloudflare/providers/dns-record.d.ts +21 -0
  716. package/platform/types/components/cloudflare/providers/dns-record.d.ts.map +1 -0
  717. package/platform/types/components/cloudflare/providers/kv-data.d.ts +23 -0
  718. package/platform/types/components/cloudflare/providers/kv-data.d.ts.map +1 -0
  719. package/platform/types/components/cloudflare/providers/worker-assets.d.ts +19 -0
  720. package/platform/types/components/cloudflare/providers/worker-assets.d.ts.map +1 -0
  721. package/platform/types/components/cloudflare/providers/worker-placement.d.ts +27 -0
  722. package/platform/types/components/cloudflare/providers/worker-placement.d.ts.map +1 -0
  723. package/platform/types/components/cloudflare/providers/worker-script.d.ts +23 -0
  724. package/platform/types/components/cloudflare/providers/worker-script.d.ts.map +1 -0
  725. package/platform/types/components/cloudflare/providers/worker-url.d.ts +24 -0
  726. package/platform/types/components/cloudflare/providers/worker-url.d.ts.map +1 -0
  727. package/platform/types/components/cloudflare/providers/zone-lookup.d.ts +22 -0
  728. package/platform/types/components/cloudflare/providers/zone-lookup.d.ts.map +1 -0
  729. package/platform/types/components/cloudflare/queue-worker-subscriber.d.ts +122 -0
  730. package/platform/types/components/cloudflare/queue-worker-subscriber.d.ts.map +1 -0
  731. package/platform/types/components/cloudflare/queue.d.ts +235 -0
  732. package/platform/types/components/cloudflare/queue.d.ts.map +1 -0
  733. package/platform/types/components/cloudflare/rate-limit.d.ts +117 -0
  734. package/platform/types/components/cloudflare/rate-limit.d.ts.map +1 -0
  735. package/platform/types/components/cloudflare/react-router.d.ts +262 -0
  736. package/platform/types/components/cloudflare/react-router.d.ts.map +1 -0
  737. package/platform/types/components/cloudflare/ssr-site.d.ts +60 -0
  738. package/platform/types/components/cloudflare/ssr-site.d.ts.map +1 -0
  739. package/platform/types/components/cloudflare/static-site-v2.d.ts +302 -0
  740. package/platform/types/components/cloudflare/static-site-v2.d.ts.map +1 -0
  741. package/platform/types/components/cloudflare/static-site.d.ts +270 -0
  742. package/platform/types/components/cloudflare/static-site.d.ts.map +1 -0
  743. package/platform/types/components/cloudflare/tan-stack-start.d.ts +259 -0
  744. package/platform/types/components/cloudflare/tan-stack-start.d.ts.map +1 -0
  745. package/platform/types/components/cloudflare/worker.d.ts +483 -0
  746. package/platform/types/components/cloudflare/worker.d.ts.map +1 -0
  747. package/platform/types/components/cloudflare/workflow.d.ts +248 -0
  748. package/platform/types/components/cloudflare/workflow.d.ts.map +1 -0
  749. package/platform/types/components/component.d.ts +67 -0
  750. package/platform/types/components/component.d.ts.map +1 -0
  751. package/platform/types/components/core.d.ts +16 -0
  752. package/platform/types/components/core.d.ts.map +1 -0
  753. package/platform/types/components/cpu.d.ts +3 -0
  754. package/platform/types/components/cpu.d.ts.map +1 -0
  755. package/platform/types/components/dns.d.ts +63 -0
  756. package/platform/types/components/dns.d.ts.map +1 -0
  757. package/platform/types/components/duration.d.ts +9 -0
  758. package/platform/types/components/duration.d.ts.map +1 -0
  759. package/platform/types/components/error.d.ts +4 -0
  760. package/platform/types/components/error.d.ts.map +1 -0
  761. package/platform/types/components/esbuild.d.ts +3 -0
  762. package/platform/types/components/esbuild.d.ts.map +1 -0
  763. package/platform/types/components/experimental/dev-command.d.ts +99 -0
  764. package/platform/types/components/experimental/dev-command.d.ts.map +1 -0
  765. package/platform/types/components/experimental/index.d.ts +2 -0
  766. package/platform/types/components/experimental/index.d.ts.map +1 -0
  767. package/platform/types/components/groups.d.ts +6 -0
  768. package/platform/types/components/groups.d.ts.map +1 -0
  769. package/platform/types/components/index.d.ts +5 -0
  770. package/platform/types/components/index.d.ts.map +1 -0
  771. package/platform/types/components/input.d.ts +3 -0
  772. package/platform/types/components/input.d.ts.map +1 -0
  773. package/platform/types/components/link.d.ts +41 -0
  774. package/platform/types/components/link.d.ts.map +1 -0
  775. package/platform/types/components/linkable.d.ts +301 -0
  776. package/platform/types/components/linkable.d.ts.map +1 -0
  777. package/platform/types/components/naming-rules.d.ts +32 -0
  778. package/platform/types/components/naming-rules.d.ts.map +1 -0
  779. package/platform/types/components/naming.d.ts +21 -0
  780. package/platform/types/components/naming.d.ts.map +1 -0
  781. package/platform/types/components/parts-component.d.ts +242 -0
  782. package/platform/types/components/parts-component.d.ts.map +1 -0
  783. package/platform/types/components/parts.d.ts +194 -0
  784. package/platform/types/components/parts.d.ts.map +1 -0
  785. package/platform/types/components/path.d.ts +2 -0
  786. package/platform/types/components/path.d.ts.map +1 -0
  787. package/platform/types/components/rpc/rpc.d.ts +19 -0
  788. package/platform/types/components/rpc/rpc.d.ts.map +1 -0
  789. package/platform/types/components/secret.d.ts +123 -0
  790. package/platform/types/components/secret.d.ts.map +1 -0
  791. package/platform/types/components/size.d.ts +5 -0
  792. package/platform/types/components/size.d.ts.map +1 -0
  793. package/platform/types/components/takeover.d.ts +88 -0
  794. package/platform/types/components/takeover.d.ts.map +1 -0
  795. package/platform/types/components/transform.d.ts +34 -0
  796. package/platform/types/components/transform.d.ts.map +1 -0
  797. package/platform/types/components/vercel/account-id.d.ts +2 -0
  798. package/platform/types/components/vercel/account-id.d.ts.map +1 -0
  799. package/platform/types/components/vercel/dns.d.ts +73 -0
  800. package/platform/types/components/vercel/dns.d.ts.map +1 -0
  801. package/platform/types/components/vercel/index.d.ts +3 -0
  802. package/platform/types/components/vercel/index.d.ts.map +1 -0
  803. package/platform/types/components/vercel/providers/dns-record.d.ts +15 -0
  804. package/platform/types/components/vercel/providers/dns-record.d.ts.map +1 -0
  805. package/platform/types/config.d.ts +1440 -0
  806. package/platform/types/config.d.ts.map +1 -0
  807. package/platform/types/global-aliases.d.ts +37 -0
  808. package/platform/types/global.d.ts +374 -0
  809. package/platform/types/internal.d.ts +18 -0
  810. package/platform/types/runtime/worker/unenv.d.ts +14 -0
  811. package/platform/types/testing/global.d.ts +11 -0
  812. package/platform/types/testing/global.d.ts.map +1 -0
  813. package/platform/types/testing/index.d.ts +80 -0
  814. package/platform/types/testing/index.d.ts.map +1 -0
  815. package/platform/types/testing/mock.d.ts +136 -0
  816. package/platform/types/testing/mock.d.ts.map +1 -0
  817. package/platform/types/testing/vitest.d.ts +19 -0
  818. package/platform/types/testing/vitest.d.ts.map +1 -0
  819. package/platform/types/util/compare-semver.d.ts +4 -0
  820. package/platform/types/util/compare-semver.d.ts.map +1 -0
  821. package/platform/types/util/fs.d.ts +5 -0
  822. package/platform/types/util/fs.d.ts.map +1 -0
  823. package/platform/types/util/lazy.d.ts +2 -0
  824. package/platform/types/util/lazy.d.ts.map +1 -0
  825. package/platform/types/util/minify.d.ts +2 -0
  826. package/platform/types/util/minify.d.ts.map +1 -0
  827. package/platform/types/util/package.d.ts +10 -0
  828. package/platform/types/util/package.d.ts.map +1 -0
  829. package/platform/types/util/semaphore.d.ts +9 -0
  830. package/platform/types/util/semaphore.d.ts.map +1 -0
  831. package/platform/types/util/warn.d.ts +2 -0
  832. package/platform/types/util/warn.d.ts.map +1 -0
@@ -0,0 +1,1389 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import crypto from "crypto";
4
+ import {
5
+ ComponentResourceOptions,
6
+ Output,
7
+ Resource,
8
+ all,
9
+ interpolate,
10
+ output,
11
+ } from "@pulumi/pulumi";
12
+ import { Cdn, CdnArgs } from "./cdn.js";
13
+ import { Bucket, BucketArgs } from "./bucket.js";
14
+ import { Component, Prettify, Transform, transform } from "../component.js";
15
+ import { Link } from "../link.js";
16
+ import { Input } from "../input.js";
17
+ import { globSync } from "glob";
18
+ import { BucketFile, BucketFiles } from "./providers/bucket-files.js";
19
+ import { getContentType, BaseSiteDev } from "../base/base-site.js";
20
+ import {
21
+ BaseStaticSiteArgs,
22
+ BaseStaticSiteAssets,
23
+ buildApp,
24
+ prepare,
25
+ } from "../base/base-static-site.js";
26
+ import { cloudfront, getRegionOutput, s3 } from "@pulumi/aws";
27
+ import { URL_UNAVAILABLE } from "./linkable.js";
28
+ import { KvKeys } from "./providers/kv-keys.js";
29
+ import {
30
+ CF_BLOCK_CLOUDFRONT_URL_INJECTION,
31
+ CF_ROUTER_INJECTION,
32
+ KV_SITE_METADATA,
33
+ normalizeRouteArgs,
34
+ RouterRouteArgs,
35
+ RouterRouteArgsDeprecated,
36
+ } from "./router.js";
37
+ import { DistributionInvalidation } from "./providers/distribution-invalidation.js";
38
+ import { VisibleError } from "../error.js";
39
+ import { KvRoutesUpdate } from "./providers/kv-routes-update.js";
40
+ import { OriginAccessControl } from "./providers/origin-access-control.js";
41
+ import { physicalName } from "../naming.js";
42
+ import { toPosix } from "../path.js";
43
+
44
+ export interface StaticSiteArgs extends BaseStaticSiteArgs {
45
+ /**
46
+ * Configure how this component works in `sst dev`.
47
+ *
48
+ * :::note
49
+ * In `sst dev` your static site is run in dev mode; it's not deployed.
50
+ * :::
51
+ *
52
+ * Instead of deploying your static site, this starts it in dev mode. It's run
53
+ * as a separate process in the `sst dev` multiplexer. Read more about
54
+ * [`sst dev`](/docs/reference/cli/#dev).
55
+ *
56
+ * To disable dev mode, pass in `false`.
57
+ */
58
+ dev?: false | Prettify<BaseSiteDev>;
59
+ /**
60
+ * Path to the directory where your static site is located. By default this assumes your static site is in the root of your SST app.
61
+ *
62
+ * This directory will be uploaded to S3. The path is relative to your `sst.config.ts`.
63
+ *
64
+ * :::note
65
+ * If the `build` options are specified, `build.output` will be uploaded to S3 instead.
66
+ * :::
67
+ *
68
+ * If you are using a static site generator, like Vite, you'll need to configure the `build` options. When these are set, the `build.output` directory will be uploaded to S3 instead.
69
+ *
70
+ * @default `"."`
71
+ *
72
+ * @example
73
+ *
74
+ * Change where your static site is located.
75
+ *
76
+ * ```js
77
+ * {
78
+ * path: "packages/web"
79
+ * }
80
+ * ```
81
+ */
82
+ path?: BaseStaticSiteArgs["path"];
83
+ /**
84
+ * Configure CloudFront Functions to customize the behavior of HTTP requests and responses at the edge.
85
+ */
86
+ edge?: Input<{
87
+ /**
88
+ * Configure the viewer request function.
89
+ *
90
+ * The viewer request function can be used to modify incoming requests before they
91
+ * reach your origin server. For example, you can redirect users, rewrite URLs,
92
+ * or add headers.
93
+ *
94
+ * By default, a viewer request function is created to:
95
+ * - Disable CloudFront default URL if custom domain is set.
96
+ * - Rewrite URLs to append `index.html` to the URL if the URL ends with a `/`.
97
+ * - Rewrite URLs to append `.html` to the URL if the URL does not contain a file extension.
98
+ *
99
+ * @example
100
+ *
101
+ * You can pass in the code to inject into the function. The provided code will
102
+ * be injected at the start of the function.
103
+ *
104
+ * ```js
105
+ * async function handler(event) {
106
+ * // User injected code
107
+ *
108
+ * // Default behavior code
109
+ *
110
+ * return event.request;
111
+ * }
112
+ * ```
113
+ *
114
+ * To add a custom header to all requests.
115
+ *
116
+ * ```js
117
+ * {
118
+ * edge: {
119
+ * viewerRequest: {
120
+ * injection: `event.request.headers["x-foo"] = { value: "bar" };`
121
+ * }
122
+ * }
123
+ * }
124
+ * ```
125
+ *
126
+ * You can use this add basic auth, [check out an example](/docs/examples/#aws-static-site-basic-auth).
127
+ */
128
+ viewerRequest?: Input<{
129
+ /**
130
+ * The code to inject into the viewer request function.
131
+ *
132
+ * @example
133
+ * To add a custom header to all requests.
134
+ *
135
+ * ```js
136
+ * {
137
+ * edge: {
138
+ * viewerRequest: {
139
+ * injection: `event.request.headers["x-foo"] = { value: "bar" };`
140
+ * }
141
+ * }
142
+ * }
143
+ * ```
144
+ */
145
+ injection: Input<string>;
146
+ /**
147
+ * The KV store to associate with the viewer request function.
148
+ *
149
+ * @example
150
+ * ```js
151
+ * {
152
+ * edge: {
153
+ * viewerRequest: {
154
+ * kvStore: "arn:aws:cloudfront::123456789012:key-value-store/my-store"
155
+ * }
156
+ * }
157
+ * }
158
+ * ```
159
+ */
160
+ kvStore?: Input<string>;
161
+ /**
162
+ * @deprecated Use `kvStore` instead because CloudFront Functions only support one KV store.
163
+ */
164
+ kvStores?: Input<Input<string>[]>;
165
+ }>;
166
+ /**
167
+ * Configure the viewer response function.
168
+ *
169
+ * The viewer response function can be used to modify outgoing responses before they
170
+ * are sent to the client. For example, you can add security headers or change the response
171
+ * status code.
172
+ *
173
+ * By default, no viewer response function is set. A new function will be created with
174
+ * the provided code.
175
+ *
176
+ * @example
177
+ *
178
+ * You can pass in the code to inject into the function. And a CloudFront function will
179
+ * be created with the provided code injected into it.
180
+ *
181
+ * ```js
182
+ * async function handler(event) {
183
+ * // User injected code
184
+ *
185
+ * return event.response;
186
+ * }
187
+ * ```
188
+ *
189
+ * To add a custom header to all responses.
190
+ *
191
+ * ```js
192
+ * {
193
+ * edge: {
194
+ * viewerResponse: {
195
+ * injection: `event.response.headers["x-foo"] = { value: "bar" };`
196
+ * }
197
+ * }
198
+ * }
199
+ * ```
200
+ */
201
+ viewerResponse?: Input<{
202
+ /**
203
+ * The code to inject into the viewer response function.
204
+ *
205
+ * @example
206
+ * To add a custom header to all responses.
207
+ *
208
+ * ```js
209
+ * {
210
+ * edge: {
211
+ * viewerResponse: {
212
+ * injection: `event.response.headers["x-foo"] = { value: "bar" };`
213
+ * }
214
+ * }
215
+ * }
216
+ * ```
217
+ */
218
+ injection: Input<string>;
219
+ /**
220
+ * The KV store to associate with the viewer response function.
221
+ *
222
+ * @example
223
+ * ```js
224
+ * {
225
+ * server: {
226
+ * edge: {
227
+ * viewerResponse: {
228
+ * kvStore: "arn:aws:cloudfront::123456789012:key-value-store/my-store"
229
+ * }
230
+ * }
231
+ * }
232
+ * }
233
+ * ```
234
+ */
235
+ kvStore?: Input<string>;
236
+ /**
237
+ * @deprecated Use `kvStore` instead because CloudFront Functions only support one KV store.
238
+ */
239
+ kvStores?: Input<Input<string>[]>;
240
+ }>;
241
+ }>;
242
+ /**
243
+ * Configure if your static site needs to be built. This is useful if you are using a static site generator.
244
+ *
245
+ * The `build.output` directory will be uploaded to S3 instead.
246
+ * @example
247
+ * For a Vite project using npm this might look like this.
248
+ *
249
+ * ```js
250
+ * {
251
+ * build: {
252
+ * command: "npm run build",
253
+ * output: "dist"
254
+ * }
255
+ * }
256
+ * ```
257
+ */
258
+ build?: BaseStaticSiteArgs["build"];
259
+ /**
260
+ * Configure how the static site's assets are uploaded to S3.
261
+ *
262
+ * By default, this is set to the following. Read more about these options below.
263
+ * ```js
264
+ * {
265
+ * assets: {
266
+ * textEncoding: "utf-8",
267
+ * fileOptions: [
268
+ * {
269
+ * files: "**",
270
+ * cacheControl: "max-age=31536000,public,immutable"
271
+ * },
272
+ * {
273
+ * files: "**\/*.html",
274
+ * cacheControl: "max-age=0,no-cache,no-store,must-revalidate"
275
+ * }
276
+ * ]
277
+ * }
278
+ * }
279
+ * ```
280
+ * @default `Object`
281
+ */
282
+ assets?: Prettify<
283
+ BaseStaticSiteAssets & {
284
+ /**
285
+ * The name of the S3 bucket to upload the assets to.
286
+ * @default Creates a new bucket
287
+ * @example
288
+ * ```js
289
+ * {
290
+ * assets: {
291
+ * bucket: "my-existing-bucket"
292
+ * }
293
+ * }
294
+ * ```
295
+ *
296
+ * :::note
297
+ * The bucket must allow CloudFront to access the bucket.
298
+ * :::
299
+ *
300
+ * When using an existing bucket, ensure that the bucket has a policy that allows CloudFront to access the bucket.
301
+ * For example, the bucket policy might look like this:
302
+ * ```json
303
+ * {
304
+ * "Version": "2012-10-17",
305
+ * "Statement": [
306
+ * {
307
+ * "Effect": "Allow",
308
+ * "Principal": {
309
+ * "Service": "cloudfront.amazonaws.com"
310
+ * },
311
+ * "Action": "s3:GetObject",
312
+ * "Resource": "arn:aws:s3:::my-existing-bucket/*",
313
+ * "Condition": {
314
+ * "StringLike": {
315
+ * "aws:SourceArn": "arn:aws:cloudfront::ACCOUNT_ID:distribution/*"
316
+ * }
317
+ * }
318
+ * }
319
+ * ]
320
+ * }
321
+ * ```
322
+ *
323
+ * The `Condition` limits it to the CloudFront distributions in your own AWS account.
324
+ * Without it, a distribution in any account can read the bucket.
325
+ */
326
+ bucket?: Input<string>;
327
+ /**
328
+ * The path into the S3 bucket where the assets should be uploaded.
329
+ * @default Root of the bucket
330
+ * @example
331
+ * ```js
332
+ * {
333
+ * assets: {
334
+ * path: "websites/my-website"
335
+ * }
336
+ * }
337
+ * ```
338
+ */
339
+ path?: Input<string>;
340
+ /**
341
+ * Configure if files from previous deployments should be purged from the bucket.
342
+ * @default `true`
343
+ * @example
344
+ * ```js
345
+ * {
346
+ * assets: {
347
+ * purge: false
348
+ * }
349
+ * }
350
+ * ```
351
+ */
352
+ purge?: Input<boolean>;
353
+ /**
354
+ * Configure additional asset routes for serving files directly from the S3 bucket.
355
+ *
356
+ * These routes allow files stored in specific S3 bucket paths to be served under the
357
+ * same domain as your site. This is particularly useful for handling user-uploaded
358
+ * content.
359
+ *
360
+ * @example
361
+ * If user-uploaded files are stored in the `uploads` directory, and no `routes` are
362
+ * configured, these files will return 404 errors or display the `errorPage` if set.
363
+ * By including `uploads` in `routes`, all files in that folder will be served
364
+ * directly from the S3 bucket.
365
+ *
366
+ * ```js
367
+ * {
368
+ * assets: {
369
+ * routes: ["uploads"]
370
+ * }
371
+ * }
372
+ * ```
373
+ */
374
+ routes?: Input<Input<string>[]>;
375
+ }
376
+ >;
377
+ /**
378
+ * Set a custom domain for your static site. Supports domains hosted either on
379
+ * [Route 53](https://aws.amazon.com/route53/) or outside AWS.
380
+ *
381
+ * :::tip
382
+ * You can also migrate an externally hosted domain to Amazon Route 53 by
383
+ * [following this guide](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/MigratingDNS.html).
384
+ * :::
385
+ *
386
+ * @example
387
+ *
388
+ * ```js
389
+ * {
390
+ * domain: "domain.com"
391
+ * }
392
+ * ```
393
+ *
394
+ * Specify a `www.` version of the custom domain.
395
+ *
396
+ * ```js
397
+ * {
398
+ * domain: {
399
+ * name: "domain.com",
400
+ * redirects: ["www.domain.com"]
401
+ * }
402
+ * }
403
+ * ```
404
+ */
405
+ domain?: CdnArgs["domain"];
406
+ /**
407
+ * @deprecated The `router` prop is now the recommended way to serve your site
408
+ * through a `Router` component.
409
+ */
410
+ route?: Prettify<RouterRouteArgsDeprecated>;
411
+ /**
412
+ * Serve your static site through a `Router` instead of a standalone CloudFront
413
+ * distribution.
414
+ *
415
+ * By default, this component creates a new CloudFront distribution. But you might
416
+ * want to serve it through the distribution of your `Router` as a:
417
+ *
418
+ * - A path like `/docs`
419
+ * - A subdomain like `docs.example.com`
420
+ * - Or a combined pattern like `dev.example.com/docs`
421
+ *
422
+ * @example
423
+ *
424
+ * To serve your static site **from a path**, you'll need to configure the root domain
425
+ * in your `Router` component.
426
+ *
427
+ * ```ts title="sst.config.ts" {2}
428
+ * const router = new sst.aws.Router("Router", {
429
+ * domain: "example.com"
430
+ * });
431
+ * ```
432
+ *
433
+ * Now set the `router` and the `path`.
434
+ *
435
+ * ```ts {3,4}
436
+ * {
437
+ * router: {
438
+ * instance: router,
439
+ * path: "/docs"
440
+ * }
441
+ * }
442
+ * ```
443
+ *
444
+ * If you are using a static site generator make sure the base path is set in your
445
+ * config.
446
+ *
447
+ * :::caution
448
+ * If routing to a path, you need to configure that as the base path in your
449
+ * static site generator as well.
450
+ * :::
451
+ *
452
+ * For Vite, set the `base` option in your `vite.config.ts`. It should end with
453
+ * a `/` to ensure asset paths like CSS and JS, are constructed correctly.
454
+ *
455
+ * ```js title="vite.config.ts" {2}
456
+ * export default defineConfig({
457
+ * base: "/docs/"
458
+ * });
459
+ * ```
460
+ *
461
+ * To serve your static site **from a subdomain**, you'll need to configure the
462
+ * domain in your `Router` component to match both the root and the subdomain.
463
+ *
464
+ * ```ts title="sst.config.ts" {3,4}
465
+ * const router = new sst.aws.Router("Router", {
466
+ * domain: {
467
+ * name: "example.com",
468
+ * aliases: ["*.example.com"]
469
+ * }
470
+ * });
471
+ * ```
472
+ *
473
+ * Now set the `domain` in the `router` prop.
474
+ *
475
+ * ```ts {4}
476
+ * {
477
+ * router: {
478
+ * instance: router,
479
+ * domain: "docs.example.com"
480
+ * }
481
+ * }
482
+ * ```
483
+ *
484
+ * Finally, to serve your static site **from a combined pattern** like
485
+ * `dev.example.com/docs`, you'll need to configure the domain in your `Router` to
486
+ * match the subdomain.
487
+ *
488
+ * ```ts title="sst.config.ts" {3,4}
489
+ * const router = new sst.aws.Router("Router", {
490
+ * domain: {
491
+ * name: "example.com",
492
+ * aliases: ["*.example.com"]
493
+ * }
494
+ * });
495
+ * ```
496
+ *
497
+ * And set the `domain` and the `path`.
498
+ *
499
+ * ```ts {4,5}
500
+ * {
501
+ * router: {
502
+ * instance: router,
503
+ * domain: "dev.example.com",
504
+ * path: "/docs"
505
+ * }
506
+ * }
507
+ * ```
508
+ *
509
+ * Also, make sure to set the base path in your static site generator
510
+ * configuration, like above.
511
+ */
512
+ router?: Prettify<RouterRouteArgs>;
513
+ /**
514
+ * Configure how the CloudFront cache invalidations are handled. This is run after your static site has been deployed.
515
+ * :::tip
516
+ * You get 1000 free invalidations per month. After that you pay $0.005 per invalidation path. [Read more here](https://aws.amazon.com/cloudfront/pricing/).
517
+ * :::
518
+ * @default `{paths: "all", wait: false}`
519
+ * @example
520
+ * Turn off invalidations.
521
+ * ```js
522
+ * {
523
+ * invalidation: false
524
+ * }
525
+ * ```
526
+ * Wait for all paths to be invalidated.
527
+ * ```js
528
+ * {
529
+ * invalidation: {
530
+ * paths: "all",
531
+ * wait: true
532
+ * }
533
+ * }
534
+ * ```
535
+ */
536
+ invalidation?: Input<
537
+ | false
538
+ | {
539
+ /**
540
+ * Configure if `sst deploy` should wait for the CloudFront cache invalidation to finish.
541
+ *
542
+ * :::tip
543
+ * For non-prod environments it might make sense to pass in `false`.
544
+ * :::
545
+ *
546
+ * Waiting for the CloudFront cache invalidation process to finish ensures that the new content will be served once the deploy finishes. However, this process can sometimes take more than 5 mins.
547
+ * @default `false`
548
+ * @example
549
+ * ```js
550
+ * {
551
+ * invalidation: {
552
+ * wait: true
553
+ * }
554
+ * }
555
+ * ```
556
+ */
557
+ wait?: Input<boolean>;
558
+ /**
559
+ * The paths to invalidate.
560
+ *
561
+ * You can either pass in an array of glob patterns to invalidate specific files. Or you can use the built-in option `all` to invalidation all files when any file changes.
562
+ *
563
+ * :::note
564
+ * Invalidating `all` counts as one invalidation, while each glob pattern counts as a single invalidation path.
565
+ * :::
566
+ * @default `"all"`
567
+ * @example
568
+ * Invalidate the `index.html` and all files under the `products/` route.
569
+ * ```js
570
+ * {
571
+ * invalidation: {
572
+ * paths: ["/index.html", "/products/*"]
573
+ * }
574
+ * }
575
+ * ```
576
+ */
577
+ paths?: Input<"all" | string[]>;
578
+ }
579
+ >;
580
+ /**
581
+ * @deprecated The `route.path` prop is now the recommended way to configure the base
582
+ * path for the site.
583
+ */
584
+ base?: Input<string>;
585
+ /**
586
+ * @deprecated The `route` prop is now the recommended way to use the `Router` component
587
+ * to serve your site. Setting `route` will not create a standalone CloudFront
588
+ * distribution.
589
+ */
590
+ cdn?: Input<boolean>;
591
+ /**
592
+ * [Transform](/docs/components#transform) how this component creates its underlying
593
+ * resources.
594
+ */
595
+ transform?: {
596
+ /**
597
+ * Transform the Bucket resource used for uploading the assets.
598
+ */
599
+ assets?: Transform<BucketArgs>;
600
+ /**
601
+ * Transform the CloudFront CDN resource.
602
+ */
603
+ cdn?: Transform<CdnArgs>;
604
+ };
605
+ }
606
+
607
+ /**
608
+ * The `StaticSite` component lets you deploy a static website to AWS. It uses [Amazon S3](https://aws.amazon.com/s3/) to store your files and [Amazon CloudFront](https://aws.amazon.com/cloudfront/) to serve them.
609
+ *
610
+ * It can also `build` your site by running your static site generator, like [Vite](https://vitejs.dev) and uploading the build output to S3.
611
+ *
612
+ * @example
613
+ *
614
+ * #### Minimal example
615
+ *
616
+ * Simply uploads the current directory as a static site.
617
+ *
618
+ * ```js title="sst.config.ts"
619
+ * new sst.aws.StaticSite("MyWeb");
620
+ * ```
621
+ *
622
+ * #### Change the path
623
+ *
624
+ * Change the `path` that should be uploaded.
625
+ *
626
+ * ```js title="sst.config.ts"
627
+ * new sst.aws.StaticSite("MyWeb", {
628
+ * path: "path/to/site"
629
+ * });
630
+ * ```
631
+ *
632
+ * #### Running locally
633
+ *
634
+ * In `sst dev`, we don't deploy your site to AWS because we assume you are running it locally.
635
+ *
636
+ * :::note
637
+ * Your static site will not be deployed when run locally with `sst dev`.
638
+ * :::
639
+ *
640
+ * For example, for a Vite site, you can run it locally with.
641
+ *
642
+ * ```bash
643
+ * sst dev vite dev
644
+ * ```
645
+ *
646
+ * This will start the Vite dev server and pass in any environment variables that you've set in your config. But it will not deploy your site to AWS.
647
+ *
648
+ * #### Deploy a Vite SPA
649
+ *
650
+ * Use [Vite](https://vitejs.dev) to deploy a React/Vue/Svelte/etc. SPA by specifying the `build` config.
651
+ *
652
+ * ```js title="sst.config.ts"
653
+ * new sst.aws.StaticSite("MyWeb", {
654
+ * build: {
655
+ * command: "npm run build",
656
+ * output: "dist"
657
+ * }
658
+ * });
659
+ * ```
660
+ *
661
+ * #### Deploy a Jekyll site
662
+ *
663
+ * Use [Jekyll](https://jekyllrb.com) to deploy a static site.
664
+ *
665
+ * ```js title="sst.config.ts"
666
+ * new sst.aws.StaticSite("MyWeb", {
667
+ * errorPage: "/404.html",
668
+ * build: {
669
+ * command: "bundle exec jekyll build",
670
+ * output: "_site"
671
+ * }
672
+ * });
673
+ * ```
674
+ *
675
+ * #### Deploy a Gatsby site
676
+ *
677
+ * Use [Gatsby](https://www.gatsbyjs.com) to deploy a static site.
678
+ *
679
+ * ```js title="sst.config.ts"
680
+ * new sst.aws.StaticSite("MyWeb", {
681
+ * errorPage: "/404.html",
682
+ * build: {
683
+ * command: "npm run build",
684
+ * output: "public"
685
+ * }
686
+ * });
687
+ * ```
688
+ *
689
+ * #### Deploy an Angular SPA
690
+ *
691
+ * Use [Angular](https://angular.dev) to deploy a SPA.
692
+ *
693
+ * ```js title="sst.config.ts"
694
+ * new sst.aws.StaticSite("MyWeb", {
695
+ * build: {
696
+ * command: "ng build --output-path dist",
697
+ * output: "dist"
698
+ * }
699
+ * });
700
+ * ```
701
+ *
702
+ * #### Add a custom domain
703
+ *
704
+ * Set a custom domain for your site.
705
+ *
706
+ * ```js {2} title="sst.config.ts"
707
+ * new sst.aws.StaticSite("MyWeb", {
708
+ * domain: "my-app.com"
709
+ * });
710
+ * ```
711
+ *
712
+ * #### Redirect www to apex domain
713
+ *
714
+ * Redirect `www.my-app.com` to `my-app.com`.
715
+ *
716
+ * ```js {4} title="sst.config.ts"
717
+ * new sst.aws.StaticSite("MyWeb", {
718
+ * domain: {
719
+ * name: "my-app.com",
720
+ * redirects: ["www.my-app.com"]
721
+ * }
722
+ * });
723
+ * ```
724
+ *
725
+ * #### Set environment variables
726
+ *
727
+ * Set `environment` variables for the build process of your static site. These will be used locally and on deploy.
728
+ *
729
+ * :::tip
730
+ * For Vite, the types for the environment variables are also generated. This can be configured through the `vite` prop.
731
+ * :::
732
+ *
733
+ * For some static site generators like Vite, [environment variables](https://vitejs.dev/guide/env-and-mode) prefixed with `VITE_` can be accessed in the browser.
734
+ *
735
+ * ```ts {5-7} title="sst.config.ts"
736
+ * const bucket = new sst.aws.Bucket("MyBucket");
737
+ *
738
+ * new sst.aws.StaticSite("MyWeb", {
739
+ * environment: {
740
+ * BUCKET_NAME: bucket.name,
741
+ * // Accessible in the browser
742
+ * VITE_STRIPE_PUBLISHABLE_KEY: "pk_test_123"
743
+ * },
744
+ * build: {
745
+ * command: "npm run build",
746
+ * output: "dist"
747
+ * }
748
+ * });
749
+ * ```
750
+ */
751
+ export class StaticSite extends Component implements Link.Linkable {
752
+ private cdn?: Cdn;
753
+ private bucket?: Bucket;
754
+ private devUrl?: Output<string>;
755
+ private prodUrl?: Output<string | undefined>;
756
+
757
+ constructor(
758
+ name: string,
759
+ args: StaticSiteArgs = {},
760
+ opts: ComponentResourceOptions = {},
761
+ ) {
762
+ super(__pulumiType, name, args, opts);
763
+ const self = this;
764
+
765
+ validateDeprecatedProps();
766
+ const { sitePath, environment, indexPage } = prepare(args);
767
+ const dev = normalizeDev();
768
+
769
+ if (dev.enabled) {
770
+ this.devUrl = dev.url;
771
+ this.registerOutputs({
772
+ _metadata: {
773
+ mode: "placeholder",
774
+ path: sitePath,
775
+ environment,
776
+ url: this.url,
777
+ },
778
+ _dev: dev.outputs,
779
+ });
780
+ return;
781
+ }
782
+
783
+ const route = normalizeRoute();
784
+ const errorPage = normalizeErrorPage();
785
+ const assets = normalizeAsssets();
786
+ const outputPath = buildApp(self, name, args.build, sitePath, environment);
787
+ const bucket = createBucket();
788
+ const { bucketName, bucketDomain } = getBucketDetails();
789
+ const assetsUploaded = uploadAssets();
790
+ const kvNamespace = buildKvNamespace();
791
+
792
+ let originAccessControl: OriginAccessControl | undefined;
793
+ let distribution: Cdn | undefined;
794
+ let distributionId: Output<string>;
795
+ let kvStoreArn: Output<string>;
796
+ let invalidationDependsOn: Resource[] = [];
797
+ let prodUrl: Output<string | undefined>;
798
+ if (route) {
799
+ kvStoreArn = route.routerKvStoreArn;
800
+ distributionId = route.routerDistributionId;
801
+ invalidationDependsOn = [updateRouterKvRoutes()];
802
+ prodUrl = route.routerUrl;
803
+ } else {
804
+ kvStoreArn = createRequestKvStore();
805
+ distribution = createDistribution();
806
+ distributionId = distribution.nodes.distribution.id;
807
+ prodUrl = distribution.domainUrl.apply((domainUrl) =>
808
+ output(domainUrl ?? distribution!.url),
809
+ );
810
+ }
811
+
812
+ const kvUpdated = createKvEntries();
813
+ createInvalidation();
814
+
815
+ this.bucket = bucket;
816
+ this.cdn = distribution;
817
+ this.prodUrl = prodUrl;
818
+
819
+ this.registerOutputs({
820
+ _hint: this.url,
821
+ _metadata: {
822
+ mode: "deployed",
823
+ path: sitePath,
824
+ environment,
825
+ url: this.url,
826
+ },
827
+ });
828
+
829
+ function validateDeprecatedProps() {
830
+ if (args.base !== undefined)
831
+ throw new VisibleError(
832
+ `"base" prop is deprecated. Use the "route.path" prop instead to set the base path of the site.`,
833
+ );
834
+
835
+ if (args.cdn !== undefined)
836
+ throw new VisibleError(
837
+ `"cdn" prop is deprecated. Use the "route.router" prop instead to use an existing "Router" component to serve your site.`,
838
+ );
839
+ }
840
+
841
+ function normalizeRoute() {
842
+ const route = normalizeRouteArgs(args.router, args.route);
843
+
844
+ if (route) {
845
+ if (args.domain)
846
+ throw new VisibleError(
847
+ `Cannot provide both "domain" and "route". Use the "domain" prop on the "Router" component when serving your site through a Router.`,
848
+ );
849
+
850
+ if (args.edge)
851
+ throw new VisibleError(
852
+ `Cannot provide both "edge" and "route". Use the "edge" prop on the "Router" component when serving your site through a Router.`,
853
+ );
854
+ }
855
+
856
+ return route;
857
+ }
858
+
859
+ function normalizeDev() {
860
+ const enabled = $dev && args.dev !== false;
861
+ const devArgs = args.dev || {};
862
+
863
+ return {
864
+ enabled,
865
+ url: output(devArgs.url ?? URL_UNAVAILABLE),
866
+ outputs: {
867
+ title: devArgs.title,
868
+ environment,
869
+ command: output(devArgs.command ?? "npm run dev"),
870
+ autostart: output(devArgs.autostart ?? true),
871
+ directory: output(devArgs.directory ?? sitePath),
872
+ },
873
+ };
874
+ }
875
+
876
+ function normalizeErrorPage() {
877
+ return all([indexPage, args.errorPage]).apply(
878
+ ([indexPage, errorPage]) => {
879
+ return "/" + (errorPage ?? indexPage).replace(/^\//, "");
880
+ },
881
+ );
882
+ }
883
+
884
+ function normalizeAsssets() {
885
+ return {
886
+ ...args.assets,
887
+ // remove leading and trailing slashes from the path
888
+ path: args.assets?.path
889
+ ? output(args.assets?.path).apply((v) =>
890
+ v.replace(/^\//, "").replace(/\/$/, ""),
891
+ )
892
+ : undefined,
893
+ purge: output(args.assets?.purge ?? true),
894
+ // normalize to /path format
895
+ routes: args.assets?.routes
896
+ ? output(args.assets?.routes).apply((v) =>
897
+ v.map(
898
+ (route) => "/" + route.replace(/^\//, "").replace(/\/$/, ""),
899
+ ),
900
+ )
901
+ : [],
902
+ };
903
+ }
904
+
905
+ function createBucket() {
906
+ if (assets.bucket) return;
907
+
908
+ return new Bucket(
909
+ ...transform(
910
+ args.transform?.assets,
911
+ `${name}Assets`,
912
+ { access: "cloudfront" },
913
+ { parent: self, retainOnDelete: false },
914
+ ),
915
+ );
916
+ }
917
+
918
+ function getBucketDetails() {
919
+ const s3Bucket = bucket
920
+ ? bucket.nodes.bucket
921
+ : s3.Bucket.get(`${name}Assets`, assets.bucket!, undefined, {
922
+ parent: self,
923
+ });
924
+
925
+ return {
926
+ bucketName: s3Bucket.bucket,
927
+ bucketDomain: s3Bucket.bucketRegionalDomainName,
928
+ };
929
+ }
930
+
931
+ function uploadAssets() {
932
+ return all([outputPath, assets, route]).apply(
933
+ async ([outputPath, assets, route]) => {
934
+ const bucketFiles: BucketFile[] = [];
935
+
936
+ // Build fileOptions
937
+ const fileOptions = assets?.fileOptions ?? [
938
+ {
939
+ files: "**",
940
+ cacheControl: "max-age=31536000,public,immutable",
941
+ },
942
+ {
943
+ files: "**/*.html",
944
+ cacheControl: "max-age=0,no-cache,no-store,must-revalidate",
945
+ },
946
+ ];
947
+
948
+ // Upload files based on fileOptions
949
+ const filesProcessed: string[] = [];
950
+ for (const fileOption of fileOptions.reverse()) {
951
+ const files = globSync(fileOption.files, {
952
+ cwd: path.resolve(outputPath),
953
+ nodir: true,
954
+ dot: true,
955
+ ignore: [
956
+ ".sst/**",
957
+ ...(typeof fileOption.ignore === "string"
958
+ ? [fileOption.ignore]
959
+ : fileOption.ignore ?? []),
960
+ ],
961
+ }).filter((file) => !filesProcessed.includes(file));
962
+
963
+ bucketFiles.push(
964
+ ...(await Promise.all(
965
+ files.map(async (file) => {
966
+ const source = path.resolve(outputPath, file);
967
+ const content = await fs.promises.readFile(source, "utf-8");
968
+ const hash = crypto
969
+ .createHash("sha256")
970
+ .update(content)
971
+ .digest("hex");
972
+ return {
973
+ source,
974
+ key: toPosix(
975
+ path.join(
976
+ assets.path ?? "",
977
+ route?.pathPrefix?.replace(/^\//, "") ?? "",
978
+ file,
979
+ ),
980
+ ),
981
+ hash,
982
+ cacheControl: fileOption.cacheControl,
983
+ contentType:
984
+ fileOption.contentType ?? getContentType(file, "UTF-8"),
985
+ };
986
+ }),
987
+ )),
988
+ );
989
+ filesProcessed.push(...files);
990
+ }
991
+
992
+ return new BucketFiles(
993
+ `${name}AssetFiles`,
994
+ {
995
+ bucketName,
996
+ files: bucketFiles,
997
+ purge: assets.purge,
998
+ region: getRegionOutput(undefined, { parent: self }).region,
999
+ },
1000
+ { parent: self },
1001
+ );
1002
+ },
1003
+ );
1004
+ }
1005
+
1006
+ function buildKvNamespace() {
1007
+ // In the case multiple sites use the same kv store, we need to namespace the keys
1008
+ return crypto
1009
+ .createHash("md5")
1010
+ .update(`${$app.name}-${$app.stage}-${name}`)
1011
+ .digest("hex")
1012
+ .substring(0, 4);
1013
+ }
1014
+
1015
+ function createKvEntries() {
1016
+ const entries = all([
1017
+ outputPath,
1018
+ assets,
1019
+ bucketDomain,
1020
+ errorPage,
1021
+ route,
1022
+ args.errorPage,
1023
+ ]).apply(async ([
1024
+ outputPath,
1025
+ assets,
1026
+ bucketDomain,
1027
+ errorPage,
1028
+ route,
1029
+ hasErrorPage,
1030
+ ]) => {
1031
+ const kvEntries: Record<string, string> = {};
1032
+ const dirs: string[] = [];
1033
+ // Router append .html and index.html suffixes to requests to s3 routes:
1034
+ // - `.well-known` contain files without suffix, hence will be appended .html
1035
+ // - in the future, it might make sense for each dir to have props that controls
1036
+ // the suffixes ie. "handleTrailingSlashse"
1037
+ const expandDirs = [".well-known"];
1038
+
1039
+ const processDir = (childPath = "", level = 0) => {
1040
+ const currentPath = path.join(outputPath, childPath);
1041
+ fs.readdirSync(currentPath, { withFileTypes: true }).forEach(
1042
+ (item) => {
1043
+ // File: add to kvEntries
1044
+ if (item.isFile()) {
1045
+ kvEntries[toPosix(path.join("/", childPath, item.name))] = "s3";
1046
+ return;
1047
+ }
1048
+ // Directory + expand: recursively process it
1049
+ if (level === 0 && expandDirs.includes(item.name)) {
1050
+ processDir(path.join(childPath, item.name), level + 1);
1051
+ return;
1052
+ }
1053
+ // Directory + NOT expand: add to route
1054
+ dirs.push(toPosix(path.join("/", childPath, item.name)));
1055
+ },
1056
+ );
1057
+ };
1058
+ processDir();
1059
+
1060
+ kvEntries["metadata"] = JSON.stringify({
1061
+ base: route?.pathPrefix === "/" ? undefined : route?.pathPrefix,
1062
+ custom404: hasErrorPage ? undefined : errorPage,
1063
+ errorResponseCode: hasErrorPage ? 404 : undefined,
1064
+ s3: {
1065
+ domain: bucketDomain,
1066
+ dir: assets.path ? "/" + assets.path : "",
1067
+ prefix:
1068
+ route?.pathPrefix && route.pathPrefix !== "/"
1069
+ ? route.pathPrefix
1070
+ : "",
1071
+ routes: [...assets.routes, ...dirs],
1072
+ },
1073
+ } satisfies KV_SITE_METADATA);
1074
+
1075
+ return kvEntries;
1076
+ });
1077
+
1078
+ return new KvKeys(
1079
+ `${name}KvKeys`,
1080
+ {
1081
+ store: kvStoreArn!,
1082
+ namespace: kvNamespace,
1083
+ entries,
1084
+ purge: assets.purge,
1085
+ },
1086
+ { parent: self },
1087
+ );
1088
+ }
1089
+
1090
+ function updateRouterKvRoutes() {
1091
+ return new KvRoutesUpdate(
1092
+ `${name}RoutesUpdate`,
1093
+ {
1094
+ store: route!.routerKvStoreArn,
1095
+ namespace: route!.routerKvNamespace,
1096
+ key: "routes",
1097
+ entry: route!.apply((route) =>
1098
+ ["site", kvNamespace, route!.hostPattern, route!.pathPrefix].join(
1099
+ ",",
1100
+ ),
1101
+ ),
1102
+ },
1103
+ { parent: self },
1104
+ );
1105
+ }
1106
+
1107
+ function createRequestKvStore() {
1108
+ return output(args.edge).apply((edge) => {
1109
+ const viewerRequest = edge?.viewerRequest;
1110
+ if (viewerRequest?.kvStore) return output(viewerRequest?.kvStore);
1111
+
1112
+ return new cloudfront.KeyValueStore(
1113
+ `${name}KvStore`,
1114
+ {},
1115
+ { parent: self },
1116
+ ).arn;
1117
+ });
1118
+ }
1119
+
1120
+ function createRequestFunction() {
1121
+ return output(args.edge).apply((edge) => {
1122
+ const userInjection = edge?.viewerRequest?.injection ?? "";
1123
+ const blockCloudfrontUrlInjection = args.domain
1124
+ ? CF_BLOCK_CLOUDFRONT_URL_INJECTION
1125
+ : "";
1126
+ return new cloudfront.Function(
1127
+ `${name}CloudfrontFunctionRequest`,
1128
+ {
1129
+ runtime: "cloudfront-js-2.0",
1130
+ keyValueStoreAssociations: kvStoreArn ? [kvStoreArn] : [],
1131
+ code: interpolate`
1132
+ import cf from "cloudfront";
1133
+ async function handler(event) {
1134
+ ${userInjection}
1135
+ ${blockCloudfrontUrlInjection}
1136
+ ${CF_ROUTER_INJECTION}
1137
+
1138
+ const kvNamespace = "${kvNamespace}";
1139
+
1140
+ // Load metadata
1141
+ let metadata;
1142
+ try {
1143
+ const v = await cf.kvs().get(kvNamespace + ":metadata");
1144
+ metadata = JSON.parse(v);
1145
+ } catch (e) {}
1146
+
1147
+ const response = await routeSite(kvNamespace, metadata);
1148
+ return response || event.request;
1149
+ }`,
1150
+ },
1151
+ { parent: self },
1152
+ );
1153
+ });
1154
+ }
1155
+
1156
+ function createResponseFunction() {
1157
+ return output(args.edge).apply((edge) => {
1158
+ const userConfig = edge?.viewerResponse;
1159
+ const userInjection = userConfig?.injection;
1160
+ const kvStoreArn = userConfig?.kvStore ?? userConfig?.kvStores?.[0];
1161
+
1162
+ if (!userInjection) return;
1163
+
1164
+ return new cloudfront.Function(
1165
+ `${name}CloudfrontFunctionResponse`,
1166
+ {
1167
+ runtime: "cloudfront-js-2.0",
1168
+ keyValueStoreAssociations: kvStoreArn ? [kvStoreArn] : [],
1169
+ code: `
1170
+ import cf from "cloudfront";
1171
+ async function handler(event) {
1172
+ ${userInjection}
1173
+ return event.response;
1174
+ }`,
1175
+ },
1176
+ { parent: self },
1177
+ );
1178
+ });
1179
+ }
1180
+
1181
+ function createOriginAccessControl() {
1182
+ return (originAccessControl ??= new OriginAccessControl(
1183
+ `${name}S3AccessControl`,
1184
+ { name: physicalName(64, name) },
1185
+ { parent: self, ignoreChanges: ["name"] },
1186
+ ));
1187
+ }
1188
+
1189
+ // The default origin. CloudFront fetches custom error pages without running
1190
+ // the viewer request function, so a site with an error page needs the bucket
1191
+ // itself as its default origin, not a placeholder. A site without one keeps
1192
+ // the placeholder, and creates no access control. This is a plain array
1193
+ // unless `errorPage` is itself an Output, so a `transform.cdn` that reads
1194
+ // `args.origins` still gets an array.
1195
+ function createDefaultOrigins() {
1196
+ const placeholder = () => [
1197
+ {
1198
+ originId: "default",
1199
+ domainName: "placeholder.sst.dev",
1200
+ customOriginConfig: {
1201
+ httpPort: 80,
1202
+ httpsPort: 443,
1203
+ originProtocolPolicy: "https-only" as const,
1204
+ originReadTimeout: 20,
1205
+ originSslProtocols: ["TLSv1.2"],
1206
+ },
1207
+ },
1208
+ ];
1209
+ const bucketOrigin = () => [
1210
+ {
1211
+ originId: "default",
1212
+ domainName: bucketDomain,
1213
+ originAccessControlId: createOriginAccessControl().id,
1214
+ },
1215
+ ];
1216
+
1217
+ if (!args.errorPage) return placeholder();
1218
+ if (!Output.isInstance(args.errorPage)) return bucketOrigin();
1219
+ return args.errorPage.apply((errorPage) =>
1220
+ errorPage ? bucketOrigin() : placeholder(),
1221
+ );
1222
+ }
1223
+
1224
+ function createDistribution() {
1225
+ return new Cdn(
1226
+ ...transform(
1227
+ args.transform?.cdn,
1228
+ `${name}Cdn`,
1229
+ {
1230
+ comment: `${name} site`,
1231
+ domain: args.domain,
1232
+ // CloudFront fetches custom error pages without running the
1233
+ // viewer request function, so a site with an error page needs the
1234
+ // bucket itself as its default origin, not a placeholder. A site
1235
+ // without one keeps the placeholder, and creates no access control.
1236
+ origins: createDefaultOrigins(),
1237
+ defaultCacheBehavior: {
1238
+ targetOriginId: "default",
1239
+ viewerProtocolPolicy: "redirect-to-https",
1240
+ allowedMethods: [
1241
+ "DELETE",
1242
+ "GET",
1243
+ "HEAD",
1244
+ "OPTIONS",
1245
+ "PATCH",
1246
+ "POST",
1247
+ "PUT",
1248
+ ],
1249
+ cachedMethods: ["GET", "HEAD"],
1250
+ compress: true,
1251
+ // CloudFront's managed CachingOptimized policy
1252
+ cachePolicyId: "658327ea-f89d-4fab-a63d-7e88639e58f6",
1253
+ functionAssociations: all([
1254
+ createRequestFunction(),
1255
+ createResponseFunction(),
1256
+ ]).apply(([reqFn, resFn]) => [
1257
+ { eventType: "viewer-request", functionArn: reqFn.arn },
1258
+ ...(resFn
1259
+ ? [{ eventType: "viewer-response", functionArn: resFn.arn }]
1260
+ : []),
1261
+ ]),
1262
+ },
1263
+ customErrorResponses: all([
1264
+ args.errorPage,
1265
+ errorPage,
1266
+ assets.path,
1267
+ ]).apply(([hasCustomErrorPage, errorPage, assetsPath]) => {
1268
+ if (!hasCustomErrorPage) return [];
1269
+ // Error page fetches skip the viewer request function, which is
1270
+ // what prepends the assets path for every other request. (This
1271
+ // runs only for a site with its own distribution, so there is no
1272
+ // Router path to add.)
1273
+ const pagePath = path.posix.join("/", assetsPath ?? "", errorPage);
1274
+
1275
+ return [
1276
+ {
1277
+ errorCode: 403,
1278
+ responseCode: 404,
1279
+ responsePagePath: pagePath,
1280
+ errorCachingMinTtl: 0,
1281
+ },
1282
+ {
1283
+ errorCode: 404,
1284
+ responseCode: 404,
1285
+ responsePagePath: pagePath,
1286
+ errorCachingMinTtl: 0,
1287
+ },
1288
+ ];
1289
+ }),
1290
+ },
1291
+ { parent: self },
1292
+ ),
1293
+ );
1294
+ }
1295
+
1296
+ function createInvalidation() {
1297
+ all([outputPath, args.assets, args.invalidation]).apply(
1298
+ ([outputPath, assets, invalidationRaw]) => {
1299
+ // Normalize invalidation
1300
+ if (invalidationRaw === false) return;
1301
+ const invalidation = {
1302
+ wait: false,
1303
+ paths: "all" as const,
1304
+ ...invalidationRaw,
1305
+ };
1306
+
1307
+ // Build invalidation paths
1308
+ const invalidationPaths =
1309
+ invalidation.paths === "all" ? ["/*"] : invalidation.paths;
1310
+ if (invalidationPaths.length === 0) return;
1311
+
1312
+ // Calculate a hash based on the contents of the S3 files. This will be
1313
+ // used to determine if we need to invalidate our CloudFront cache.
1314
+ //
1315
+ // The below options are needed to support following symlinks when building zip files:
1316
+ // - nodir: This will prevent symlinks themselves from being copied into the zip.
1317
+ // - follow: This will follow symlinks and copy the files within.
1318
+ const hash = crypto.createHash("md5");
1319
+ hash.update(JSON.stringify(assets ?? {}));
1320
+ globSync("**", {
1321
+ dot: true,
1322
+ nodir: true,
1323
+ follow: true,
1324
+ cwd: path.resolve(outputPath),
1325
+ }).forEach((filePath) =>
1326
+ hash.update(
1327
+ fs.readFileSync(path.resolve(outputPath, filePath), "utf-8"),
1328
+ ),
1329
+ );
1330
+
1331
+ new DistributionInvalidation(
1332
+ `${name}Invalidation`,
1333
+ {
1334
+ distributionId,
1335
+ paths: invalidationPaths,
1336
+ version: hash.digest("hex"),
1337
+ wait: invalidation.wait,
1338
+ },
1339
+ {
1340
+ parent: self,
1341
+ dependsOn: [assetsUploaded, kvUpdated, ...invalidationDependsOn],
1342
+ },
1343
+ );
1344
+ },
1345
+ );
1346
+ }
1347
+ }
1348
+
1349
+ /**
1350
+ * The URL of the website.
1351
+ *
1352
+ * If the `domain` is set, this is the URL with the custom domain.
1353
+ * Otherwise, it's the auto-generated CloudFront URL.
1354
+ */
1355
+ public get url() {
1356
+ return all([this.prodUrl, this.devUrl]).apply(
1357
+ ([prodUrl, devUrl]) => (prodUrl ?? devUrl)!,
1358
+ );
1359
+ }
1360
+
1361
+ /**
1362
+ * The underlying [resources](/docs/components/#nodes) this component creates.
1363
+ */
1364
+ public get nodes() {
1365
+ return {
1366
+ /**
1367
+ * The Amazon S3 Bucket that stores the assets.
1368
+ */
1369
+ assets: this.bucket,
1370
+ /**
1371
+ * The Amazon CloudFront CDN that serves the site.
1372
+ */
1373
+ cdn: this.cdn,
1374
+ };
1375
+ }
1376
+
1377
+ /** @internal */
1378
+ public getSSTLink() {
1379
+ return {
1380
+ properties: {
1381
+ url: this.url,
1382
+ },
1383
+ };
1384
+ }
1385
+ }
1386
+
1387
+ const __pulumiType = "sst:aws:StaticSite";
1388
+ // @ts-expect-error
1389
+ StaticSite.__pulumiType = __pulumiType;