@sst-community/sst 4.19.0 → 5.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (832) hide show
  1. package/README.md +92 -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-ONNI4XNK.js +367 -0
  8. package/platform/js/chunks/chunk-ONNI4XNK.js.map +6 -0
  9. package/platform/js/chunks/chunk-VIFHC73J.js +108 -0
  10. package/platform/js/chunks/chunk-VIFHC73J.js.map +6 -0
  11. package/platform/js/chunks/chunk-WJ6BVA46.js +10 -0
  12. package/platform/js/chunks/chunk-WJ6BVA46.js.map +6 -0
  13. package/platform/js/chunks/chunk-ZOXXXME5.js +472 -0
  14. package/platform/js/chunks/chunk-ZOXXXME5.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-DMGMTLNB.js +10 -0
  18. package/platform/js/chunks/config-DMGMTLNB.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 +35362 -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 +3227 -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 +202 -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 +1047 -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 +3281 -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 +1527 -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 +1460 -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 +1755 -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 +525 -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 +1754 -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 +582 -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 +241 -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 +1437 -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,1527 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import crypto from "crypto";
4
+ import {
5
+ all,
6
+ asset,
7
+ ComponentResourceOptions,
8
+ interpolate,
9
+ Output,
10
+ output,
11
+ rootStackResource,
12
+ secret,
13
+ unsecret,
14
+ } from "@pulumi/pulumi";
15
+ import {
16
+ cloudwatch,
17
+ ecr,
18
+ getCallerIdentityOutput,
19
+ getPartitionOutput,
20
+ getRegionOutput,
21
+ iam,
22
+ lambda,
23
+ s3,
24
+ types,
25
+ } from "@pulumi/aws";
26
+ import { Image } from "@pulumi/docker-build";
27
+ import { V5Args, component, many, optional } from "../../parts-component";
28
+ import {
29
+ Plain,
30
+ ifSet,
31
+ plain,
32
+ withDefault,
33
+ withoutDependencies,
34
+ } from "../../args";
35
+ import type { Input } from "../../input";
36
+ import { VisibleError } from "../../error";
37
+ import { Link } from "../../link";
38
+ import { logicalName, physicalName } from "../../naming";
39
+ import { toDays, toSeconds } from "../../duration";
40
+ import { toMBs } from "../../size";
41
+ import { rpc } from "../../rpc/rpc";
42
+ import { warnOnce } from "../../../util/warn";
43
+ import {
44
+ Function as OriginalFunction,
45
+ FunctionArgs as OriginalFunctionArgs,
46
+ } from "../function";
47
+ import { Efs as OriginalEfs } from "../efs";
48
+ import { type TakesVpc, isVpc } from "../helpers/vpc";
49
+ import { Efs } from "./efs";
50
+ import { RETENTION } from "../logging";
51
+ import { Permission, permission } from "../permission";
52
+ import { normalizeRouteArgs } from "../router";
53
+ import { bootstrap } from "../helpers/bootstrap";
54
+ import { parseRoleArn, splitQualifiedFunctionArn } from "../helpers/arn";
55
+ import {
56
+ FunctionBundle,
57
+ FunctionFile,
58
+ buildBundle,
59
+ devBridgeBundle,
60
+ injectHandler,
61
+ zipCode,
62
+ } from "../helpers/function-code";
63
+ import { FunctionEnvironmentUpdate } from "../providers/function-environment-update";
64
+ import { KvKeys } from "../providers/kv-keys";
65
+ import { KvRoutesUpdate } from "../providers/kv-routes-update";
66
+
67
+ const parts = {
68
+ /**
69
+ * The IAM Role the function uses.
70
+ */
71
+ role: iam.Role,
72
+ /**
73
+ * The CloudWatch Log Group the function's logs are stored in. It isn't created when
74
+ * `logging` is `false`.
75
+ */
76
+ logGroup: optional(cloudwatch.LogGroup),
77
+ /**
78
+ * The function's code: a zip file in the asset bucket of your account. A Python
79
+ * function deployed as a container has an `image` instead.
80
+ */
81
+ code: optional(s3.BucketObjectv2),
82
+ /**
83
+ * The source maps of the function's code, one for each file the build writes. They
84
+ * are numbered from `0`, and they're only known once the function is built.
85
+ */
86
+ sourcemap: many(s3.BucketObjectv2),
87
+ /**
88
+ * The container image of a Python function that's deployed as a container.
89
+ */
90
+ image: optional(Image),
91
+ /**
92
+ * The AWS Lambda function.
93
+ */
94
+ function: lambda.Function,
95
+ /**
96
+ * The Lambda function URL, when `url` is enabled.
97
+ */
98
+ url: optional(lambda.FunctionUrl),
99
+ /**
100
+ * The alias the URL of a durable function points to.
101
+ */
102
+ urlAlias: optional(lambda.Alias),
103
+ /**
104
+ * The permission to call the function's URL: for everyone, or for the router's
105
+ * distribution when the URL is behind a router that signs its requests. When the URL
106
+ * is behind a router, it's only known once the router is.
107
+ */
108
+ urlAccess: optional(lambda.Permission),
109
+ /**
110
+ * The permission to invoke the function through its URL. It's given to whoever
111
+ * `urlAccess` is.
112
+ */
113
+ urlInvoke: optional(lambda.Permission),
114
+ /**
115
+ * What the router needs to know to reach the function's URL, stored in the router's
116
+ * key value store.
117
+ */
118
+ routeKey: optional(KvKeys),
119
+ /**
120
+ * The entry for the function's URL in the router's list of routes.
121
+ */
122
+ routesUpdate: optional(KvRoutesUpdate),
123
+ /**
124
+ * The provisioned concurrency of the function, when `concurrency.provisioned` is set.
125
+ */
126
+ provisioned: optional(lambda.ProvisionedConcurrencyConfig),
127
+ /**
128
+ * The settings for asynchronous invocations, when `retries` is set.
129
+ */
130
+ eventInvokeConfig: optional(lambda.FunctionEventInvokeConfig),
131
+ /**
132
+ * The environment variables added with `addEnvironment`.
133
+ */
134
+ environmentUpdate: optional(FunctionEnvironmentUpdate),
135
+ };
136
+
137
+ type Logging = Exclude<
138
+ Plain<OriginalFunctionArgs["logging"]>,
139
+ false | undefined
140
+ >;
141
+ type Url = Exclude<Plain<OriginalFunctionArgs["url"]>, boolean | undefined>;
142
+ type Python = NonNullable<Plain<OriginalFunctionArgs["python"]>>;
143
+ type Concurrency = NonNullable<Plain<OriginalFunctionArgs["concurrency"]>>;
144
+
145
+ export interface FunctionLoggingArgs extends Omit<Logging, "logGroup"> {}
146
+
147
+ export interface FunctionUrlArgs extends Omit<Url, "route" | "authorization"> {
148
+ /**
149
+ * The authorization used for the function URL. Supports [IAM authorization](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html).
150
+ *
151
+ * It decides which permissions are created, so it has to be a plain value.
152
+ *
153
+ * @default `"none"`
154
+ * @example
155
+ * ```js
156
+ * {
157
+ * url: {
158
+ * authorization: "iam"
159
+ * }
160
+ * }
161
+ * ```
162
+ */
163
+ authorization?: "none" | "iam";
164
+ }
165
+
166
+ export interface FunctionPythonArgs extends Omit<Python, "container"> {
167
+ /**
168
+ * Set this to `true` to deploy the function as a container image. That lifts the
169
+ * 250MB limit on the unzipped package to 10GB, and lets you use your own Dockerfile.
170
+ * It needs the Docker daemon to be running.
171
+ *
172
+ * It decides whether an image is built, so it has to be a plain value.
173
+ *
174
+ * @default `false`
175
+ * @example
176
+ * ```js
177
+ * {
178
+ * python: {
179
+ * container: true
180
+ * }
181
+ * }
182
+ * ```
183
+ *
184
+ * To use a custom Dockerfile, add one to the root of the uv workspace of the function.
185
+ *
186
+ * Disable the Docker build cache, for environments like Localstack where exporting
187
+ * the cache to ECR isn't supported.
188
+ *
189
+ * ```js
190
+ * {
191
+ * python: {
192
+ * container: {
193
+ * cache: false
194
+ * }
195
+ * }
196
+ * }
197
+ * ```
198
+ */
199
+ container?: boolean | { cache?: Input<boolean> };
200
+ }
201
+
202
+ export interface FunctionConcurrencyArgs
203
+ extends Omit<Concurrency, "provisioned"> {
204
+ /**
205
+ * Provisioned concurrency keeps a number of Lambda instances ready to handle
206
+ * requests, which reduces cold starts. It incurs extra charges, and it needs
207
+ * `versioning` to be enabled.
208
+ *
209
+ * It decides whether the provisioned concurrency is created, so it has to be a
210
+ * plain number.
211
+ *
212
+ * @default No provisioned concurrency
213
+ * @example
214
+ * ```js
215
+ * {
216
+ * concurrency: {
217
+ * provisioned: 10
218
+ * }
219
+ * }
220
+ * ```
221
+ */
222
+ provisioned?: number;
223
+ }
224
+
225
+ export interface FunctionArgs
226
+ extends V5Args<
227
+ TakesVpc<
228
+ Omit<
229
+ OriginalFunctionArgs,
230
+ | "live"
231
+ | "dev"
232
+ | "role"
233
+ | "logging"
234
+ | "url"
235
+ | "python"
236
+ | "concurrency"
237
+ | "volume"
238
+ >
239
+ >,
240
+ typeof parts
241
+ > {
242
+ /**
243
+ * Mount an EFS file system to the function.
244
+ *
245
+ * @example
246
+ * Create an EFS file system.
247
+ *
248
+ * ```ts title="sst.config.ts"
249
+ * const vpc = new sst.aws.Vpc("MyVpc");
250
+ * const fileSystem = new sst.aws.v5.Efs("MyFileSystem", { vpc });
251
+ * ```
252
+ *
253
+ * And pass it in.
254
+ *
255
+ * ```js
256
+ * {
257
+ * volume: {
258
+ * efs: fileSystem
259
+ * }
260
+ * }
261
+ * ```
262
+ *
263
+ * By default, the file system will be mounted to `/mnt/efs`. You can change this by
264
+ * passing in the `path` property.
265
+ *
266
+ * ```js
267
+ * {
268
+ * volume: {
269
+ * efs: fileSystem,
270
+ * path: "/mnt/my-files"
271
+ * }
272
+ * }
273
+ * ```
274
+ *
275
+ * To use an existing EFS, you can pass in an EFS access point ARN.
276
+ *
277
+ * ```js
278
+ * {
279
+ * volume: {
280
+ * efs: "arn:aws:elasticfilesystem:us-east-1:123456789012:access-point/fsap-12345678",
281
+ * }
282
+ * }
283
+ * ```
284
+ */
285
+ volume?: Input<{
286
+ /**
287
+ * The EFS file system to mount. Or an EFS access point ARN.
288
+ */
289
+ efs: Input<OriginalEfs | Efs | string>;
290
+ /**
291
+ * The path to mount the volume.
292
+ * @default `"/mnt/efs"`
293
+ */
294
+ path?: Input<string>;
295
+ }>;
296
+ /**
297
+ * Disable running this function [_Live_](/docs/live/) in `sst dev`.
298
+ *
299
+ * By default, the functions in your app are run locally in `sst dev`. To do this, a
300
+ * _stub_ version of your function is deployed, instead of the real function. You can
301
+ * turn this off by setting `dev` to `false`. It has to be a plain value.
302
+ *
303
+ * @default `true`
304
+ * @example
305
+ * ```js
306
+ * {
307
+ * dev: false
308
+ * }
309
+ * ```
310
+ */
311
+ dev?: Plain<OriginalFunctionArgs["dev"]>;
312
+ /**
313
+ * Configure the function logs in CloudWatch. Or pass in `false` to disable writing
314
+ * logs: the function is then not given permissions to write to CloudWatch.
315
+ *
316
+ * Whether the function logs has to be a plain value. The fields can be outputs.
317
+ *
318
+ * To write to a log group you already have, pass it in `existing.logGroup`.
319
+ *
320
+ * @default `{retention: "1 month", format: "text"}`
321
+ * @example
322
+ * ```js
323
+ * {
324
+ * logging: false
325
+ * }
326
+ * ```
327
+ */
328
+ logging?: false | FunctionLoggingArgs;
329
+ /**
330
+ * Enable [Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html).
331
+ * These are dedicated endpoints for your Lambda functions.
332
+ *
333
+ * Whether there is a URL, and whether it's served through a router, have to be plain
334
+ * values. The fields of the CORS settings can be outputs.
335
+ *
336
+ * @default `false`
337
+ * @example
338
+ * Enable it with the default options.
339
+ * ```js
340
+ * {
341
+ * url: true
342
+ * }
343
+ * ```
344
+ *
345
+ * Configure the authorization and CORS settings for the URL.
346
+ * ```js
347
+ * {
348
+ * url: {
349
+ * authorization: "iam",
350
+ * cors: {
351
+ * allowOrigins: ["https://example.com"]
352
+ * }
353
+ * }
354
+ * }
355
+ * ```
356
+ */
357
+ url?: boolean | FunctionUrlArgs;
358
+ /**
359
+ * Configure how your Python function is packaged.
360
+ */
361
+ python?: FunctionPythonArgs;
362
+ /**
363
+ * Configure the concurrency settings for the function.
364
+ *
365
+ * @default No concurrency settings set
366
+ * @example
367
+ * ```js
368
+ * {
369
+ * concurrency: {
370
+ * provisioned: 10,
371
+ * reserved: 50
372
+ * }
373
+ * }
374
+ * ```
375
+ */
376
+ concurrency?: FunctionConcurrencyArgs;
377
+ }
378
+
379
+ /**
380
+ * The `Function` component lets you add serverless functions to your app.
381
+ * It uses [AWS Lambda](https://aws.amazon.com/lambda/).
382
+ *
383
+ * It takes the same args as [`sst.aws.Function`](/docs/component/aws/function), apart from the
384
+ * few listed under [Switch from `Function`](#switch-from-function). It's built from parts,
385
+ * so every resource it creates can be transformed, is available in `nodes`, and can be
386
+ * swapped for one you already have.
387
+ *
388
+ * @example
389
+ *
390
+ * #### Minimal example
391
+ *
392
+ * Pass in the path to your handler function.
393
+ *
394
+ * ```ts title="sst.config.ts"
395
+ * new sst.aws.v5.Function("MyFunction", {
396
+ * handler: "src/lambda.handler"
397
+ * });
398
+ * ```
399
+ *
400
+ * The runtimes, and what `handler` means for each, are the same as for
401
+ * [`sst.aws.Function`](/docs/component/aws/function#handler).
402
+ *
403
+ * #### Set additional config
404
+ *
405
+ * ```ts {3,4} title="sst.config.ts"
406
+ * new sst.aws.v5.Function("MyFunction", {
407
+ * handler: "src/lambda.handler",
408
+ * timeout: "3 minutes",
409
+ * memory: "1024 MB"
410
+ * });
411
+ * ```
412
+ *
413
+ * #### Link resources
414
+ *
415
+ * [Link resources](/docs/linking/) to the function. This will grant permissions
416
+ * to the resources and allow you to access it in your handler.
417
+ *
418
+ * ```ts {5} title="sst.config.ts"
419
+ * const bucket = new sst.aws.v5.Bucket("MyBucket");
420
+ *
421
+ * new sst.aws.v5.Function("MyFunction", {
422
+ * handler: "src/lambda.handler",
423
+ * link: [bucket]
424
+ * });
425
+ * ```
426
+ *
427
+ * ```ts title="src/lambda.ts"
428
+ * import { Resource } from "sst";
429
+ *
430
+ * console.log(Resource.MyBucket.name);
431
+ * ```
432
+ *
433
+ * #### Enable function URLs
434
+ *
435
+ * ```ts {3} title="sst.config.ts"
436
+ * new sst.aws.v5.Function("MyFunction", {
437
+ * handler: "src/lambda.handler",
438
+ * url: true
439
+ * });
440
+ * ```
441
+ *
442
+ * #### Change what's created
443
+ *
444
+ * Every resource the function creates is a part you can transform.
445
+ *
446
+ * ```ts title="sst.config.ts"
447
+ * new sst.aws.v5.Function("MyFunction", {
448
+ * handler: "src/lambda.handler",
449
+ * url: true,
450
+ * transform: {
451
+ * function: { tracingConfig: { mode: "Active" } },
452
+ * logGroup: { logGroupClass: "INFREQUENT_ACCESS" },
453
+ * url: { invokeMode: "RESPONSE_STREAM" }
454
+ * }
455
+ * });
456
+ * ```
457
+ *
458
+ * #### Use a role or log group you already have
459
+ *
460
+ * Pass the resource, or the name to look it up by.
461
+ *
462
+ * ```ts title="sst.config.ts"
463
+ * new sst.aws.v5.Function("MyFunction", {
464
+ * handler: "src/lambda.handler",
465
+ * existing: {
466
+ * role: "my-lambda-role",
467
+ * logGroup: "/my/shared/logs"
468
+ * }
469
+ * });
470
+ * ```
471
+ *
472
+ * #### Switch from `sst.aws.Function`
473
+ *
474
+ * Change `sst.aws.Function` to `sst.aws.v5.Function` and keep the name. The function, its
475
+ * role, log group, code and URL are kept. A few things are written differently:
476
+ *
477
+ * - `dev`, `logging`, `url`, `url.authorization`, `python`, `python.container`,
478
+ * `concurrency` and `concurrency.provisioned` have to be plain values, not outputs.
479
+ * - `role: roleArn` becomes `existing: { role }`, with the role or its name.
480
+ * - `logging: { logGroup: name }` becomes `existing: { logGroup }`, with the log group
481
+ * or its name.
482
+ * - `live: false` becomes `dev: false`, and `url.route` becomes `url.router`.
483
+ * - The way `sst.aws.Function` takes those four still works.
484
+ * - `nodes.function` and `nodes.logGroup` are the resources themselves, not outputs.
485
+ * - The alias the URL of a durable function points at is created with the function's
486
+ * `provider`. `sst.aws.Function` created it with your app's provider, whatever the
487
+ * function was given. If a durable function has a `url` and a `provider`, the alias is
488
+ * replaced on switch, and the URL with it.
489
+ * - `transform: { function: { environment: { variables: { A: "1" } } } }` adds a
490
+ * variable where it used to replace them all.
491
+ *
492
+ * The V5 components create their functions, like a queue's subscriber, as
493
+ * `sst.aws.v5.Function` too. There you can keep writing the function the way
494
+ * `sst.aws.Function` takes it.
495
+ *
496
+ * ```ts title="sst.config.ts" del={1} ins={2}
497
+ * new sst.aws.Function("MyFunction", { handler: "src/lambda.handler" });
498
+ * new sst.aws.v5.Function("MyFunction", { handler: "src/lambda.handler" });
499
+ * ```
500
+ */
501
+ export class Function extends component("sst:aws:Function", parts) {
502
+ private readonly durable: boolean;
503
+ private readonly fn: lambda.Function;
504
+ private readonly urlEndpoint: Output<string | undefined>;
505
+
506
+ constructor(
507
+ name: string,
508
+ args: FunctionArgs,
509
+ opts?: ComponentResourceOptions,
510
+ ) {
511
+ super(name, args, opts);
512
+ const self = this;
513
+ const durable = (this.durable = Boolean(args.durable));
514
+
515
+ // A function that's already deployed is only referenced
516
+ const existing = this.existingPart("function");
517
+ if (existing) {
518
+ this.fn = existing;
519
+ this.urlEndpoint = output(undefined);
520
+ return;
521
+ }
522
+
523
+ const option = (arg: string) => `The "${arg}" of the "${name}" function`;
524
+ // A few options are written another way for the 4.x `Function`: `live`,
525
+ // `role`, `logging.logGroup` and `url.route`. They're taken here too. A
526
+ // `$transform` written for the 4.x one runs on this one, as they have
527
+ // the same type, and so does the definition of a function part.
528
+ const given = args as Record<string, any>;
529
+ const original: {
530
+ live?: boolean;
531
+ role?: Input<string>;
532
+ logGroup?: Input<string>;
533
+ } = {
534
+ live: given.live,
535
+ role: given.role,
536
+ logGroup: plain(given.logging, option("logging"))?.logGroup,
537
+ };
538
+
539
+ // The args that decide which resources are created are read first
540
+ const dev =
541
+ plain(args.dev, option("dev")) !== false &&
542
+ !(args.dev === undefined && original.live === false) &&
543
+ $dev;
544
+ const logging = normalizeLogging();
545
+ const url = normalizeUrl();
546
+ const python = plain(args.python, option("python"));
547
+ const container = plain(python?.container, option("python.container"));
548
+ const isContainer = !dev && Boolean(container);
549
+ const concurrency = plain(args.concurrency, option("concurrency"));
550
+ const provisioned = plain(
551
+ concurrency?.provisioned,
552
+ option("concurrency.provisioned"),
553
+ );
554
+
555
+ const partition = getPartitionOutput({}, opts).partition;
556
+ const region = getRegionOutput({}, opts).region;
557
+ const bootstrapData = region.apply((region) => bootstrap.forRegion(region));
558
+ const assetBucket = bootstrapData.apply((data) => data.asset);
559
+ // The key links are encrypted with, and the code of the dev stub, are
560
+ // created once for the app. `Function` holds them, so that an app with
561
+ // both kinds of function has one of each.
562
+ const encryptionKey = OriginalFunction["encryptionKey"]().base64;
563
+ const runtime = output(args.runtime ?? "nodejs24.x");
564
+ const architecture = withDefault(args.architecture, "x86_64");
565
+ const streaming = withDefault(args.streaming, false);
566
+ const injections = withDefault(args.injections, []);
567
+ // `Link.build` gives an output for each link, and `all` reads them. Left
568
+ // as outputs, each one's name would be an output where a string is read.
569
+ const links = output(args.link || []).apply((links) =>
570
+ all(Link.build(links)),
571
+ );
572
+ const copyFiles = normalizeCopyFiles();
573
+ const nodejs = normalizeNodeJs();
574
+ const vpc = normalizeVpc();
575
+ const volume = normalizeVolume();
576
+ const environment = normalizeEnvironment();
577
+ const durableConfig = normalizeDurable();
578
+
579
+ // 4.x takes the role's ARN. A role that's passed is looked up by its name.
580
+ const role =
581
+ this.existingPart("role") ??
582
+ (original.role
583
+ ? this.lookupPart(
584
+ "role",
585
+ output(original.role).apply((arn) => parseRoleArn(arn).roleName),
586
+ )
587
+ : this.part("role", roleArgs()));
588
+
589
+ const givenLogGroup =
590
+ original.logGroup !== undefined && !args.existing?.logGroup;
591
+ const logGroup = !logging
592
+ ? undefined
593
+ : givenLogGroup
594
+ ? this.lookupPart("logGroup", original.logGroup!)
595
+ : this.part(
596
+ "logGroup",
597
+ {
598
+ name: interpolate`/aws/lambda/${
599
+ args.name ?? physicalName(64, `${name}Function`)
600
+ }`,
601
+ retentionInDays: logging.retention,
602
+ },
603
+ { ignoreChanges: ["name"] },
604
+ );
605
+
606
+ // Build the code. In `sst dev` the stub is deployed in its place, and the
607
+ // CLI is told about the function so it can run it locally.
608
+ const buildInput = output({
609
+ functionID: name,
610
+ handler: args.handler,
611
+ bundle: args.bundle,
612
+ encryptionKey,
613
+ runtime,
614
+ links: links.apply((links) =>
615
+ Object.fromEntries(links.map((item) => [item.name, item.properties])),
616
+ ),
617
+ copyFiles,
618
+ properties: output({ nodejs, python }).apply((val) => ({
619
+ ...(val.nodejs || val.python),
620
+ architecture,
621
+ })),
622
+ dev,
623
+ });
624
+ if (dev) buildInput.apply((input) => rpc.call("Runtime.AddTarget", input));
625
+ // What's built is files on this machine. It's given the links, and a
626
+ // link's name is read from the component that's linked, so without this
627
+ // the code would depend on every resource of every linked component. A
628
+ // subscriber that links what it subscribes to would wait for itself.
629
+ const built: Output<FunctionBundle> = dev
630
+ ? output(devBridgeBundle(durable))
631
+ : withoutDependencies(
632
+ buildInput.apply((input) =>
633
+ buildBundle(
634
+ { ...input, isContainer },
635
+ args.hook && ((dir) => args.hook!.postbuild(dir)),
636
+ ),
637
+ ),
638
+ );
639
+ // A Node.js handler is wrapped in a file that runs the injections first
640
+ const entry = all([built, runtime, streaming, injections]).apply(
641
+ ([built, runtime, streaming, injections]): {
642
+ handler: string;
643
+ wrapper?: FunctionFile;
644
+ } =>
645
+ dev || !runtime.startsWith("nodejs")
646
+ ? { handler: built.handler }
647
+ : injectHandler(name, { ...built, streaming, injections }),
648
+ );
649
+ const handler = entry.apply((entry) => entry.handler);
650
+
651
+ const image = isContainer ? createImage() : undefined;
652
+ const code = isContainer
653
+ ? undefined
654
+ : output(dev ? devBridgeCode() : createCode());
655
+
656
+ // This is a hack to avoid handler being marked as having propertyDependencies.
657
+ // There is an unresolved bug in pulumi that causes issues when it does:
658
+ // "runtime and handler must be defined when code is zip".
659
+ // @ts-expect-error
660
+ handler.allResources = () => Promise.resolve(new Set());
661
+ const fn = this.part(
662
+ "function",
663
+ {
664
+ name: args.name,
665
+ description: args.description ?? "",
666
+ role: role.arn,
667
+ timeout: withDefault(args.timeout, "20 seconds", toSeconds),
668
+ memorySize: withDefault(args.memory, "1024 MB", toMBs),
669
+ ephemeralStorage: { size: withDefault(args.storage, "512 MB", toMBs) },
670
+ environment: { variables: environment },
671
+ architectures: [architecture],
672
+ loggingConfig: logging &&
673
+ logGroup && { logFormat: logging.format, logGroup: logGroup.name },
674
+ vpcConfig: vpc && {
675
+ securityGroupIds: vpc.securityGroups,
676
+ subnetIds: vpc.privateSubnets,
677
+ },
678
+ fileSystemConfig: volume && {
679
+ arn: volume.efs,
680
+ localMountPath: volume.path,
681
+ },
682
+ layers: args.layers,
683
+ tags: args.tags,
684
+ publish: output(args.versioning).apply((v) => v ?? durable),
685
+ reservedConcurrentExecutions: concurrency?.reserved,
686
+ durableConfig: durableConfig && {
687
+ executionTimeout: durableConfig.timeout,
688
+ retentionPeriod: durableConfig.retention,
689
+ },
690
+ ...(image
691
+ ? {
692
+ packageType: "Image",
693
+ imageUri: image.ref.apply((ref) => ref?.replace(":latest", "")),
694
+ imageConfig: {
695
+ commands: [
696
+ all([handler, runtime]).apply(([handler, runtime]) =>
697
+ // A Python image is given the handler as a module path:
698
+ // no leading "./", and "." in place of "/"
699
+ runtime.includes("python")
700
+ ? handler.replace(/\.\//g, "").replace(/\//g, ".")
701
+ : handler,
702
+ ),
703
+ ],
704
+ },
705
+ }
706
+ : {
707
+ packageType: "Zip",
708
+ s3Bucket: code!.apply((code) => code.bucket),
709
+ s3Key: code!.apply((code) => code.key),
710
+ handler: unsecret(handler),
711
+ runtime: runtime.apply((v) =>
712
+ v === "go" || v === "rust" ? "provided.al2023" : v,
713
+ ),
714
+ }),
715
+ },
716
+ // In `sst dev` the function is the stub, whatever its transform says
717
+ dev
718
+ ? {
719
+ transformations: [
720
+ ({ props, opts }) => ({
721
+ props: {
722
+ ...props,
723
+ description: props.description
724
+ ? output(props.description as Input<string>).apply(
725
+ (v) => (v ? `${v.substring(0, 240)} (live)` : "live"),
726
+ )
727
+ : "live",
728
+ runtime: durable ? "nodejs24.x" : "provided.al2023",
729
+ architectures: ["x86_64"],
730
+ },
731
+ opts,
732
+ }),
733
+ ],
734
+ }
735
+ : undefined,
736
+ );
737
+
738
+ this.fn = fn;
739
+ this.urlEndpoint = url ? createUrl(url) : output(undefined);
740
+
741
+ if (provisioned)
742
+ this.part("provisioned", {
743
+ functionName: fn.name,
744
+ qualifier: fn.publish.apply((publish) => {
745
+ if (publish !== true)
746
+ throw new VisibleError(
747
+ `Provisioned concurrency requires function versioning. Set "versioning: true" to enable function versioning.`,
748
+ );
749
+ return fn.version;
750
+ }),
751
+ provisionedConcurrentExecutions: provisioned,
752
+ });
753
+
754
+ if (args.retries !== undefined)
755
+ this.part("eventInvokeConfig", {
756
+ functionName: fn.name,
757
+ maximumRetryAttempts: args.retries,
758
+ });
759
+
760
+ this.registerOutputs({
761
+ // What's run locally in `sst dev`
762
+ _live: dev
763
+ ? unsecret(
764
+ all([
765
+ links,
766
+ args.handler,
767
+ args.bundle,
768
+ args.runtime,
769
+ nodejs,
770
+ copyFiles,
771
+ ]).apply(
772
+ ([links, handler, bundle, runtime, nodejs, copyFiles]) => ({
773
+ functionID: name,
774
+ links,
775
+ handler,
776
+ bundle,
777
+ runtime: runtime || "nodejs24.x",
778
+ copyFiles,
779
+ properties: nodejs,
780
+ }),
781
+ ),
782
+ )
783
+ : undefined,
784
+ _metadata: {
785
+ handler: args.handler,
786
+ internal: args._skipMetadata,
787
+ dev,
788
+ },
789
+ _hint: args._skipHint ? undefined : this.urlEndpoint,
790
+ });
791
+
792
+ function normalizeLogging() {
793
+ const logging = plain(args.logging, option("logging"));
794
+ if (logging === false) return undefined;
795
+
796
+ if (
797
+ logging?.retention !== undefined &&
798
+ (args.existing?.logGroup || original.logGroup !== undefined)
799
+ )
800
+ throw new VisibleError(
801
+ `Cannot set "logging.retention" for the "${name}" function: it's given a log group, and that log group has its own retention.`,
802
+ );
803
+
804
+ return {
805
+ retention: output(logging?.retention).apply(
806
+ (retention) => RETENTION[retention ?? "1 month"],
807
+ ),
808
+ format: output(logging?.format).apply((format) => {
809
+ if (durable && format && format !== "json")
810
+ throw new VisibleError(
811
+ `Durable functions require "logging.format" to be set to "json"`,
812
+ );
813
+ return (format ?? (durable ? "json" : "text")) === "json"
814
+ ? "JSON"
815
+ : "Text";
816
+ }),
817
+ };
818
+ }
819
+
820
+ function normalizeUrl() {
821
+ const url = plain(args.url, option("url"));
822
+ if (url === false || url === undefined) return undefined;
823
+ const urlArgs = url === true ? {} : url;
824
+ // 4.x names the router `route.router`
825
+ const { router: instance, ...routing } =
826
+ plain((urlArgs as any).route, option("url.route")) ?? {};
827
+ const router =
828
+ urlArgs.router ?? (instance ? { ...routing, instance } : undefined);
829
+
830
+ const defaultCors: types.input.lambda.FunctionUrlCors = {
831
+ allowHeaders: ["*"],
832
+ allowMethods: ["*"],
833
+ allowOrigins: ["*"],
834
+ };
835
+ return {
836
+ authorization:
837
+ plain(urlArgs.authorization, option("url.authorization")) ?? "none",
838
+ cors: output(urlArgs.cors).apply((cors) =>
839
+ cors === false
840
+ ? undefined
841
+ : cors === true || cors === undefined
842
+ ? defaultCors
843
+ : {
844
+ ...defaultCors,
845
+ ...cors,
846
+ maxAge: cors.maxAge && toSeconds(cors.maxAge),
847
+ },
848
+ ),
849
+ route: normalizeRouteArgs(plain(router, option("url.router"))),
850
+ };
851
+ }
852
+
853
+ function normalizeCopyFiles() {
854
+ return output(args.copyFiles ?? []).apply((copyFiles) =>
855
+ Promise.all(
856
+ copyFiles.map(async (entry) => {
857
+ const from = path.join($cli.paths.root, entry.from);
858
+ const to = entry.to || entry.from;
859
+ if (path.isAbsolute(to))
860
+ throw new VisibleError(
861
+ `Copy destination path "${to}" must be relative`,
862
+ );
863
+
864
+ const stats = await fs.promises.stat(from);
865
+ return { from, to, isDir: stats.isDirectory() };
866
+ }),
867
+ ),
868
+ );
869
+ }
870
+
871
+ function normalizeNodeJs() {
872
+ return output(args.nodejs).apply((nodejs) =>
873
+ nodejs?.install && Array.isArray(nodejs.install)
874
+ ? {
875
+ ...nodejs,
876
+ install: Object.fromEntries(
877
+ nodejs.install.map((dep) => [dep, "*"]),
878
+ ),
879
+ }
880
+ : nodejs,
881
+ );
882
+ }
883
+
884
+ function normalizeVpc() {
885
+ if (!args.vpc) return;
886
+
887
+ if (isVpc(args.vpc)) {
888
+ const result = {
889
+ privateSubnets: args.vpc.privateSubnets,
890
+ securityGroups: args.vpc.securityGroups,
891
+ };
892
+ return all([
893
+ args.vpc.id,
894
+ args.vpc.nodes.natGateways,
895
+ args.vpc.nodes.natInstances,
896
+ ]).apply(([id, natGateways, natInstances]) => {
897
+ if (natGateways.length === 0 && natInstances.length === 0) {
898
+ warnOnce(
899
+ `\nWarning: One or more functions are deployed in the "${id}" VPC, which does not have a NAT gateway. As a result, these functions cannot access the internet. If your functions need internet access, enable it by setting the "nat" prop on the "Vpc" component.\n`,
900
+ );
901
+ }
902
+ return result;
903
+ });
904
+ }
905
+
906
+ return output(args.vpc).apply((vpc) => {
907
+ if (vpc.subnets) {
908
+ throw new VisibleError(
909
+ `The "vpc.subnets" property has been renamed to "vpc.privateSubnets". Update your code to use "vpc.privateSubnets" instead.`,
910
+ );
911
+ }
912
+ return vpc;
913
+ });
914
+ }
915
+
916
+ function normalizeVolume() {
917
+ if (!args.volume) return;
918
+
919
+ return output(args.volume).apply((volume) => ({
920
+ efs:
921
+ volume.efs instanceof OriginalEfs || volume.efs instanceof Efs
922
+ ? volume.efs.nodes.accessPoint.arn
923
+ : output(volume.efs),
924
+ path: volume.path ?? "/mnt/efs",
925
+ }));
926
+ }
927
+
928
+ function normalizeDurable() {
929
+ if (!args.durable) return;
930
+ const config = args.durable === true ? {} : args.durable;
931
+ return {
932
+ timeout: withDefault(config.timeout, "14 days", toSeconds),
933
+ retention: withDefault(config.retention, "30 days", toDays),
934
+ };
935
+ }
936
+
937
+ function normalizeEnvironment() {
938
+ return all([
939
+ args.environment,
940
+ bootstrapData,
941
+ encryptionKey,
942
+ args.link,
943
+ args.streaming,
944
+ args.bundle,
945
+ dev ? OriginalFunction.appsync() : undefined,
946
+ ]).apply(([environment, bootstrap, key, link, streaming, bundle, appsync]) => {
947
+ const result = environment ?? {};
948
+ result.SST_RESOURCE_App = JSON.stringify({
949
+ name: $app.name,
950
+ stage: $app.stage,
951
+ });
952
+ for (const linkable of link || []) {
953
+ if (!Link.isLinkable(linkable)) continue;
954
+ const def = linkable.getSSTLink();
955
+ for (const item of def.include || []) {
956
+ if (item.type === "environment") Object.assign(result, item.env);
957
+ }
958
+ }
959
+ result.SST_KEY = key;
960
+ // Functions that share a `bundle` each have their own file, under
961
+ // `.sst/<name>/`, where the CLI writes it
962
+ result.SST_KEY_FILE = bundle
963
+ ? `.sst/${name}/resource.enc`
964
+ : "resource.enc";
965
+ if (dev) {
966
+ result.SST_REGION = process.env.SST_AWS_REGION!;
967
+ result.SST_APPSYNC_HTTP = appsync.http;
968
+ result.SST_APPSYNC_REALTIME = appsync.realtime;
969
+ result.SST_FUNCTION_ID = name;
970
+ result.SST_APP = $app.name;
971
+ result.SST_STAGE = $app.stage;
972
+ result.SST_ASSET_BUCKET = bootstrap.asset;
973
+ if (process.env.SST_FUNCTION_TIMEOUT) {
974
+ result.SST_FUNCTION_TIMEOUT = process.env.SST_FUNCTION_TIMEOUT;
975
+ }
976
+ if (streaming) {
977
+ result.SST_FUNCTION_STREAMING = "true";
978
+ }
979
+ }
980
+ return result;
981
+ });
982
+ }
983
+
984
+ function roleArgs(): iam.RoleArgs {
985
+ const linkPermissions = Link.getInclude<Permission>(
986
+ "aws.permission",
987
+ args.link,
988
+ );
989
+ // In `sst dev` the stub talks to the CLI through AppSync and the asset bucket
990
+ const devPermissions = dev
991
+ ? [
992
+ { effect: "allow", actions: ["appsync:*"], resources: ["*"] },
993
+ {
994
+ effect: "allow",
995
+ actions: ["s3:*"],
996
+ resources: [
997
+ interpolate`arn:${partition}:s3:::${assetBucket}`,
998
+ interpolate`arn:${partition}:s3:::${assetBucket}/*`,
999
+ ],
1000
+ },
1001
+ ]
1002
+ : [];
1003
+ const policy = all([args.permissions || [], linkPermissions]).apply(
1004
+ ([argsPermissions, linkPermissions]) =>
1005
+ iam.getPolicyDocumentOutput({
1006
+ statements: [
1007
+ ...argsPermissions,
1008
+ ...linkPermissions,
1009
+ ...devPermissions,
1010
+ ].map((item) => ({
1011
+ effect: (() => {
1012
+ const effect = item.effect ?? "allow";
1013
+ return effect.charAt(0).toUpperCase() + effect.slice(1);
1014
+ })(),
1015
+ actions: item.actions,
1016
+ resources: item.resources,
1017
+ conditions: "conditions" in item ? item.conditions : undefined,
1018
+ })),
1019
+ }),
1020
+ );
1021
+
1022
+ const managed = (policy: string) =>
1023
+ interpolate`arn:${partition}:iam::aws:policy/service-role/${policy}`;
1024
+ return {
1025
+ // Only `sst dev` trusts the account too, so the CLI can take the role
1026
+ // to run the function locally. This goes by `$dev`, as `Function`
1027
+ // does, and not by the function's own `dev`: a site's dev server is
1028
+ // created with `dev: false`, and the CLI still takes its role.
1029
+ assumeRolePolicy: iam.getPolicyDocumentOutput({
1030
+ statements: [
1031
+ {
1032
+ actions: ["sts:AssumeRole"],
1033
+ principals: [
1034
+ {
1035
+ type: "Service",
1036
+ identifiers: ["lambda.amazonaws.com"],
1037
+ },
1038
+ ...($dev
1039
+ ? [
1040
+ {
1041
+ type: "AWS",
1042
+ identifiers: [
1043
+ interpolate`arn:${partition}:iam::${
1044
+ getCallerIdentityOutput({}, opts).accountId
1045
+ }:root`,
1046
+ ],
1047
+ },
1048
+ ]
1049
+ : []),
1050
+ ],
1051
+ },
1052
+ ],
1053
+ }).json,
1054
+ // if there are no statements, do not add an inline policy.
1055
+ // adding an inline policy with no statements will cause an error.
1056
+ inlinePolicies: policy.apply(({ statements }) =>
1057
+ statements ? [{ name: "inline", policy: policy.json }] : [],
1058
+ ),
1059
+ managedPolicyArns: output(args.policies ?? []).apply((policies) => [
1060
+ ...policies,
1061
+ ...(logging ? [managed("AWSLambdaBasicExecutionRole")] : []),
1062
+ ...(vpc ? [managed("AWSLambdaVPCAccessExecutionRole")] : []),
1063
+ ...(durable
1064
+ ? [managed("AWSLambdaBasicDurableExecutionRolePolicy")]
1065
+ : []),
1066
+ ]),
1067
+ };
1068
+ }
1069
+
1070
+ // The build has already put the user's code, its config and a Dockerfile
1071
+ // in the artifact directory. What's left is to build the image and push
1072
+ // it to the container registry.
1073
+ function createImage() {
1074
+ const authToken = ecr.getAuthorizationTokenOutput({
1075
+ registryId: bootstrapData.assetEcrRegistryId,
1076
+ });
1077
+ // Set unless the cache is switched off
1078
+ const cached = output(
1079
+ typeof container === "object" ? container.cache : undefined,
1080
+ ).apply((cache) => (cache === false ? undefined : true));
1081
+ const cacheRef = interpolate`${bootstrapData.assetEcrUrl}:${name}-cache`;
1082
+
1083
+ return self.part("image", {
1084
+ tags: [interpolate`${bootstrapData.assetEcrUrl}:latest`],
1085
+ context: {
1086
+ // Read once the code is built, so the image is built after it
1087
+ location: built.apply(() =>
1088
+ path.join($cli.paths.work, "artifacts", `${name}-src`),
1089
+ ),
1090
+ },
1091
+ cacheFrom: ifSet(cached, () => [{ registry: { ref: cacheRef } }]),
1092
+ cacheTo: ifSet(cached, () => [
1093
+ {
1094
+ registry: {
1095
+ ref: cacheRef,
1096
+ imageManifest: true,
1097
+ ociMediaTypes: true,
1098
+ mode: "max" as const,
1099
+ },
1100
+ },
1101
+ ]),
1102
+ platforms: [
1103
+ architecture.apply((v) =>
1104
+ v === "arm64" ? "linux/arm64" : "linux/amd64",
1105
+ ),
1106
+ ],
1107
+ push: true,
1108
+ registries: [
1109
+ authToken.apply((authToken) => ({
1110
+ address: authToken.proxyEndpoint,
1111
+ username: authToken.userName,
1112
+ password: secret(authToken.password),
1113
+ })),
1114
+ ],
1115
+ });
1116
+ }
1117
+
1118
+ function createCode() {
1119
+ const zip = all([built, entry, copyFiles, args.bundle]).apply(
1120
+ ([built, entry, copyFiles, customBundle]) =>
1121
+ zipCode({
1122
+ to: path.resolve($cli.paths.work, "artifacts", name, "code.zip"),
1123
+ bundle: built.bundle,
1124
+ sourcemaps: built.sourcemaps,
1125
+ copyFiles,
1126
+ wrapper: entry.wrapper,
1127
+ sharedBundle: customBundle ? name : undefined,
1128
+ }),
1129
+ );
1130
+
1131
+ // The source maps are stored under the log group the function creates,
1132
+ // which is where the errors to map are read from. How many there are
1133
+ // is only known once the code is built.
1134
+ const ownLogGroup =
1135
+ self.existingPart("logGroup") || givenLogGroup ? undefined : logGroup;
1136
+ if (ownLogGroup)
1137
+ all([built, zip]).apply(([built, zip]) =>
1138
+ (built.sourcemaps ?? []).forEach((file, index) =>
1139
+ self.part(
1140
+ "sourcemap",
1141
+ `${index}`,
1142
+ {
1143
+ key: interpolate`sourcemap/${ownLogGroup.arn}/${
1144
+ zip.hash
1145
+ }.${path.basename(file)}`,
1146
+ bucket: assetBucket,
1147
+ source: new asset.FileAsset(file),
1148
+ },
1149
+ { retainOnDelete: true },
1150
+ ),
1151
+ ),
1152
+ );
1153
+
1154
+ return self.part("code", {
1155
+ key: interpolate`assets/${name}-code-${zip.hash}.zip`,
1156
+ bucket: assetBucket,
1157
+ source: zip.apply((zip) => new asset.FileArchive(zip.path)),
1158
+ });
1159
+ }
1160
+
1161
+ // Every live function in a region is created from the same stub, so its
1162
+ // code is uploaded once for the app, outside of any function.
1163
+ function devBridgeCode() {
1164
+ return all([built, region]).apply(([{ bundle }, region]) => {
1165
+ const cache = OriginalFunction["devBridgeCode"]();
1166
+ const cacheKey = `${region}:${bundle}`;
1167
+ const cached = cache.get(cacheKey);
1168
+ if (cached) return cached;
1169
+
1170
+ const stub = logicalName(path.basename(bundle));
1171
+ const created = zipCode({
1172
+ to: path.resolve(
1173
+ $cli.paths.work,
1174
+ "artifacts",
1175
+ `dev-bridge-${region}-${stub}`,
1176
+ "code.zip",
1177
+ ),
1178
+ bundle,
1179
+ }).then(
1180
+ (zip) =>
1181
+ new s3.BucketObjectv2(
1182
+ `DevBridgeCode${logicalName(region)}${stub}`,
1183
+ {
1184
+ key: `assets/dev-bridge-code-${zip.hash}.zip`,
1185
+ bucket: assetBucket,
1186
+ source: new asset.FileArchive(zip.path),
1187
+ },
1188
+ {
1189
+ parent: rootStackResource,
1190
+ provider: opts?.provider,
1191
+ // The dev bridge key is shared by every app and stage in this
1192
+ // account and region. Retain it so removing a stage, deploying it
1193
+ // outside dev, or changing its bridge version doesn't delete the
1194
+ // object other stages' Lambdas are still created from.
1195
+ retainOnDelete: true,
1196
+ },
1197
+ ),
1198
+ );
1199
+ cache.set(cacheKey, created);
1200
+ created.catch(() => cache.delete(cacheKey));
1201
+ return created;
1202
+ });
1203
+ }
1204
+
1205
+ function createUrl(url: NonNullable<ReturnType<typeof normalizeUrl>>) {
1206
+ const { authorization, route } = url;
1207
+ // A router can sign its requests to the URL. Then only its
1208
+ // distribution may call the URL, whatever the authorization is.
1209
+ const isOac = output(route?.routerProtection).apply(
1210
+ (p) => p?.mode === "oac" || p?.mode === "oac-with-edge-signing",
1211
+ );
1212
+
1213
+ /**
1214
+ * Lambda Function URLs only accept alias names in the explicit `qualifier`
1215
+ * field. Durable functions with URLs therefore need an alias target here,
1216
+ * even when the underlying function is still on `$LATEST`.
1217
+ * See https://github.com/hashicorp/terraform-provider-aws/issues/31459
1218
+ */
1219
+ const alias = durable
1220
+ ? self.part("urlAlias", {
1221
+ functionName: fn.arn,
1222
+ functionVersion: fn.version,
1223
+ })
1224
+ : undefined;
1225
+
1226
+ const fnUrl = self.part("url", {
1227
+ functionName: durable ? fn.arn : fn.name,
1228
+ qualifier: alias?.name,
1229
+ authorizationType: isOac.apply((oac) =>
1230
+ oac || authorization === "iam" ? "AWS_IAM" : "NONE",
1231
+ ),
1232
+ invokeMode: streaming.apply((streaming) =>
1233
+ streaming ? "RESPONSE_STREAM" : "BUFFERED",
1234
+ ),
1235
+ cors: ifSet(url.cors),
1236
+ });
1237
+
1238
+ // Lambda takes one change to a function at a time, so a permission
1239
+ // added while the URL is still being created can fail with a conflict.
1240
+ // The permissions wait for the URL.
1241
+ const afterUrl = { dependsOn: [fnUrl] };
1242
+
1243
+ const allowEveryone = () => {
1244
+ self.part(
1245
+ "urlAccess",
1246
+ {
1247
+ action: "lambda:InvokeFunctionUrl",
1248
+ function: fn.name,
1249
+ principal: "*",
1250
+ functionUrlAuthType: "NONE",
1251
+ },
1252
+ afterUrl,
1253
+ );
1254
+ self.part(
1255
+ "urlInvoke",
1256
+ {
1257
+ action: "lambda:InvokeFunction",
1258
+ function: fn.name,
1259
+ principal: "*",
1260
+ invokedViaFunctionUrl: true,
1261
+ },
1262
+ afterUrl,
1263
+ );
1264
+ };
1265
+
1266
+ if (!route) {
1267
+ if (authorization === "none") allowEveryone();
1268
+ return fnUrl.functionUrl;
1269
+ }
1270
+
1271
+ // Who may call the URL depends on how the router protects its origins,
1272
+ // and that's only known once the router is.
1273
+ all([isOac, route.routerDistributionArn]).apply(
1274
+ ([oac, distributionArn]) => {
1275
+ if (oac && distributionArn) {
1276
+ self.part(
1277
+ "urlAccess",
1278
+ {
1279
+ action: "lambda:InvokeFunctionUrl",
1280
+ function: fn.name,
1281
+ principal: "cloudfront.amazonaws.com",
1282
+ sourceArn: distributionArn,
1283
+ },
1284
+ afterUrl,
1285
+ );
1286
+ self.part(
1287
+ "urlInvoke",
1288
+ {
1289
+ action: "lambda:InvokeFunction",
1290
+ function: fn.name,
1291
+ principal: "cloudfront.amazonaws.com",
1292
+ sourceArn: distributionArn,
1293
+ invokedViaFunctionUrl: true,
1294
+ },
1295
+ afterUrl,
1296
+ );
1297
+ } else if (authorization === "none") allowEveryone();
1298
+ },
1299
+ );
1300
+
1301
+ const routeNamespace = crypto
1302
+ .createHash("md5")
1303
+ .update(`${$app.name}-${$app.stage}-${name}`)
1304
+ .digest("hex")
1305
+ .substring(0, 4);
1306
+ self.part("routeKey", {
1307
+ store: route.routerKvStoreArn,
1308
+ namespace: routeNamespace,
1309
+ entries: all([fnUrl.functionUrl, isOac, route]).apply(
1310
+ ([fnUrlValue, oac, route]) => {
1311
+ const timeouts = [
1312
+ "connectionTimeout" as const,
1313
+ "readTimeout" as const,
1314
+ "keepAliveTimeout" as const,
1315
+ ].flatMap((k) => {
1316
+ const value = route[k];
1317
+ return value ? [[k, toSeconds(value)]] : [];
1318
+ });
1319
+ return {
1320
+ metadata: JSON.stringify({
1321
+ host: new URL(fnUrlValue).host,
1322
+ rewrite: route.rewrite,
1323
+ origin: {
1324
+ ...(oac
1325
+ ? {
1326
+ originAccessControlConfig: {
1327
+ enabled: true,
1328
+ signingBehavior: "always",
1329
+ signingProtocol: "sigv4",
1330
+ originType: "lambda",
1331
+ },
1332
+ }
1333
+ : {}),
1334
+ connectionAttempts: route.connectionAttempts,
1335
+ ...(timeouts.length
1336
+ ? { timeouts: Object.fromEntries(timeouts) }
1337
+ : {}),
1338
+ },
1339
+ }),
1340
+ };
1341
+ },
1342
+ ),
1343
+ purge: false,
1344
+ });
1345
+ self.part("routesUpdate", {
1346
+ store: route.routerKvStoreArn,
1347
+ namespace: route.routerKvNamespace,
1348
+ key: "routes",
1349
+ entry: route.apply((route) =>
1350
+ ["url", routeNamespace, route.hostPattern, route.pathPrefix].join(
1351
+ ",",
1352
+ ),
1353
+ ),
1354
+ });
1355
+ return route.routerUrl;
1356
+ }
1357
+ }
1358
+
1359
+ /**
1360
+ * The Lambda function URL if `url` is enabled.
1361
+ */
1362
+ public get url() {
1363
+ return this.urlEndpoint.apply((url) => {
1364
+ if (!url) {
1365
+ throw new VisibleError(
1366
+ `Function URL is not enabled. Enable it with "url: true".`,
1367
+ );
1368
+ }
1369
+ return url;
1370
+ });
1371
+ }
1372
+
1373
+ /**
1374
+ * The name of the Lambda function.
1375
+ */
1376
+ public get name() {
1377
+ return this.fn.name;
1378
+ }
1379
+
1380
+ /**
1381
+ * The ARN of the Lambda function.
1382
+ */
1383
+ public get arn() {
1384
+ return this.fn.arn;
1385
+ }
1386
+
1387
+ // A function with versions, or a durable one, is invoked through its
1388
+ // latest version.
1389
+ private get useQualifiedTarget() {
1390
+ return this.fn.publish.apply(
1391
+ (publish) => (publish ?? false) || this.durable,
1392
+ );
1393
+ }
1394
+
1395
+ /** @internal */
1396
+ public get targetArn() {
1397
+ return this.useQualifiedTarget.apply((useQualifiedTarget) =>
1398
+ useQualifiedTarget ? this.fn.qualifiedArn : this.arn,
1399
+ );
1400
+ }
1401
+
1402
+ /** @internal */
1403
+ public get qualifier() {
1404
+ return this.targetArn.apply(
1405
+ (arn) => splitQualifiedFunctionArn(arn).qualifier,
1406
+ );
1407
+ }
1408
+
1409
+ /** @internal */
1410
+ public get targetInvokeArn() {
1411
+ return this.useQualifiedTarget.apply((useQualifiedTarget) =>
1412
+ useQualifiedTarget ? this.fn.qualifiedInvokeArn : this.fn.invokeArn,
1413
+ );
1414
+ }
1415
+
1416
+ /** @internal */
1417
+ public get targetResponseStreamingInvokeArn() {
1418
+ return this.useQualifiedTarget.apply((useQualifiedTarget) =>
1419
+ useQualifiedTarget
1420
+ ? all([
1421
+ this.arn,
1422
+ this.fn.qualifiedArn,
1423
+ this.fn.responseStreamingInvokeArn,
1424
+ ]).apply(([arn, qualifiedArn, responseStreamingInvokeArn]) =>
1425
+ responseStreamingInvokeArn.replace(arn, qualifiedArn),
1426
+ )
1427
+ : this.fn.responseStreamingInvokeArn,
1428
+ );
1429
+ }
1430
+
1431
+ /**
1432
+ * Add environment variables lazily to the function after the function is created.
1433
+ *
1434
+ * This is useful for adding environment variables that are only available after the
1435
+ * function is created, like the function URL. It can be called once.
1436
+ *
1437
+ * @param environment The environment variables to add to the function.
1438
+ *
1439
+ * @example
1440
+ * Add the function URL as an environment variable.
1441
+ *
1442
+ * ```ts title="sst.config.ts"
1443
+ * const fn = new sst.aws.v5.Function("MyFunction", {
1444
+ * handler: "src/handler.handler",
1445
+ * url: true,
1446
+ * });
1447
+ *
1448
+ * fn.addEnvironment({
1449
+ * URL: fn.url,
1450
+ * });
1451
+ * ```
1452
+ */
1453
+ public addEnvironment(environment: Input<Record<string, Input<string>>>) {
1454
+ if (this.nodes.environmentUpdate)
1455
+ throw new VisibleError(
1456
+ `"addEnvironment" was already called on the "${this.componentName}" function. Pass all of the environment variables in one call.`,
1457
+ );
1458
+ return this.part("environmentUpdate", {
1459
+ functionName: this.name,
1460
+ environment,
1461
+ region: getRegionOutput(undefined, { parent: this }).region,
1462
+ functionLastModified: this.fn.lastModified,
1463
+ });
1464
+ }
1465
+
1466
+ /**
1467
+ * Linking a function gives the linked resource its name and URL, and lets it invoke
1468
+ * the function.
1469
+ */
1470
+ public link() {
1471
+ return {
1472
+ properties: {
1473
+ name: this.name,
1474
+ url: this.urlEndpoint,
1475
+ ...(this.durable ? { qualifier: this.qualifier } : {}),
1476
+ },
1477
+ include: [
1478
+ permission({
1479
+ actions: [
1480
+ "lambda:InvokeFunction",
1481
+ ...(this.durable
1482
+ ? [
1483
+ "lambda:ListDurableExecutionsByFunction",
1484
+ "lambda:GetDurableExecution",
1485
+ "lambda:GetDurableExecutionHistory",
1486
+ "lambda:StopDurableExecution",
1487
+ "lambda:SendDurableExecutionCallbackSuccess",
1488
+ "lambda:SendDurableExecutionCallbackFailure",
1489
+ "lambda:SendDurableExecutionCallbackHeartbeat",
1490
+ ]
1491
+ : []),
1492
+ ],
1493
+ resources: [this.durable ? interpolate`${this.arn}:*` : this.arn],
1494
+ }),
1495
+ ],
1496
+ };
1497
+ }
1498
+
1499
+ /**
1500
+ * Reference an existing function with the given function name. This is useful when you
1501
+ * create a function in one stage and want to share it in another. Linking it gives the
1502
+ * linked resource its name and lets it invoke the function.
1503
+ *
1504
+ * @param name The name of the component.
1505
+ * @param functionName The name of the existing Lambda function.
1506
+ * @param opts Component resource options.
1507
+ *
1508
+ * @example
1509
+ *
1510
+ * ```ts title="sst.config.ts"
1511
+ * const fn = $app.stage === "frank"
1512
+ * ? sst.aws.v5.Function.get("MyFunction", "app-dev-MyFunctionFunction-abcdefgh")
1513
+ * : new sst.aws.v5.Function("MyFunction", { handler: "src/lambda.handler" });
1514
+ * ```
1515
+ */
1516
+ public static get(
1517
+ name: string,
1518
+ functionName: Input<string>,
1519
+ opts?: ComponentResourceOptions,
1520
+ ) {
1521
+ return new Function(
1522
+ name,
1523
+ { existing: { function: functionName } } as FunctionArgs,
1524
+ opts,
1525
+ );
1526
+ }
1527
+ }