@monorise/sst 3.0.0 → 4.0.0
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.
- package/dist/.sst/platform/src/components/aws/alb.d.ts +280 -0
- package/dist/.sst/platform/src/components/aws/alb.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/apigateway-websocket-route.d.ts +1 -1
- package/dist/.sst/platform/src/components/aws/apigateway-websocket-route.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/apigateway-websocket.d.ts +13 -2
- package/dist/.sst/platform/src/components/aws/apigateway-websocket.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv1-authorizer.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv1-lambda-route.d.ts +1 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv1-lambda-route.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv1.d.ts +93 -83
- package/dist/.sst/platform/src/components/aws/apigatewayv1.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv2-authorizer.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv2-lambda-route.d.ts +1 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv2-lambda-route.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv2.d.ts +9 -5
- package/dist/.sst/platform/src/components/aws/apigatewayv2.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/app-sync-data-source.d.ts +1 -1
- package/dist/.sst/platform/src/components/aws/app-sync-data-source.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/app-sync.d.ts +1 -1
- package/dist/.sst/platform/src/components/aws/app-sync.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/aurora.d.ts +22 -4
- package/dist/.sst/platform/src/components/aws/aurora.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/auth-v1.d.ts +1 -1
- package/dist/.sst/platform/src/components/aws/auth-v1.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/auth.d.ts +38 -3
- package/dist/.sst/platform/src/components/aws/auth.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/bucket-lambda-subscriber.d.ts +1 -1
- package/dist/.sst/platform/src/components/aws/bucket-lambda-subscriber.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/bucket-notification.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/bucket.d.ts +114 -8
- package/dist/.sst/platform/src/components/aws/bucket.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/bus-lambda-subscriber.d.ts +3 -2
- package/dist/.sst/platform/src/components/aws/bus-lambda-subscriber.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/bus.d.ts +34 -3
- package/dist/.sst/platform/src/components/aws/bus.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/cdn.d.ts +11 -0
- package/dist/.sst/platform/src/components/aws/cdn.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/cluster.d.ts +60 -4
- package/dist/.sst/platform/src/components/aws/cluster.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/cognito-identity-pool.d.ts +5 -0
- package/dist/.sst/platform/src/components/aws/cognito-identity-pool.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/cognito-user-pool-client.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/cognito-user-pool.d.ts +104 -0
- package/dist/.sst/platform/src/components/aws/cognito-user-pool.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/cron-v2.d.ts +325 -0
- package/dist/.sst/platform/src/components/aws/cron-v2.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/cron.d.ts +15 -6
- package/dist/.sst/platform/src/components/aws/cron.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/dsql.d.ts +369 -0
- package/dist/.sst/platform/src/components/aws/dsql.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/dynamo-lambda-subscriber.d.ts +1 -1
- package/dist/.sst/platform/src/components/aws/dynamo-lambda-subscriber.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/dynamo.d.ts +63 -4
- package/dist/.sst/platform/src/components/aws/dynamo.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/email.d.ts +6 -1
- package/dist/.sst/platform/src/components/aws/email.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/fargate.d.ts +129 -4
- package/dist/.sst/platform/src/components/aws/fargate.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/function.d.ts +122 -24
- package/dist/.sst/platform/src/components/aws/function.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/helpers/arn.d.ts +16 -0
- package/dist/.sst/platform/src/components/aws/helpers/arn.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/helpers/container-builder.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/helpers/function-builder.d.ts +7 -3
- package/dist/.sst/platform/src/components/aws/helpers/function-builder.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/helpers/load-balancer.d.ts +9 -0
- package/dist/.sst/platform/src/components/aws/helpers/load-balancer.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/aws/helpers/provider.d.ts +2 -2
- package/dist/.sst/platform/src/components/aws/helpers/provider.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/helpers/site-builder.d.ts +1 -1
- package/dist/.sst/platform/src/components/aws/helpers/site-builder.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/helpers/subscriber.d.ts +1 -1
- package/dist/.sst/platform/src/components/aws/helpers/subscriber.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/https-redirect.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/index.d.ts +4 -0
- package/dist/.sst/platform/src/components/aws/index.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/kinesis-stream-lambda-subscriber.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/kinesis-stream.d.ts +8 -3
- package/dist/.sst/platform/src/components/aws/kinesis-stream.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/linkable.d.ts +1 -1
- package/dist/.sst/platform/src/components/aws/linkable.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/mysql.d.ts +34 -5
- package/dist/.sst/platform/src/components/aws/mysql.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/nextjs.d.ts +39 -5
- package/dist/.sst/platform/src/components/aws/nextjs.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/nuxt.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/open-search.d.ts +16 -5
- package/dist/.sst/platform/src/components/aws/open-search.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/opencontrol.d.ts +7 -3
- package/dist/.sst/platform/src/components/aws/opencontrol.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/permission.d.ts +18 -0
- package/dist/.sst/platform/src/components/aws/permission.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/postgres-v1.d.ts +13 -2
- package/dist/.sst/platform/src/components/aws/postgres-v1.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/postgres.d.ts +37 -8
- package/dist/.sst/platform/src/components/aws/postgres.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/queue-lambda-subscriber.d.ts +6 -1
- package/dist/.sst/platform/src/components/aws/queue-lambda-subscriber.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/queue.d.ts +10 -1
- package/dist/.sst/platform/src/components/aws/queue.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/realtime-lambda-subscriber.d.ts +1 -1
- package/dist/.sst/platform/src/components/aws/realtime-lambda-subscriber.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/realtime.d.ts +12 -1
- package/dist/.sst/platform/src/components/aws/realtime.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/redis-v1.d.ts +10 -0
- package/dist/.sst/platform/src/components/aws/redis-v1.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/redis.d.ts +14 -0
- package/dist/.sst/platform/src/components/aws/redis.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/remix.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/router.d.ts +501 -15
- package/dist/.sst/platform/src/components/aws/router.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/service-v1.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/service.d.ts +151 -0
- package/dist/.sst/platform/src/components/aws/service.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/sns-topic-lambda-subscriber.d.ts +1 -1
- package/dist/.sst/platform/src/components/aws/sns-topic-lambda-subscriber.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/sns-topic.d.ts +6 -1
- package/dist/.sst/platform/src/components/aws/sns-topic.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/solid-start.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/ssr-site.d.ts +204 -13
- package/dist/.sst/platform/src/components/aws/ssr-site.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/static-site.d.ts +5 -5
- package/dist/.sst/platform/src/components/aws/static-site.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/step-functions/state.d.ts +35 -1
- package/dist/.sst/platform/src/components/aws/step-functions/state.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/step-functions/task.d.ts +10 -2
- package/dist/.sst/platform/src/components/aws/step-functions/task.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/step-functions.d.ts +5 -0
- package/dist/.sst/platform/src/components/aws/step-functions.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/svelte-kit.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/tan-stack-start.d.ts +20 -6
- package/dist/.sst/platform/src/components/aws/tan-stack-start.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/task.d.ts +35 -15
- package/dist/.sst/platform/src/components/aws/task.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/vector.d.ts +5 -0
- package/dist/.sst/platform/src/components/aws/vector.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/vpc.d.ts +51 -4
- package/dist/.sst/platform/src/components/aws/vpc.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/workflow.d.ts +331 -0
- package/dist/.sst/platform/src/components/aws/workflow.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/base/base-ssr-site.d.ts +1 -99
- package/dist/.sst/platform/src/components/base/base-ssr-site.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/base/base-static-site.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/ai.d.ts +82 -0
- package/dist/.sst/platform/src/components/cloudflare/ai.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/binding.d.ts +16 -2
- package/dist/.sst/platform/src/components/cloudflare/binding.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/bucket.d.ts +8 -4
- package/dist/.sst/platform/src/components/cloudflare/bucket.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/cron.d.ts +29 -5
- package/dist/.sst/platform/src/components/cloudflare/cron.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/d1.d.ts +38 -3
- package/dist/.sst/platform/src/components/cloudflare/d1.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/experimental/astro.d.ts +186 -0
- package/dist/.sst/platform/src/components/cloudflare/experimental/astro.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/experimental/index.d.ts +4 -0
- package/dist/.sst/platform/src/components/cloudflare/experimental/index.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/experimental/solid-start.d.ts +171 -0
- package/dist/.sst/platform/src/components/cloudflare/experimental/solid-start.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/experimental/static-site.d.ts +222 -0
- package/dist/.sst/platform/src/components/cloudflare/experimental/static-site.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/helpers/fetch.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/helpers/worker-builder.d.ts +1 -1
- package/dist/.sst/platform/src/components/cloudflare/helpers/worker-builder.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/index.d.ts +5 -1
- package/dist/.sst/platform/src/components/cloudflare/index.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/kv.d.ts +44 -4
- package/dist/.sst/platform/src/components/cloudflare/kv.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/providers/kv-data.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/providers/worker-assets.d.ts +18 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/worker-assets.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/worker-placement.d.ts +27 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/worker-placement.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/zone-lookup.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/queue-worker-subscriber.d.ts +116 -0
- package/dist/.sst/platform/src/components/cloudflare/queue-worker-subscriber.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/queue.d.ts +187 -4
- package/dist/.sst/platform/src/components/cloudflare/queue.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/ssr-site.d.ts +34 -42
- package/dist/.sst/platform/src/components/cloudflare/ssr-site.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/static-site.d.ts +2 -2
- package/dist/.sst/platform/src/components/cloudflare/static-site.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/worker.d.ts +66 -10
- package/dist/.sst/platform/src/components/cloudflare/worker.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/component.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/duration.d.ts +4 -1
- package/dist/.sst/platform/src/components/duration.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/esbuild.d.ts +3 -0
- package/dist/.sst/platform/src/components/esbuild.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/link.d.ts +2 -2
- package/dist/.sst/platform/src/components/link.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/linkable.d.ts +32 -2
- package/dist/.sst/platform/src/components/linkable.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/rpc/rpc.d.ts +1 -0
- package/dist/.sst/platform/src/components/rpc/rpc.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/secret.d.ts +1 -1
- package/dist/.sst/platform/src/components/vercel/dns.d.ts +2 -2
- package/dist/.sst/platform/src/config.d.ts +15 -0
- package/dist/.sst/platform/src/config.d.ts.map +1 -1
- package/dist/.sst/platform/src/util/fs.d.ts +5 -0
- package/dist/.sst/platform/src/util/fs.d.ts.map +1 -0
- package/dist/.sst/platform/src/util/minify.d.ts +2 -0
- package/dist/.sst/platform/src/util/minify.d.ts.map +1 -0
- package/dist/components/dashboard.d.ts +2 -0
- package/dist/components/dashboard.d.ts.map +1 -0
- package/dist/components/monorise-core.d.ts.map +1 -1
- package/dist/components/q-function.d.ts +3 -4
- package/dist/components/q-function.d.ts.map +1 -1
- package/dist/components/single-table.d.ts +2 -1
- package/dist/components/single-table.d.ts.map +1 -1
- package/dist/index.js +605 -7
- package/dist/index.js.map +1 -1
- package/dist/tsup.config.d.ts +3 -0
- package/dist/tsup.config.d.ts.map +1 -0
- package/package.json +4 -4
- package/dist/.sst/platform/src/components/aws/analog.js +0 -118
- package/dist/.sst/platform/src/components/aws/analog.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigateway-websocket-route.js +0 -110
- package/dist/.sst/platform/src/components/aws/apigateway-websocket-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigateway-websocket.js +0 -409
- package/dist/.sst/platform/src/components/aws/apigateway-websocket.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv1-api-key.js +0 -55
- package/dist/.sst/platform/src/components/aws/apigatewayv1-api-key.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv1-authorizer.js +0 -110
- package/dist/.sst/platform/src/components/aws/apigatewayv1-authorizer.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv1-base-route.js +0 -34
- package/dist/.sst/platform/src/components/aws/apigatewayv1-base-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv1-integration-route.js +0 -49
- package/dist/.sst/platform/src/components/aws/apigatewayv1-integration-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv1-lambda-route.js +0 -85
- package/dist/.sst/platform/src/components/aws/apigatewayv1-lambda-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv1-usage-plan.js +0 -66
- package/dist/.sst/platform/src/components/aws/apigatewayv1-usage-plan.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv1.js +0 -749
- package/dist/.sst/platform/src/components/aws/apigatewayv1.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv2-authorizer.js +0 -98
- package/dist/.sst/platform/src/components/aws/apigatewayv2-authorizer.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv2-base-route.js +0 -28
- package/dist/.sst/platform/src/components/aws/apigatewayv2-base-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv2-lambda-route.js +0 -84
- package/dist/.sst/platform/src/components/aws/apigatewayv2-lambda-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv2-private-route.js +0 -55
- package/dist/.sst/platform/src/components/aws/apigatewayv2-private-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv2-url-route.js +0 -53
- package/dist/.sst/platform/src/components/aws/apigatewayv2-url-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv2.js +0 -648
- package/dist/.sst/platform/src/components/aws/apigatewayv2.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/app-sync-data-source.js +0 -208
- package/dist/.sst/platform/src/components/aws/app-sync-data-source.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/app-sync-function.js +0 -52
- package/dist/.sst/platform/src/components/aws/app-sync-function.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/app-sync-resolver.js +0 -70
- package/dist/.sst/platform/src/components/aws/app-sync-resolver.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/app-sync.js +0 -330
- package/dist/.sst/platform/src/components/aws/app-sync.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/astro.js +0 -156
- package/dist/.sst/platform/src/components/aws/astro.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/aurora.js +0 -678
- package/dist/.sst/platform/src/components/aws/aurora.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/auth-v1.js +0 -36
- package/dist/.sst/platform/src/components/aws/auth-v1.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/auth.js +0 -209
- package/dist/.sst/platform/src/components/aws/auth.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/bucket-lambda-subscriber.js +0 -99
- package/dist/.sst/platform/src/components/aws/bucket-lambda-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/bucket-notification.js +0 -170
- package/dist/.sst/platform/src/components/aws/bucket-notification.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/bucket-queue-subscriber.js +0 -77
- package/dist/.sst/platform/src/components/aws/bucket-queue-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/bucket-topic-subscriber.js +0 -99
- package/dist/.sst/platform/src/components/aws/bucket-topic-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/bucket.js +0 -754
- package/dist/.sst/platform/src/components/aws/bucket.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/bus-base-subscriber.js +0 -19
- package/dist/.sst/platform/src/components/aws/bus-base-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/bus-lambda-subscriber.js +0 -81
- package/dist/.sst/platform/src/components/aws/bus-lambda-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/bus-queue-subscriber.js +0 -63
- package/dist/.sst/platform/src/components/aws/bus-queue-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/bus.js +0 -350
- package/dist/.sst/platform/src/components/aws/bus.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/cdn.js +0 -234
- package/dist/.sst/platform/src/components/aws/cdn.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/cluster-v1.js +0 -245
- package/dist/.sst/platform/src/components/aws/cluster-v1.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/cluster.js +0 -321
- package/dist/.sst/platform/src/components/aws/cluster.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/cognito-identity-pool.js +0 -263
- package/dist/.sst/platform/src/components/aws/cognito-identity-pool.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/cognito-identity-provider.js +0 -67
- package/dist/.sst/platform/src/components/aws/cognito-identity-provider.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/cognito-user-pool-client.js +0 -81
- package/dist/.sst/platform/src/components/aws/cognito-user-pool-client.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/cognito-user-pool.js +0 -368
- package/dist/.sst/platform/src/components/aws/cognito-user-pool.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/cron.js +0 -200
- package/dist/.sst/platform/src/components/aws/cron.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/dns-validated-certificate.js +0 -55
- package/dist/.sst/platform/src/components/aws/dns-validated-certificate.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/dns.js +0 -121
- package/dist/.sst/platform/src/components/aws/dns.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/dynamo-lambda-subscriber.js +0 -79
- package/dist/.sst/platform/src/components/aws/dynamo-lambda-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/dynamo.js +0 -291
- package/dist/.sst/platform/src/components/aws/dynamo.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/efs.js +0 -241
- package/dist/.sst/platform/src/components/aws/efs.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/email.js +0 -276
- package/dist/.sst/platform/src/components/aws/email.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/fargate.js +0 -434
- package/dist/.sst/platform/src/components/aws/fargate.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/function.js +0 -1041
- package/dist/.sst/platform/src/components/aws/function.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/apigateway-account.js +0 -31
- package/dist/.sst/platform/src/components/aws/helpers/apigateway-account.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/apigatewayv2-domain.js +0 -2
- package/dist/.sst/platform/src/components/aws/helpers/apigatewayv2-domain.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/arn.js +0 -86
- package/dist/.sst/platform/src/components/aws/helpers/arn.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/bootstrap.js +0 -7
- package/dist/.sst/platform/src/components/aws/helpers/bootstrap.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/container-builder.js +0 -27
- package/dist/.sst/platform/src/components/aws/helpers/container-builder.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/function-builder.js +0 -51
- package/dist/.sst/platform/src/components/aws/helpers/function-builder.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/provider.js +0 -34
- package/dist/.sst/platform/src/components/aws/helpers/provider.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/quota.d.ts +0 -7
- package/dist/.sst/platform/src/components/aws/helpers/quota.d.ts.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/quota.js +0 -20
- package/dist/.sst/platform/src/components/aws/helpers/quota.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/site-builder.js +0 -36
- package/dist/.sst/platform/src/components/aws/helpers/site-builder.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/subscriber.js +0 -13
- package/dist/.sst/platform/src/components/aws/helpers/subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/https-redirect.js +0 -124
- package/dist/.sst/platform/src/components/aws/https-redirect.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/iam-edit.js +0 -40
- package/dist/.sst/platform/src/components/aws/iam-edit.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/index.js +0 -49
- package/dist/.sst/platform/src/components/aws/index.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/kinesis-stream-lambda-subscriber.js +0 -82
- package/dist/.sst/platform/src/components/aws/kinesis-stream-lambda-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/kinesis-stream.js +0 -134
- package/dist/.sst/platform/src/components/aws/kinesis-stream.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/linkable.js +0 -25
- package/dist/.sst/platform/src/components/aws/linkable.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/logging.js +0 -26
- package/dist/.sst/platform/src/components/aws/logging.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/mysql.js +0 -514
- package/dist/.sst/platform/src/components/aws/mysql.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/nextjs.js +0 -444
- package/dist/.sst/platform/src/components/aws/nextjs.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/nuxt.js +0 -113
- package/dist/.sst/platform/src/components/aws/nuxt.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/open-search.js +0 -365
- package/dist/.sst/platform/src/components/aws/open-search.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/opencontrol.js +0 -164
- package/dist/.sst/platform/src/components/aws/opencontrol.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/permission.js +0 -19
- package/dist/.sst/platform/src/components/aws/permission.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/postgres-v1.js +0 -304
- package/dist/.sst/platform/src/components/aws/postgres-v1.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/postgres.js +0 -532
- package/dist/.sst/platform/src/components/aws/postgres.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/bucket-files.js +0 -8
- package/dist/.sst/platform/src/components/aws/providers/bucket-files.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/distribution-deployment-waiter.js +0 -8
- package/dist/.sst/platform/src/components/aws/providers/distribution-deployment-waiter.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/distribution-invalidation.js +0 -8
- package/dist/.sst/platform/src/components/aws/providers/distribution-invalidation.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/function-environment-update.js +0 -18
- package/dist/.sst/platform/src/components/aws/providers/function-environment-update.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/hosted-zone-lookup.js +0 -8
- package/dist/.sst/platform/src/components/aws/providers/hosted-zone-lookup.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/kv-keys.js +0 -8
- package/dist/.sst/platform/src/components/aws/providers/kv-keys.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/kv-routes-update.js +0 -8
- package/dist/.sst/platform/src/components/aws/providers/kv-routes-update.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/origin-access-control.js +0 -8
- package/dist/.sst/platform/src/components/aws/providers/origin-access-control.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/rds-role-lookup.js +0 -8
- package/dist/.sst/platform/src/components/aws/providers/rds-role-lookup.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/vector-table.js +0 -8
- package/dist/.sst/platform/src/components/aws/providers/vector-table.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/queue-lambda-subscriber.js +0 -81
- package/dist/.sst/platform/src/components/aws/queue-lambda-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/queue.js +0 -322
- package/dist/.sst/platform/src/components/aws/queue.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/react.js +0 -157
- package/dist/.sst/platform/src/components/aws/react.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/realtime-lambda-subscriber.js +0 -78
- package/dist/.sst/platform/src/components/aws/realtime-lambda-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/realtime.js +0 -221
- package/dist/.sst/platform/src/components/aws/realtime.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/redis-v1.js +0 -335
- package/dist/.sst/platform/src/components/aws/redis-v1.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/redis.js +0 -382
- package/dist/.sst/platform/src/components/aws/redis.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/remix.js +0 -212
- package/dist/.sst/platform/src/components/aws/remix.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/router-base-route.js +0 -40
- package/dist/.sst/platform/src/components/aws/router-base-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/router-bucket-route.js +0 -40
- package/dist/.sst/platform/src/components/aws/router-bucket-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/router-url-route.js +0 -51
- package/dist/.sst/platform/src/components/aws/router-url-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/router.js +0 -1156
- package/dist/.sst/platform/src/components/aws/router.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/service-v1.js +0 -606
- package/dist/.sst/platform/src/components/aws/service-v1.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/service.js +0 -924
- package/dist/.sst/platform/src/components/aws/service.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/sns-topic-lambda-subscriber.js +0 -75
- package/dist/.sst/platform/src/components/aws/sns-topic-lambda-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/sns-topic-queue-subscriber.js +0 -59
- package/dist/.sst/platform/src/components/aws/sns-topic-queue-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/sns-topic.js +0 -233
- package/dist/.sst/platform/src/components/aws/sns-topic.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/solid-start.js +0 -120
- package/dist/.sst/platform/src/components/aws/solid-start.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/ssr-site.js +0 -792
- package/dist/.sst/platform/src/components/aws/ssr-site.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/static-site.js +0 -583
- package/dist/.sst/platform/src/components/aws/static-site.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions/choice.js +0 -98
- package/dist/.sst/platform/src/components/aws/step-functions/choice.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions/fail.js +0 -25
- package/dist/.sst/platform/src/components/aws/step-functions/fail.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions/map.js +0 -108
- package/dist/.sst/platform/src/components/aws/step-functions/map.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions/parallel.js +0 -129
- package/dist/.sst/platform/src/components/aws/step-functions/parallel.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions/pass.js +0 -41
- package/dist/.sst/platform/src/components/aws/step-functions/pass.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions/state.js +0 -134
- package/dist/.sst/platform/src/components/aws/step-functions/state.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions/succeed.js +0 -25
- package/dist/.sst/platform/src/components/aws/step-functions/succeed.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions/task.js +0 -116
- package/dist/.sst/platform/src/components/aws/step-functions/task.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions/wait.js +0 -46
- package/dist/.sst/platform/src/components/aws/step-functions/wait.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions.js +0 -576
- package/dist/.sst/platform/src/components/aws/step-functions.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/svelte-kit.js +0 -144
- package/dist/.sst/platform/src/components/aws/svelte-kit.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/tan-stack-start.js +0 -143
- package/dist/.sst/platform/src/components/aws/tan-stack-start.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/task.js +0 -311
- package/dist/.sst/platform/src/components/aws/task.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/vector.js +0 -224
- package/dist/.sst/platform/src/components/aws/vector.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/vpc-v1.js +0 -355
- package/dist/.sst/platform/src/components/aws/vpc-v1.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/vpc.js +0 -834
- package/dist/.sst/platform/src/components/aws/vpc.js.map +0 -1
- package/dist/.sst/platform/src/components/base/base-site.js +0 -47
- package/dist/.sst/platform/src/components/base/base-site.js.map +0 -1
- package/dist/.sst/platform/src/components/base/base-ssr-site.js +0 -72
- package/dist/.sst/platform/src/components/base/base-ssr-site.js.map +0 -1
- package/dist/.sst/platform/src/components/base/base-static-site.js +0 -87
- package/dist/.sst/platform/src/components/base/base-static-site.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/account-id.js +0 -2
- package/dist/.sst/platform/src/components/cloudflare/account-id.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/auth.js +0 -37
- package/dist/.sst/platform/src/components/cloudflare/auth.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/binding.js +0 -25
- package/dist/.sst/platform/src/components/cloudflare/binding.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/bucket.js +0 -98
- package/dist/.sst/platform/src/components/cloudflare/bucket.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/cron.js +0 -86
- package/dist/.sst/platform/src/components/cloudflare/cron.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/d1.js +0 -104
- package/dist/.sst/platform/src/components/cloudflare/d1.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/dns.js +0 -138
- package/dist/.sst/platform/src/components/cloudflare/dns.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/helpers/fetch.js +0 -39
- package/dist/.sst/platform/src/components/cloudflare/helpers/fetch.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/helpers/worker-builder.js +0 -25
- package/dist/.sst/platform/src/components/cloudflare/helpers/worker-builder.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/index.js +0 -13
- package/dist/.sst/platform/src/components/cloudflare/index.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/kv.js +0 -98
- package/dist/.sst/platform/src/components/cloudflare/kv.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/providers/dns-record.js +0 -11
- package/dist/.sst/platform/src/components/cloudflare/providers/dns-record.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/providers/kv-data.js +0 -63
- package/dist/.sst/platform/src/components/cloudflare/providers/kv-data.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/providers/worker-url.js +0 -83
- package/dist/.sst/platform/src/components/cloudflare/providers/worker-url.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/providers/zone-lookup.js +0 -54
- package/dist/.sst/platform/src/components/cloudflare/providers/zone-lookup.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/queue.js +0 -57
- package/dist/.sst/platform/src/components/cloudflare/queue.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/remix.d.ts +0 -223
- package/dist/.sst/platform/src/components/cloudflare/remix.d.ts.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/remix.js +0 -291
- package/dist/.sst/platform/src/components/cloudflare/remix.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/ssr-site.js +0 -177
- package/dist/.sst/platform/src/components/cloudflare/ssr-site.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/static-site.js +0 -315
- package/dist/.sst/platform/src/components/cloudflare/static-site.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/worker.js +0 -326
- package/dist/.sst/platform/src/components/cloudflare/worker.js.map +0 -1
- package/dist/.sst/platform/src/components/component.js +0 -395
- package/dist/.sst/platform/src/components/component.js.map +0 -1
- package/dist/.sst/platform/src/components/cpu.js +0 -9
- package/dist/.sst/platform/src/components/cpu.js.map +0 -1
- package/dist/.sst/platform/src/components/dns.js +0 -7
- package/dist/.sst/platform/src/components/dns.js.map +0 -1
- package/dist/.sst/platform/src/components/duration.js +0 -19
- package/dist/.sst/platform/src/components/duration.js.map +0 -1
- package/dist/.sst/platform/src/components/error.js +0 -6
- package/dist/.sst/platform/src/components/error.js.map +0 -1
- package/dist/.sst/platform/src/components/experimental/dev-command.js +0 -59
- package/dist/.sst/platform/src/components/experimental/dev-command.js.map +0 -1
- package/dist/.sst/platform/src/components/experimental/index.js +0 -2
- package/dist/.sst/platform/src/components/experimental/index.js.map +0 -1
- package/dist/.sst/platform/src/components/hint.d.ts +0 -7
- package/dist/.sst/platform/src/components/hint.d.ts.map +0 -1
- package/dist/.sst/platform/src/components/hint.js +0 -20
- package/dist/.sst/platform/src/components/hint.js.map +0 -1
- package/dist/.sst/platform/src/components/index.js +0 -16
- package/dist/.sst/platform/src/components/index.js.map +0 -1
- package/dist/.sst/platform/src/components/input.js +0 -2
- package/dist/.sst/platform/src/components/input.js.map +0 -1
- package/dist/.sst/platform/src/components/link.js +0 -138
- package/dist/.sst/platform/src/components/link.js.map +0 -1
- package/dist/.sst/platform/src/components/linkable.js +0 -244
- package/dist/.sst/platform/src/components/linkable.js.map +0 -1
- package/dist/.sst/platform/src/components/naming.js +0 -58
- package/dist/.sst/platform/src/components/naming.js.map +0 -1
- package/dist/.sst/platform/src/components/path.js +0 -5
- package/dist/.sst/platform/src/components/path.js.map +0 -1
- package/dist/.sst/platform/src/components/rpc/rpc.js +0 -120
- package/dist/.sst/platform/src/components/rpc/rpc.js.map +0 -1
- package/dist/.sst/platform/src/components/secret.js +0 -143
- package/dist/.sst/platform/src/components/secret.js.map +0 -1
- package/dist/.sst/platform/src/components/size.js +0 -29
- package/dist/.sst/platform/src/components/size.js.map +0 -1
- package/dist/.sst/platform/src/components/vercel/account-id.js +0 -2
- package/dist/.sst/platform/src/components/vercel/account-id.js.map +0 -1
- package/dist/.sst/platform/src/components/vercel/dns.js +0 -104
- package/dist/.sst/platform/src/components/vercel/dns.js.map +0 -1
- package/dist/.sst/platform/src/components/vercel/index.js +0 -3
- package/dist/.sst/platform/src/components/vercel/index.js.map +0 -1
- package/dist/.sst/platform/src/components/vercel/providers/dns-record.js +0 -8
- package/dist/.sst/platform/src/components/vercel/providers/dns-record.js.map +0 -1
- package/dist/.sst/platform/src/config.js +0 -5
- package/dist/.sst/platform/src/config.js.map +0 -1
- package/dist/.sst/platform/src/util/compare-semver.js +0 -24
- package/dist/.sst/platform/src/util/compare-semver.js.map +0 -1
- package/dist/.sst/platform/src/util/lazy.js +0 -12
- package/dist/.sst/platform/src/util/lazy.js.map +0 -1
- package/dist/.sst/platform/src/util/path-to-regex.d.ts +0 -128
- package/dist/.sst/platform/src/util/path-to-regex.d.ts.map +0 -1
- package/dist/.sst/platform/src/util/path-to-regex.js +0 -392
- package/dist/.sst/platform/src/util/path-to-regex.js.map +0 -1
- package/dist/.sst/platform/src/util/semaphore.js +0 -36
- package/dist/.sst/platform/src/util/semaphore.js.map +0 -1
- package/dist/.sst/platform/src/util/warn.js +0 -8
- package/dist/.sst/platform/src/util/warn.js.map +0 -1
- package/dist/components/monorise-core.js +0 -147
- package/dist/components/monorise-core.js.map +0 -1
- package/dist/components/q-function.js +0 -53
- package/dist/components/q-function.js.map +0 -1
- package/dist/components/single-table.js +0 -73
- package/dist/components/single-table.js.map +0 -1
- package/dist/constants/event.js +0 -74
- package/dist/constants/event.js.map +0 -1
- package/dist/constants/table.js +0 -3
- package/dist/constants/table.js.map +0 -1
- package/dist/sst.config.js +0 -24
- package/dist/sst.config.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1,1041 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import fs from "fs";
|
|
11
|
-
import path from "path";
|
|
12
|
-
import crypto from "crypto";
|
|
13
|
-
import archiver from "archiver";
|
|
14
|
-
import { glob } from "glob";
|
|
15
|
-
import { all, asset, interpolate, output, secret, unsecret, } from "@pulumi/pulumi";
|
|
16
|
-
import { bootstrap } from "./helpers/bootstrap.js";
|
|
17
|
-
import { toSeconds } from "../duration.js";
|
|
18
|
-
import { toMBs } from "../size.js";
|
|
19
|
-
import { Component, transform } from "../component.js";
|
|
20
|
-
import { Link } from "../link.js";
|
|
21
|
-
import { VisibleError } from "../error.js";
|
|
22
|
-
import { physicalName } from "../naming.js";
|
|
23
|
-
import { RETENTION } from "./logging.js";
|
|
24
|
-
import { cloudwatch, ecr, getCallerIdentityOutput, getPartitionOutput, getRegionOutput, iam, lambda, s3, } from "@pulumi/aws";
|
|
25
|
-
import { permission } from "./permission.js";
|
|
26
|
-
import { Vpc } from "./vpc.js";
|
|
27
|
-
import { Image } from "@pulumi/docker-build";
|
|
28
|
-
import { rpc } from "../rpc/rpc.js";
|
|
29
|
-
import { parseRoleArn } from "./helpers/arn.js";
|
|
30
|
-
import { RandomBytes } from "@pulumi/random";
|
|
31
|
-
import { lazy } from "../../util/lazy.js";
|
|
32
|
-
import { Efs } from "./efs.js";
|
|
33
|
-
import { FunctionEnvironmentUpdate } from "./providers/function-environment-update.js";
|
|
34
|
-
import { warnOnce } from "../../util/warn.js";
|
|
35
|
-
import { normalizeRouteArgs, } from "./router.js";
|
|
36
|
-
import { KvRoutesUpdate } from "./providers/kv-routes-update.js";
|
|
37
|
-
import { KvKeys } from "./providers/kv-keys.js";
|
|
38
|
-
/**
|
|
39
|
-
* The `Function` component lets you add serverless functions to your app.
|
|
40
|
-
* It uses [AWS Lambda](https://aws.amazon.com/lambda/).
|
|
41
|
-
*
|
|
42
|
-
* #### Supported runtimes
|
|
43
|
-
*
|
|
44
|
-
* Currently supports **Node.js** and **Golang** functions. **Python** and **Rust**
|
|
45
|
-
* are community supported. Other runtimes are on the roadmap.
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
*
|
|
49
|
-
* #### Minimal example
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* <Tabs>
|
|
53
|
-
* <TabItem label="Node">
|
|
54
|
-
* Pass in the path to your handler function.
|
|
55
|
-
*
|
|
56
|
-
* ```ts title="sst.config.ts"
|
|
57
|
-
* new sst.aws.Function("MyFunction", {
|
|
58
|
-
* handler: "src/lambda.handler"
|
|
59
|
-
* });
|
|
60
|
-
* ```
|
|
61
|
-
*
|
|
62
|
-
* [Learn more below](#handler).
|
|
63
|
-
* </TabItem>
|
|
64
|
-
* <TabItem label="Python">
|
|
65
|
-
* Pass in the path to your handler function.
|
|
66
|
-
*
|
|
67
|
-
* ```ts title="sst.config.ts"
|
|
68
|
-
* new sst.aws.Function("MyFunction", {
|
|
69
|
-
* runtime: "python3.11",
|
|
70
|
-
* handler: "functions/src/functions/api.handler"
|
|
71
|
-
* });
|
|
72
|
-
* ```
|
|
73
|
-
*
|
|
74
|
-
* You need to have uv installed and your handler function needs to be in a uv workspace. [Learn more below](#handler).
|
|
75
|
-
* </TabItem>
|
|
76
|
-
* <TabItem label="Go">
|
|
77
|
-
* Pass in the directory to your Go module.
|
|
78
|
-
*
|
|
79
|
-
* ```ts title="sst.config.ts"
|
|
80
|
-
* new sst.aws.Function("MyFunction", {
|
|
81
|
-
* runtime: "go",
|
|
82
|
-
* handler: "./src"
|
|
83
|
-
* });
|
|
84
|
-
* ```
|
|
85
|
-
*
|
|
86
|
-
* [Learn more below](#handler).
|
|
87
|
-
* </TabItem>
|
|
88
|
-
* <TabItem label="Rust">
|
|
89
|
-
* Pass in the directory where your Cargo.toml lives.
|
|
90
|
-
*
|
|
91
|
-
* ```ts title="sst.config.ts"
|
|
92
|
-
* new sst.aws.Function("MyFunction", {
|
|
93
|
-
* runtime: "rust",
|
|
94
|
-
* handler: "./crates/api/"
|
|
95
|
-
* });
|
|
96
|
-
* ```
|
|
97
|
-
*
|
|
98
|
-
* [Learn more below](#handler).
|
|
99
|
-
* </TabItem>
|
|
100
|
-
* </Tabs>
|
|
101
|
-
*
|
|
102
|
-
* #### Set additional config
|
|
103
|
-
*
|
|
104
|
-
* Pass in additional Lambda config.
|
|
105
|
-
*
|
|
106
|
-
* ```ts {3,4} title="sst.config.ts"
|
|
107
|
-
* new sst.aws.Function("MyFunction", {
|
|
108
|
-
* handler: "src/lambda.handler",
|
|
109
|
-
* timeout: "3 minutes",
|
|
110
|
-
* memory: "1024 MB"
|
|
111
|
-
* });
|
|
112
|
-
* ```
|
|
113
|
-
*
|
|
114
|
-
* #### Link resources
|
|
115
|
-
*
|
|
116
|
-
* [Link resources](/docs/linking/) to the function. This will grant permissions
|
|
117
|
-
* to the resources and allow you to access it in your handler.
|
|
118
|
-
*
|
|
119
|
-
* ```ts {5} title="sst.config.ts"
|
|
120
|
-
* const bucket = new sst.aws.Bucket("MyBucket");
|
|
121
|
-
*
|
|
122
|
-
* new sst.aws.Function("MyFunction", {
|
|
123
|
-
* handler: "src/lambda.handler",
|
|
124
|
-
* link: [bucket]
|
|
125
|
-
* });
|
|
126
|
-
* ```
|
|
127
|
-
*
|
|
128
|
-
* You can use the [SDK](/docs/reference/sdk/) to access the linked resources
|
|
129
|
-
* in your handler.
|
|
130
|
-
*
|
|
131
|
-
* <Tabs>
|
|
132
|
-
* <TabItem label="Node">
|
|
133
|
-
* ```ts title="src/lambda.ts"
|
|
134
|
-
* import { Resource } from "sst";
|
|
135
|
-
*
|
|
136
|
-
* console.log(Resource.MyBucket.name);
|
|
137
|
-
* ```
|
|
138
|
-
* </TabItem>
|
|
139
|
-
* <TabItem label="Python">
|
|
140
|
-
* ```ts title="functions/src/functions/api.py"
|
|
141
|
-
* from sst import Resource
|
|
142
|
-
*
|
|
143
|
-
* def handler(event, context):
|
|
144
|
-
* print(Resource.MyBucket.name)
|
|
145
|
-
* ```
|
|
146
|
-
*
|
|
147
|
-
* Where the `sst` package can be added to your `pyproject.toml`.
|
|
148
|
-
*
|
|
149
|
-
* ```toml title="functions/pyproject.toml"
|
|
150
|
-
* [tool.uv.sources]
|
|
151
|
-
* sst = { git = "https://github.com/sst/sst.git", subdirectory = "sdk/python", branch = "dev" }
|
|
152
|
-
* ```
|
|
153
|
-
* </TabItem>
|
|
154
|
-
* <TabItem label="Go">
|
|
155
|
-
* ```go title="src/main.go"
|
|
156
|
-
* import (
|
|
157
|
-
* "github.com/sst/sst/v3/sdk/golang/resource"
|
|
158
|
-
* )
|
|
159
|
-
*
|
|
160
|
-
* resource.Get("MyBucket", "name")
|
|
161
|
-
* ```
|
|
162
|
-
* </TabItem>
|
|
163
|
-
* <TabItem label="Rust">
|
|
164
|
-
* ```rust title="src/main.rs"
|
|
165
|
-
* use sst_sdk::Resource;
|
|
166
|
-
* #[derive(serde::Deserialize, Debug)]
|
|
167
|
-
* struct Bucket {
|
|
168
|
-
* name: String,
|
|
169
|
-
* }
|
|
170
|
-
*
|
|
171
|
-
* let resource = Resource::init().unwrap();
|
|
172
|
-
* let Bucket { name } = resource.get("Bucket").unwrap();
|
|
173
|
-
* ```
|
|
174
|
-
* </TabItem>
|
|
175
|
-
* </Tabs>
|
|
176
|
-
*
|
|
177
|
-
* #### Set environment variables
|
|
178
|
-
*
|
|
179
|
-
* Set environment variables that you can read in your function. For example, using
|
|
180
|
-
* `process.env` in your Node.js functions.
|
|
181
|
-
*
|
|
182
|
-
* ```ts {4} title="sst.config.ts"
|
|
183
|
-
* new sst.aws.Function("MyFunction", {
|
|
184
|
-
* handler: "src/lambda.handler",
|
|
185
|
-
* environment: {
|
|
186
|
-
* DEBUG: "true"
|
|
187
|
-
* }
|
|
188
|
-
* });
|
|
189
|
-
* ```
|
|
190
|
-
*
|
|
191
|
-
* #### Enable function URLs
|
|
192
|
-
*
|
|
193
|
-
* Enable function URLs to invoke the function over HTTP.
|
|
194
|
-
*
|
|
195
|
-
* ```ts {3} title="sst.config.ts"
|
|
196
|
-
* new sst.aws.Function("MyFunction", {
|
|
197
|
-
* handler: "src/lambda.handler",
|
|
198
|
-
* url: true
|
|
199
|
-
* });
|
|
200
|
-
* ```
|
|
201
|
-
*
|
|
202
|
-
* #### Bundling
|
|
203
|
-
*
|
|
204
|
-
* Customize how SST uses [esbuild](https://esbuild.github.io/) to bundle your Node.js
|
|
205
|
-
* functions with the `nodejs` property.
|
|
206
|
-
*
|
|
207
|
-
* ```ts title="sst.config.ts" {3-5}
|
|
208
|
-
* new sst.aws.Function("MyFunction", {
|
|
209
|
-
* handler: "src/lambda.handler",
|
|
210
|
-
* nodejs: {
|
|
211
|
-
* install: ["pg"]
|
|
212
|
-
* }
|
|
213
|
-
* });
|
|
214
|
-
* ```
|
|
215
|
-
*
|
|
216
|
-
* Or override it entirely by passing in your own function `bundle`.
|
|
217
|
-
*/
|
|
218
|
-
export class Function extends Component {
|
|
219
|
-
constructor(name, args, opts) {
|
|
220
|
-
var _a, _b;
|
|
221
|
-
super(__pulumiType, name, args, opts);
|
|
222
|
-
this.constructorName = name;
|
|
223
|
-
const parent = this;
|
|
224
|
-
const dev = normalizeDev();
|
|
225
|
-
const isContainer = all([args.python, dev]).apply(([python, dev]) => { var _a; return !dev && ((_a = python === null || python === void 0 ? void 0 : python.container) !== null && _a !== void 0 ? _a : false); });
|
|
226
|
-
const partition = getPartitionOutput({}, opts).partition;
|
|
227
|
-
const region = getRegionOutput({}, opts).name;
|
|
228
|
-
const bootstrapData = region.apply((region) => bootstrap.forRegion(region));
|
|
229
|
-
const injections = normalizeInjections();
|
|
230
|
-
const runtime = output((_a = args.runtime) !== null && _a !== void 0 ? _a : "nodejs20.x");
|
|
231
|
-
const timeout = normalizeTimeout();
|
|
232
|
-
const memory = normalizeMemory();
|
|
233
|
-
const storage = output(args.storage).apply((v) => v !== null && v !== void 0 ? v : "512 MB");
|
|
234
|
-
const architecture = output(args.architecture).apply((v) => v !== null && v !== void 0 ? v : "x86_64");
|
|
235
|
-
const environment = normalizeEnvironment();
|
|
236
|
-
const streaming = normalizeStreaming();
|
|
237
|
-
const logging = normalizeLogging();
|
|
238
|
-
const volume = normalizeVolume();
|
|
239
|
-
const url = normalizeUrl();
|
|
240
|
-
const copyFiles = normalizeCopyFiles();
|
|
241
|
-
const policies = output((_b = args.policies) !== null && _b !== void 0 ? _b : []);
|
|
242
|
-
const vpc = normalizeVpc();
|
|
243
|
-
const linkData = buildLinkData();
|
|
244
|
-
const linkPermissions = buildLinkPermissions();
|
|
245
|
-
const { bundle, handler: handler0, sourcemaps } = buildHandler();
|
|
246
|
-
const { handler, wrapper } = buildHandlerWrapper();
|
|
247
|
-
const role = createRole();
|
|
248
|
-
const imageAsset = createImageAsset();
|
|
249
|
-
const logGroup = createLogGroup();
|
|
250
|
-
const zipAsset = createZipAsset();
|
|
251
|
-
const fn = createFunction();
|
|
252
|
-
const urlEndpoint = createUrl();
|
|
253
|
-
createProvisioned();
|
|
254
|
-
const eventInvokeConfig = createEventInvokeConfig();
|
|
255
|
-
const links = linkData.apply((input) => input.map((item) => item.name));
|
|
256
|
-
this.function = fn;
|
|
257
|
-
this.role = role;
|
|
258
|
-
this.logGroup = logGroup;
|
|
259
|
-
this.urlEndpoint = urlEndpoint;
|
|
260
|
-
this.eventInvokeConfig = eventInvokeConfig;
|
|
261
|
-
const buildInput = output({
|
|
262
|
-
functionID: name,
|
|
263
|
-
handler: args.handler,
|
|
264
|
-
bundle: args.bundle,
|
|
265
|
-
logGroup: logGroup.apply((l) => l === null || l === void 0 ? void 0 : l.name),
|
|
266
|
-
encryptionKey: Function.encryptionKey().base64,
|
|
267
|
-
runtime,
|
|
268
|
-
links: output(linkData).apply((input) => Object.fromEntries(input.map((item) => [item.name, item.properties]))),
|
|
269
|
-
copyFiles,
|
|
270
|
-
properties: output({ nodejs: args.nodejs, python: args.python }).apply((val) => (Object.assign(Object.assign({}, (val.nodejs || val.python)), { architecture }))),
|
|
271
|
-
dev,
|
|
272
|
-
});
|
|
273
|
-
buildInput.apply((input) => __awaiter(this, void 0, void 0, function* () {
|
|
274
|
-
if (!input.dev)
|
|
275
|
-
return;
|
|
276
|
-
yield rpc.call("Runtime.AddTarget", input);
|
|
277
|
-
}));
|
|
278
|
-
this.registerOutputs({
|
|
279
|
-
_live: unsecret(output(dev).apply((dev) => {
|
|
280
|
-
if (!dev)
|
|
281
|
-
return undefined;
|
|
282
|
-
return all([
|
|
283
|
-
name,
|
|
284
|
-
links,
|
|
285
|
-
args.handler,
|
|
286
|
-
args.bundle,
|
|
287
|
-
args.runtime,
|
|
288
|
-
args.nodejs,
|
|
289
|
-
copyFiles,
|
|
290
|
-
]).apply(([name, links, handler, bundle, runtime, nodejs, copyFiles]) => {
|
|
291
|
-
return {
|
|
292
|
-
functionID: name,
|
|
293
|
-
links,
|
|
294
|
-
handler: handler,
|
|
295
|
-
bundle: bundle,
|
|
296
|
-
runtime: runtime || "nodejs20.x",
|
|
297
|
-
copyFiles,
|
|
298
|
-
properties: nodejs,
|
|
299
|
-
};
|
|
300
|
-
});
|
|
301
|
-
})),
|
|
302
|
-
_metadata: {
|
|
303
|
-
handler: args.handler,
|
|
304
|
-
internal: args._skipMetadata,
|
|
305
|
-
dev: dev,
|
|
306
|
-
},
|
|
307
|
-
_hint: args._skipHint ? undefined : urlEndpoint,
|
|
308
|
-
});
|
|
309
|
-
function normalizeDev() {
|
|
310
|
-
return all([args.dev, args.live]).apply(([d, l]) => $dev && d !== false && l !== false);
|
|
311
|
-
}
|
|
312
|
-
function normalizeInjections() {
|
|
313
|
-
return output(args.injections).apply((injections) => injections !== null && injections !== void 0 ? injections : []);
|
|
314
|
-
}
|
|
315
|
-
function normalizeTimeout() {
|
|
316
|
-
return output(args.timeout).apply((timeout) => timeout !== null && timeout !== void 0 ? timeout : "20 seconds");
|
|
317
|
-
}
|
|
318
|
-
function normalizeMemory() {
|
|
319
|
-
return output(args.memory).apply((memory) => memory !== null && memory !== void 0 ? memory : "1024 MB");
|
|
320
|
-
}
|
|
321
|
-
function normalizeEnvironment() {
|
|
322
|
-
return all([
|
|
323
|
-
args.environment,
|
|
324
|
-
dev,
|
|
325
|
-
bootstrapData,
|
|
326
|
-
Function.encryptionKey().base64,
|
|
327
|
-
args.link,
|
|
328
|
-
]).apply((_a) => __awaiter(this, [_a], void 0, function* ([environment, dev, bootstrap, key, link]) {
|
|
329
|
-
const result = environment !== null && environment !== void 0 ? environment : {};
|
|
330
|
-
result.SST_RESOURCE_App = JSON.stringify({
|
|
331
|
-
name: $app.name,
|
|
332
|
-
stage: $app.stage,
|
|
333
|
-
});
|
|
334
|
-
for (const linkable of link || []) {
|
|
335
|
-
if (!Link.isLinkable(linkable))
|
|
336
|
-
continue;
|
|
337
|
-
const def = linkable.getSSTLink();
|
|
338
|
-
for (const item of def.include || []) {
|
|
339
|
-
if (item.type === "environment")
|
|
340
|
-
Object.assign(result, item.env);
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
result.SST_KEY = key;
|
|
344
|
-
result.SST_KEY_FILE = "resource.enc";
|
|
345
|
-
if (dev) {
|
|
346
|
-
const appsync = yield Function.appsync();
|
|
347
|
-
result.SST_REGION = process.env.SST_AWS_REGION;
|
|
348
|
-
result.SST_APPSYNC_HTTP = appsync.http;
|
|
349
|
-
result.SST_APPSYNC_REALTIME = appsync.realtime;
|
|
350
|
-
result.SST_FUNCTION_ID = name;
|
|
351
|
-
result.SST_APP = $app.name;
|
|
352
|
-
result.SST_STAGE = $app.stage;
|
|
353
|
-
result.SST_ASSET_BUCKET = bootstrap.asset;
|
|
354
|
-
if (process.env.SST_FUNCTION_TIMEOUT) {
|
|
355
|
-
result.SST_FUNCTION_TIMEOUT = process.env.SST_FUNCTION_TIMEOUT;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
return result;
|
|
359
|
-
}));
|
|
360
|
-
}
|
|
361
|
-
function normalizeStreaming() {
|
|
362
|
-
return output(args.streaming).apply((streaming) => streaming !== null && streaming !== void 0 ? streaming : false);
|
|
363
|
-
}
|
|
364
|
-
function normalizeLogging() {
|
|
365
|
-
return output(args.logging).apply((logging) => {
|
|
366
|
-
var _a, _b;
|
|
367
|
-
if (logging === false)
|
|
368
|
-
return undefined;
|
|
369
|
-
if ((logging === null || logging === void 0 ? void 0 : logging.retention) && (logging === null || logging === void 0 ? void 0 : logging.logGroup)) {
|
|
370
|
-
throw new VisibleError(`Cannot set both "logging.retention" and "logging.logGroup"`);
|
|
371
|
-
}
|
|
372
|
-
return {
|
|
373
|
-
logGroup: logging === null || logging === void 0 ? void 0 : logging.logGroup,
|
|
374
|
-
retention: (_a = logging === null || logging === void 0 ? void 0 : logging.retention) !== null && _a !== void 0 ? _a : "1 month",
|
|
375
|
-
format: (_b = logging === null || logging === void 0 ? void 0 : logging.format) !== null && _b !== void 0 ? _b : "text",
|
|
376
|
-
};
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
function normalizeVolume() {
|
|
380
|
-
if (!args.volume)
|
|
381
|
-
return;
|
|
382
|
-
return output(args.volume).apply((volume) => {
|
|
383
|
-
var _a;
|
|
384
|
-
return ({
|
|
385
|
-
efs: volume.efs instanceof Efs
|
|
386
|
-
? volume.efs.nodes.accessPoint.arn
|
|
387
|
-
: output(volume.efs),
|
|
388
|
-
path: (_a = volume.path) !== null && _a !== void 0 ? _a : "/mnt/efs",
|
|
389
|
-
});
|
|
390
|
-
});
|
|
391
|
-
}
|
|
392
|
-
function normalizeUrl() {
|
|
393
|
-
return output(args.url).apply((url) => {
|
|
394
|
-
var _a;
|
|
395
|
-
if (url === false || url === undefined)
|
|
396
|
-
return;
|
|
397
|
-
if (url === true) {
|
|
398
|
-
url = {};
|
|
399
|
-
}
|
|
400
|
-
// normalize authorization
|
|
401
|
-
const defaultAuthorization = "none";
|
|
402
|
-
const authorization = (_a = url.authorization) !== null && _a !== void 0 ? _a : defaultAuthorization;
|
|
403
|
-
// normalize cors
|
|
404
|
-
const defaultCors = {
|
|
405
|
-
allowHeaders: ["*"],
|
|
406
|
-
allowMethods: ["*"],
|
|
407
|
-
allowOrigins: ["*"],
|
|
408
|
-
};
|
|
409
|
-
const cors = url.cors === false
|
|
410
|
-
? undefined
|
|
411
|
-
: url.cors === true || url.cors === undefined
|
|
412
|
-
? defaultCors
|
|
413
|
-
: Object.assign(Object.assign(Object.assign({}, defaultCors), url.cors), { maxAge: url.cors.maxAge && toSeconds(url.cors.maxAge) });
|
|
414
|
-
return {
|
|
415
|
-
authorization,
|
|
416
|
-
cors,
|
|
417
|
-
route: normalizeRouteArgs(url.router, url.route),
|
|
418
|
-
};
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
function normalizeCopyFiles() {
|
|
422
|
-
var _a;
|
|
423
|
-
return output((_a = args.copyFiles) !== null && _a !== void 0 ? _a : []).apply((copyFiles) => Promise.all(copyFiles.map((entry) => __awaiter(this, void 0, void 0, function* () {
|
|
424
|
-
const from = path.join($cli.paths.root, entry.from);
|
|
425
|
-
const to = entry.to || entry.from;
|
|
426
|
-
if (path.isAbsolute(to)) {
|
|
427
|
-
throw new VisibleError(`Copy destination path "${to}" must be relative`);
|
|
428
|
-
}
|
|
429
|
-
const stats = yield fs.promises.stat(from);
|
|
430
|
-
const isDir = stats.isDirectory();
|
|
431
|
-
return { from, to, isDir };
|
|
432
|
-
}))));
|
|
433
|
-
}
|
|
434
|
-
function normalizeVpc() {
|
|
435
|
-
// "vpc" is undefined
|
|
436
|
-
if (!args.vpc)
|
|
437
|
-
return;
|
|
438
|
-
// "vpc" is a Vpc component
|
|
439
|
-
if (args.vpc instanceof Vpc) {
|
|
440
|
-
const result = {
|
|
441
|
-
privateSubnets: args.vpc.privateSubnets,
|
|
442
|
-
securityGroups: args.vpc.securityGroups,
|
|
443
|
-
};
|
|
444
|
-
return all([
|
|
445
|
-
args.vpc.id,
|
|
446
|
-
args.vpc.nodes.natGateways,
|
|
447
|
-
args.vpc.nodes.natInstances,
|
|
448
|
-
]).apply(([id, natGateways, natInstances]) => {
|
|
449
|
-
if (natGateways.length === 0 && natInstances.length === 0) {
|
|
450
|
-
warnOnce(`\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`);
|
|
451
|
-
}
|
|
452
|
-
return result;
|
|
453
|
-
});
|
|
454
|
-
}
|
|
455
|
-
return output(args.vpc).apply((vpc) => {
|
|
456
|
-
// "vpc" is object
|
|
457
|
-
if (vpc.subnets) {
|
|
458
|
-
throw new VisibleError(`The "vpc.subnets" property has been renamed to "vpc.privateSubnets". Update your code to use "vpc.privateSubnets" instead.`);
|
|
459
|
-
}
|
|
460
|
-
return vpc;
|
|
461
|
-
});
|
|
462
|
-
}
|
|
463
|
-
function buildLinkData() {
|
|
464
|
-
return output(args.link || []).apply((links) => Link.build(links));
|
|
465
|
-
}
|
|
466
|
-
function buildLinkPermissions() {
|
|
467
|
-
return Link.getInclude("aws.permission", args.link);
|
|
468
|
-
}
|
|
469
|
-
function buildHandler() {
|
|
470
|
-
return all([runtime, dev, isContainer]).apply((_a) => __awaiter(this, [_a], void 0, function* ([runtime, dev, isContainer]) {
|
|
471
|
-
if (dev) {
|
|
472
|
-
return {
|
|
473
|
-
handler: "bootstrap",
|
|
474
|
-
bundle: path.join($cli.paths.platform, "dist", "bridge"),
|
|
475
|
-
};
|
|
476
|
-
}
|
|
477
|
-
const buildResult = buildInput.apply((input) => __awaiter(this, void 0, void 0, function* () {
|
|
478
|
-
var _a;
|
|
479
|
-
const result = yield rpc.call("Runtime.Build", Object.assign(Object.assign({}, input), { isContainer }));
|
|
480
|
-
if (result.errors.length > 0) {
|
|
481
|
-
throw new Error(result.errors.join("\n"));
|
|
482
|
-
}
|
|
483
|
-
if ((_a = args.hook) === null || _a === void 0 ? void 0 : _a.postbuild)
|
|
484
|
-
yield args.hook.postbuild(result.out);
|
|
485
|
-
return result;
|
|
486
|
-
}));
|
|
487
|
-
return {
|
|
488
|
-
handler: buildResult.handler,
|
|
489
|
-
bundle: buildResult.out,
|
|
490
|
-
sourcemaps: buildResult.sourcemaps,
|
|
491
|
-
};
|
|
492
|
-
}));
|
|
493
|
-
}
|
|
494
|
-
function buildHandlerWrapper() {
|
|
495
|
-
const ret = all([
|
|
496
|
-
dev,
|
|
497
|
-
bundle,
|
|
498
|
-
handler0,
|
|
499
|
-
linkData,
|
|
500
|
-
streaming,
|
|
501
|
-
injections,
|
|
502
|
-
runtime,
|
|
503
|
-
]).apply((_a) => __awaiter(this, [_a], void 0, function* ([dev, bundle, handler, linkData, streaming, injections, runtime,]) {
|
|
504
|
-
if (dev)
|
|
505
|
-
return { handler };
|
|
506
|
-
if (!runtime.startsWith("nodejs")) {
|
|
507
|
-
return { handler };
|
|
508
|
-
}
|
|
509
|
-
const hasUserInjections = injections.length > 0;
|
|
510
|
-
if (!hasUserInjections)
|
|
511
|
-
return { handler };
|
|
512
|
-
const parsed = path.posix.parse(handler);
|
|
513
|
-
const handlerDir = parsed.dir;
|
|
514
|
-
const oldHandlerFileName = parsed.name;
|
|
515
|
-
const oldHandlerFunction = parsed.ext.replace(/^\./, "");
|
|
516
|
-
const newHandlerFileName = "server-index";
|
|
517
|
-
const newHandlerFunction = "handler";
|
|
518
|
-
// Validate handler file exists
|
|
519
|
-
const newHandlerFileExt = [".js", ".mjs", ".cjs"].find((ext) => fs.existsSync(path.join(bundle, handlerDir, oldHandlerFileName + ext)));
|
|
520
|
-
if (!newHandlerFileExt) {
|
|
521
|
-
throw new VisibleError(`Could not find handler file "${handler}" for function "${name}"`);
|
|
522
|
-
}
|
|
523
|
-
const split = injections.reduce((acc, item) => {
|
|
524
|
-
if (item.startsWith("outer:")) {
|
|
525
|
-
acc.outer.push(item.substring("outer:".length));
|
|
526
|
-
return acc;
|
|
527
|
-
}
|
|
528
|
-
acc.inner.push(item);
|
|
529
|
-
return acc;
|
|
530
|
-
}, { outer: [], inner: [] });
|
|
531
|
-
return {
|
|
532
|
-
handler: path.posix.join(handlerDir, `${newHandlerFileName}.${newHandlerFunction}`),
|
|
533
|
-
wrapper: {
|
|
534
|
-
name: path.posix.join(handlerDir, `${newHandlerFileName}.mjs`),
|
|
535
|
-
content: streaming
|
|
536
|
-
? [
|
|
537
|
-
...split.outer,
|
|
538
|
-
`export const ${newHandlerFunction} = awslambda.streamifyResponse(async (event, responseStream, context) => {`,
|
|
539
|
-
...split.inner,
|
|
540
|
-
` const { ${oldHandlerFunction}: rawHandler} = await import("./${oldHandlerFileName}${newHandlerFileExt}");`,
|
|
541
|
-
` return rawHandler(event, responseStream, context);`,
|
|
542
|
-
`});`,
|
|
543
|
-
].join("\n")
|
|
544
|
-
: [
|
|
545
|
-
...split.outer,
|
|
546
|
-
`export const ${newHandlerFunction} = async (event, context) => {`,
|
|
547
|
-
...split.inner,
|
|
548
|
-
` const { ${oldHandlerFunction}: rawHandler} = await import("./${oldHandlerFileName}${newHandlerFileExt}");`,
|
|
549
|
-
` return rawHandler(event, context);`,
|
|
550
|
-
`};`,
|
|
551
|
-
].join("\n"),
|
|
552
|
-
},
|
|
553
|
-
};
|
|
554
|
-
}));
|
|
555
|
-
return {
|
|
556
|
-
handler: ret.handler,
|
|
557
|
-
wrapper: ret.wrapper,
|
|
558
|
-
};
|
|
559
|
-
}
|
|
560
|
-
function createRole() {
|
|
561
|
-
var _a;
|
|
562
|
-
if (args.role) {
|
|
563
|
-
return iam.Role.get(`${name}Role`, output(args.role).apply(parseRoleArn).roleName, {}, { parent });
|
|
564
|
-
}
|
|
565
|
-
const policy = all([args.permissions || [], linkPermissions, dev]).apply(([argsPermissions, linkPermissions, dev]) => iam.getPolicyDocumentOutput({
|
|
566
|
-
statements: [
|
|
567
|
-
...argsPermissions,
|
|
568
|
-
...linkPermissions,
|
|
569
|
-
...(dev
|
|
570
|
-
? [
|
|
571
|
-
{
|
|
572
|
-
effect: "allow",
|
|
573
|
-
actions: ["appsync:*"],
|
|
574
|
-
resources: ["*"],
|
|
575
|
-
},
|
|
576
|
-
{
|
|
577
|
-
effect: "allow",
|
|
578
|
-
actions: ["s3:*"],
|
|
579
|
-
resources: [
|
|
580
|
-
interpolate `arn:${partition}:s3:::${bootstrapData.asset}`,
|
|
581
|
-
interpolate `arn:${partition}:s3:::${bootstrapData.asset}/*`,
|
|
582
|
-
],
|
|
583
|
-
},
|
|
584
|
-
]
|
|
585
|
-
: []),
|
|
586
|
-
].map((item) => ({
|
|
587
|
-
effect: (() => {
|
|
588
|
-
var _a;
|
|
589
|
-
const effect = (_a = item.effect) !== null && _a !== void 0 ? _a : "allow";
|
|
590
|
-
return effect.charAt(0).toUpperCase() + effect.slice(1);
|
|
591
|
-
})(),
|
|
592
|
-
actions: item.actions,
|
|
593
|
-
resources: item.resources,
|
|
594
|
-
})),
|
|
595
|
-
}));
|
|
596
|
-
return new iam.Role(...transform((_a = args.transform) === null || _a === void 0 ? void 0 : _a.role, `${name}Role`, {
|
|
597
|
-
assumeRolePolicy: !dev
|
|
598
|
-
? iam.assumeRolePolicyForPrincipal({
|
|
599
|
-
Service: "lambda.amazonaws.com",
|
|
600
|
-
})
|
|
601
|
-
: iam.getPolicyDocumentOutput({
|
|
602
|
-
statements: [
|
|
603
|
-
{
|
|
604
|
-
actions: ["sts:AssumeRole"],
|
|
605
|
-
principals: [
|
|
606
|
-
{
|
|
607
|
-
type: "Service",
|
|
608
|
-
identifiers: ["lambda.amazonaws.com"],
|
|
609
|
-
},
|
|
610
|
-
{
|
|
611
|
-
type: "AWS",
|
|
612
|
-
identifiers: [
|
|
613
|
-
interpolate `arn:${partition}:iam::${getCallerIdentityOutput({}, opts).accountId}:root`,
|
|
614
|
-
],
|
|
615
|
-
},
|
|
616
|
-
],
|
|
617
|
-
},
|
|
618
|
-
],
|
|
619
|
-
}).json,
|
|
620
|
-
// if there are no statements, do not add an inline policy.
|
|
621
|
-
// adding an inline policy with no statements will cause an error.
|
|
622
|
-
inlinePolicies: policy.apply(({ statements }) => statements ? [{ name: "inline", policy: policy.json }] : []),
|
|
623
|
-
managedPolicyArns: all([logging, policies]).apply(([logging, policies]) => [
|
|
624
|
-
...policies,
|
|
625
|
-
...(logging
|
|
626
|
-
? [
|
|
627
|
-
interpolate `arn:${partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole`,
|
|
628
|
-
]
|
|
629
|
-
: []),
|
|
630
|
-
...(vpc
|
|
631
|
-
? [
|
|
632
|
-
interpolate `arn:${partition}:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole`,
|
|
633
|
-
]
|
|
634
|
-
: []),
|
|
635
|
-
]),
|
|
636
|
-
}, { parent }));
|
|
637
|
-
}
|
|
638
|
-
function createImageAsset() {
|
|
639
|
-
// The build artifact directory already exists, with all the user code and
|
|
640
|
-
// config files. It also has the dockerfile, we need to now just build and push to
|
|
641
|
-
// the container registry.
|
|
642
|
-
return all([isContainer, dev, bundle]).apply(([isContainer, dev, bundle, // We need the bundle to be resolved because of implicit dockerfiles even though we don't use it here
|
|
643
|
-
]) => {
|
|
644
|
-
if (!isContainer || dev)
|
|
645
|
-
return;
|
|
646
|
-
const authToken = ecr.getAuthorizationTokenOutput({
|
|
647
|
-
registryId: bootstrapData.assetEcrRegistryId,
|
|
648
|
-
});
|
|
649
|
-
return new Image(`${name}Image`, {
|
|
650
|
-
tags: [$interpolate `${bootstrapData.assetEcrUrl}:latest`],
|
|
651
|
-
context: {
|
|
652
|
-
location: path.join($cli.paths.work, "artifacts", `${name}-src`),
|
|
653
|
-
},
|
|
654
|
-
cacheFrom: [
|
|
655
|
-
{
|
|
656
|
-
registry: {
|
|
657
|
-
ref: $interpolate `${bootstrapData.assetEcrUrl}:${name}-cache`,
|
|
658
|
-
},
|
|
659
|
-
},
|
|
660
|
-
],
|
|
661
|
-
cacheTo: [
|
|
662
|
-
{
|
|
663
|
-
registry: {
|
|
664
|
-
ref: $interpolate `${bootstrapData.assetEcrUrl}:${name}-cache`,
|
|
665
|
-
imageManifest: true,
|
|
666
|
-
ociMediaTypes: true,
|
|
667
|
-
mode: "max",
|
|
668
|
-
},
|
|
669
|
-
},
|
|
670
|
-
],
|
|
671
|
-
platforms: [
|
|
672
|
-
architecture.apply((v) => v === "arm64" ? "linux/arm64" : "linux/amd64"),
|
|
673
|
-
],
|
|
674
|
-
push: true,
|
|
675
|
-
registries: [
|
|
676
|
-
authToken.apply((authToken) => ({
|
|
677
|
-
address: authToken.proxyEndpoint,
|
|
678
|
-
username: authToken.userName,
|
|
679
|
-
password: secret(authToken.password),
|
|
680
|
-
})),
|
|
681
|
-
],
|
|
682
|
-
}, { parent });
|
|
683
|
-
});
|
|
684
|
-
}
|
|
685
|
-
function createZipAsset() {
|
|
686
|
-
// Note: cannot point the bundle to the `.open-next/server-function`
|
|
687
|
-
// b/c the folder contains node_modules. And pnpm node_modules
|
|
688
|
-
// contains symlinks. Pulumi cannot zip symlinks correctly.
|
|
689
|
-
// We will zip the folder ourselves.
|
|
690
|
-
return all([
|
|
691
|
-
bundle,
|
|
692
|
-
wrapper,
|
|
693
|
-
sourcemaps,
|
|
694
|
-
copyFiles,
|
|
695
|
-
isContainer,
|
|
696
|
-
logGroup.apply((l) => l === null || l === void 0 ? void 0 : l.arn),
|
|
697
|
-
dev,
|
|
698
|
-
]).apply((_a) => __awaiter(this, [_a], void 0, function* ([bundle, wrapper, sourcemaps, copyFiles, isContainer, logGroupArn, dev,]) {
|
|
699
|
-
if (isContainer)
|
|
700
|
-
return;
|
|
701
|
-
const zipPath = path.resolve($cli.paths.work, "artifacts", name, "code.zip");
|
|
702
|
-
yield fs.promises.mkdir(path.dirname(zipPath), {
|
|
703
|
-
recursive: true,
|
|
704
|
-
});
|
|
705
|
-
yield new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
706
|
-
const ws = fs.createWriteStream(zipPath);
|
|
707
|
-
const archive = archiver("zip", {
|
|
708
|
-
// Ensure deterministic zip file hashes
|
|
709
|
-
// https://github.com/archiverjs/node-archiver/issues/397#issuecomment-554327338
|
|
710
|
-
statConcurrency: 1,
|
|
711
|
-
});
|
|
712
|
-
archive.on("warning", reject);
|
|
713
|
-
archive.on("error", reject);
|
|
714
|
-
// archive has been finalized and the output file descriptor has closed, resolve promise
|
|
715
|
-
// this has to be done before calling `finalize` since the events may fire immediately after.
|
|
716
|
-
// see https://www.npmjs.com/package/archiver
|
|
717
|
-
ws.once("close", () => {
|
|
718
|
-
resolve(zipPath);
|
|
719
|
-
});
|
|
720
|
-
archive.pipe(ws);
|
|
721
|
-
const files = [];
|
|
722
|
-
for (const item of [
|
|
723
|
-
{
|
|
724
|
-
from: bundle,
|
|
725
|
-
to: ".",
|
|
726
|
-
isDir: true,
|
|
727
|
-
},
|
|
728
|
-
...(!dev ? copyFiles : []),
|
|
729
|
-
]) {
|
|
730
|
-
if (!item.isDir) {
|
|
731
|
-
files.push({
|
|
732
|
-
from: item.from,
|
|
733
|
-
to: item.to,
|
|
734
|
-
});
|
|
735
|
-
}
|
|
736
|
-
const found = yield glob("**", {
|
|
737
|
-
cwd: item.from,
|
|
738
|
-
dot: true,
|
|
739
|
-
ignore: (sourcemaps === null || sourcemaps === void 0 ? void 0 : sourcemaps.map((item) => path.relative(bundle, item))) || [],
|
|
740
|
-
});
|
|
741
|
-
files.push(...found.map((file) => ({
|
|
742
|
-
from: path.join(item.from, file),
|
|
743
|
-
to: path.join(item.to, file),
|
|
744
|
-
})));
|
|
745
|
-
}
|
|
746
|
-
files.sort((a, b) => a.to.localeCompare(b.to));
|
|
747
|
-
for (const file of files) {
|
|
748
|
-
archive.file(file.from, {
|
|
749
|
-
name: file.to,
|
|
750
|
-
date: new Date(0),
|
|
751
|
-
});
|
|
752
|
-
}
|
|
753
|
-
// Add handler wrapper into the zip
|
|
754
|
-
if (wrapper) {
|
|
755
|
-
archive.append(wrapper.content, {
|
|
756
|
-
name: wrapper.name,
|
|
757
|
-
date: new Date(0),
|
|
758
|
-
});
|
|
759
|
-
}
|
|
760
|
-
yield archive.finalize();
|
|
761
|
-
}));
|
|
762
|
-
// Calculate hash of the zip file
|
|
763
|
-
const hash = crypto.createHash("sha256");
|
|
764
|
-
hash.update(yield fs.promises.readFile(zipPath, "utf-8"));
|
|
765
|
-
const hashValue = hash.digest("hex");
|
|
766
|
-
const assetBucket = region.apply((region) => bootstrap.forRegion(region).then((d) => d.asset));
|
|
767
|
-
if (logGroupArn && sourcemaps) {
|
|
768
|
-
let index = 0;
|
|
769
|
-
for (const file of sourcemaps) {
|
|
770
|
-
new s3.BucketObjectv2(`${name}Sourcemap${index}`, {
|
|
771
|
-
key: interpolate `sourcemap/${logGroupArn}/${hashValue}.${path.basename(file)}`,
|
|
772
|
-
bucket: assetBucket,
|
|
773
|
-
source: new asset.FileAsset(file),
|
|
774
|
-
}, { parent, retainOnDelete: true });
|
|
775
|
-
index++;
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
return new s3.BucketObjectv2(`${name}Code`, {
|
|
779
|
-
key: interpolate `assets/${name}-code-${hashValue}.zip`,
|
|
780
|
-
bucket: assetBucket,
|
|
781
|
-
source: new asset.FileArchive(zipPath),
|
|
782
|
-
}, { parent });
|
|
783
|
-
}));
|
|
784
|
-
}
|
|
785
|
-
function createLogGroup() {
|
|
786
|
-
return logging.apply((logging) => {
|
|
787
|
-
var _a, _b;
|
|
788
|
-
if (!logging)
|
|
789
|
-
return;
|
|
790
|
-
if (logging.logGroup)
|
|
791
|
-
return;
|
|
792
|
-
return new cloudwatch.LogGroup(...transform((_a = args.transform) === null || _a === void 0 ? void 0 : _a.logGroup, `${name}LogGroup`, {
|
|
793
|
-
name: interpolate `/aws/lambda/${(_b = args.name) !== null && _b !== void 0 ? _b : physicalName(64, `${name}Function`)}`,
|
|
794
|
-
retentionInDays: RETENTION[logging.retention],
|
|
795
|
-
}, { parent, ignoreChanges: ["name"] }));
|
|
796
|
-
});
|
|
797
|
-
}
|
|
798
|
-
function createFunction() {
|
|
799
|
-
return all([
|
|
800
|
-
logging,
|
|
801
|
-
logGroup,
|
|
802
|
-
isContainer,
|
|
803
|
-
imageAsset,
|
|
804
|
-
zipAsset,
|
|
805
|
-
args.concurrency,
|
|
806
|
-
dev,
|
|
807
|
-
]).apply(([logging, logGroup, isContainer, imageAsset, zipAsset, concurrency, dev,]) => {
|
|
808
|
-
var _a, _b, _c, _d;
|
|
809
|
-
// This is a hack to avoid handler being marked as having propertyDependencies.
|
|
810
|
-
// There is an unresolved bug in pulumi that causes issues when it does
|
|
811
|
-
// @ts-expect-error
|
|
812
|
-
handler.allResources = () => Promise.resolve(new Set());
|
|
813
|
-
const transformed = transform((_a = args.transform) === null || _a === void 0 ? void 0 : _a.function, `${name}Function`, Object.assign({ name: args.name, description: (_b = args.description) !== null && _b !== void 0 ? _b : "", role: (_c = args.role) !== null && _c !== void 0 ? _c : role.arn, timeout: timeout.apply((timeout) => toSeconds(timeout)), memorySize: memory.apply((memory) => toMBs(memory)), ephemeralStorage: { size: storage.apply((v) => toMBs(v)) }, environment: {
|
|
814
|
-
variables: environment,
|
|
815
|
-
}, architectures: [architecture], loggingConfig: logging && {
|
|
816
|
-
logFormat: logging.format === "json" ? "JSON" : "Text",
|
|
817
|
-
logGroup: (_d = logging.logGroup) !== null && _d !== void 0 ? _d : logGroup.name,
|
|
818
|
-
}, vpcConfig: vpc && {
|
|
819
|
-
securityGroupIds: vpc.securityGroups,
|
|
820
|
-
subnetIds: vpc.privateSubnets,
|
|
821
|
-
}, fileSystemConfig: volume && {
|
|
822
|
-
arn: volume.efs,
|
|
823
|
-
localMountPath: volume.path,
|
|
824
|
-
}, layers: args.layers, tags: args.tags, publish: output(args.versioning).apply((v) => v !== null && v !== void 0 ? v : false), reservedConcurrentExecutions: concurrency === null || concurrency === void 0 ? void 0 : concurrency.reserved }, (isContainer
|
|
825
|
-
? {
|
|
826
|
-
packageType: "Image",
|
|
827
|
-
imageUri: imageAsset.ref.apply((ref) => ref === null || ref === void 0 ? void 0 : ref.replace(":latest", "")),
|
|
828
|
-
imageConfig: {
|
|
829
|
-
commands: [
|
|
830
|
-
all([handler, runtime]).apply(([handler, runtime]) => {
|
|
831
|
-
// If a python container image we have to rewrite the handler path so lambdaric is happy
|
|
832
|
-
// This means no leading . and replace all / with .
|
|
833
|
-
if (isContainer && runtime.includes("python")) {
|
|
834
|
-
return handler
|
|
835
|
-
.replace(/\.\//g, "")
|
|
836
|
-
.replace(/\//g, ".");
|
|
837
|
-
}
|
|
838
|
-
return handler;
|
|
839
|
-
}),
|
|
840
|
-
],
|
|
841
|
-
},
|
|
842
|
-
}
|
|
843
|
-
: {
|
|
844
|
-
packageType: "Zip",
|
|
845
|
-
s3Bucket: zipAsset.bucket,
|
|
846
|
-
s3Key: zipAsset.key,
|
|
847
|
-
handler: unsecret(handler),
|
|
848
|
-
runtime: runtime.apply((v) => v === "go" || v === "rust" ? "provided.al2023" : v),
|
|
849
|
-
})), { parent });
|
|
850
|
-
return new lambda.Function(transformed[0], Object.assign(Object.assign({}, transformed[1]), (dev
|
|
851
|
-
? {
|
|
852
|
-
description: transformed[1].description
|
|
853
|
-
? output(transformed[1].description).apply((v) => `${v.substring(0, 240)} (live)`)
|
|
854
|
-
: "live",
|
|
855
|
-
runtime: "provided.al2023",
|
|
856
|
-
architectures: ["x86_64"],
|
|
857
|
-
}
|
|
858
|
-
: {})), transformed[2]);
|
|
859
|
-
});
|
|
860
|
-
}
|
|
861
|
-
function createUrl() {
|
|
862
|
-
return url.apply((url) => {
|
|
863
|
-
if (url === undefined)
|
|
864
|
-
return output(undefined);
|
|
865
|
-
// create the function url
|
|
866
|
-
const fnUrl = new lambda.FunctionUrl(`${name}Url`, {
|
|
867
|
-
functionName: fn.name,
|
|
868
|
-
authorizationType: url.authorization === "iam" ? "AWS_IAM" : "NONE",
|
|
869
|
-
invokeMode: streaming.apply((streaming) => streaming ? "RESPONSE_STREAM" : "BUFFERED"),
|
|
870
|
-
cors: url.cors,
|
|
871
|
-
}, { parent });
|
|
872
|
-
if (!url.route)
|
|
873
|
-
return fnUrl.functionUrl;
|
|
874
|
-
// add router route
|
|
875
|
-
const routeNamespace = crypto
|
|
876
|
-
.createHash("md5")
|
|
877
|
-
.update(`${$app.name}-${$app.stage}-${name}`)
|
|
878
|
-
.digest("hex")
|
|
879
|
-
.substring(0, 4);
|
|
880
|
-
new KvKeys(`${name}RouteKey`, {
|
|
881
|
-
store: url.route.routerKvStoreArn,
|
|
882
|
-
namespace: routeNamespace,
|
|
883
|
-
entries: fnUrl.functionUrl.apply((fnUrl) => ({
|
|
884
|
-
metadata: JSON.stringify({
|
|
885
|
-
host: new URL(fnUrl).host,
|
|
886
|
-
}),
|
|
887
|
-
})),
|
|
888
|
-
purge: false,
|
|
889
|
-
}, { parent });
|
|
890
|
-
new KvRoutesUpdate(`${name}RoutesUpdate`, {
|
|
891
|
-
store: url.route.routerKvStoreArn,
|
|
892
|
-
namespace: url.route.routerKvNamespace,
|
|
893
|
-
key: "routes",
|
|
894
|
-
entry: url.route.apply((route) => ["url", routeNamespace, route.hostPattern, route.pathPrefix].join(",")),
|
|
895
|
-
}, { parent });
|
|
896
|
-
return url.route.routerUrl;
|
|
897
|
-
});
|
|
898
|
-
}
|
|
899
|
-
function createProvisioned() {
|
|
900
|
-
return all([args.concurrency, fn.publish]).apply(([concurrency, publish]) => {
|
|
901
|
-
if (!(concurrency === null || concurrency === void 0 ? void 0 : concurrency.provisioned) || concurrency.provisioned === 0) {
|
|
902
|
-
return;
|
|
903
|
-
}
|
|
904
|
-
if (publish !== true) {
|
|
905
|
-
throw new VisibleError(`Provisioned concurrency requires function versioning. Set "versioning: true" to enable function versioning.`);
|
|
906
|
-
}
|
|
907
|
-
return new lambda.ProvisionedConcurrencyConfig(`${name}Provisioned`, {
|
|
908
|
-
functionName: fn.name,
|
|
909
|
-
qualifier: fn.version,
|
|
910
|
-
provisionedConcurrentExecutions: concurrency.provisioned,
|
|
911
|
-
}, { parent });
|
|
912
|
-
});
|
|
913
|
-
}
|
|
914
|
-
function createEventInvokeConfig() {
|
|
915
|
-
var _a;
|
|
916
|
-
if (args.retries === undefined) {
|
|
917
|
-
return undefined;
|
|
918
|
-
}
|
|
919
|
-
return new lambda.FunctionEventInvokeConfig(...transform((_a = args.transform) === null || _a === void 0 ? void 0 : _a.eventInvokeConfig, `${name}EventInvokeConfig`, {
|
|
920
|
-
functionName: fn.name,
|
|
921
|
-
maximumRetryAttempts: args.retries,
|
|
922
|
-
}, { parent }));
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
/**
|
|
926
|
-
* The underlying [resources](/docs/components/#nodes) this component creates.
|
|
927
|
-
*/
|
|
928
|
-
get nodes() {
|
|
929
|
-
return {
|
|
930
|
-
/**
|
|
931
|
-
* The IAM Role the function will use.
|
|
932
|
-
*/
|
|
933
|
-
role: this.role,
|
|
934
|
-
/**
|
|
935
|
-
* The AWS Lambda function.
|
|
936
|
-
*/
|
|
937
|
-
function: this.function,
|
|
938
|
-
/**
|
|
939
|
-
* The CloudWatch Log Group the function logs are stored.
|
|
940
|
-
*/
|
|
941
|
-
logGroup: this.logGroup,
|
|
942
|
-
/**
|
|
943
|
-
* The Function Event Invoke Config resource if retries are configured.
|
|
944
|
-
*/
|
|
945
|
-
eventInvokeConfig: this.eventInvokeConfig,
|
|
946
|
-
};
|
|
947
|
-
}
|
|
948
|
-
/**
|
|
949
|
-
* The Lambda function URL if `url` is enabled.
|
|
950
|
-
*/
|
|
951
|
-
get url() {
|
|
952
|
-
return this.urlEndpoint.apply((url) => {
|
|
953
|
-
if (!url) {
|
|
954
|
-
throw new VisibleError(`Function URL is not enabled. Enable it with "url: true".`);
|
|
955
|
-
}
|
|
956
|
-
return url;
|
|
957
|
-
});
|
|
958
|
-
}
|
|
959
|
-
/**
|
|
960
|
-
* The name of the Lambda function.
|
|
961
|
-
*/
|
|
962
|
-
get name() {
|
|
963
|
-
return this.function.name;
|
|
964
|
-
}
|
|
965
|
-
/**
|
|
966
|
-
* The ARN of the Lambda function.
|
|
967
|
-
*/
|
|
968
|
-
get arn() {
|
|
969
|
-
return this.function.arn;
|
|
970
|
-
}
|
|
971
|
-
/**
|
|
972
|
-
* Add environment variables lazily to the function after the function is created.
|
|
973
|
-
*
|
|
974
|
-
* This is useful for adding environment variables that are only available after the
|
|
975
|
-
* function is created, like the function URL.
|
|
976
|
-
*
|
|
977
|
-
* @param environment The environment variables to add to the function.
|
|
978
|
-
*
|
|
979
|
-
* @example
|
|
980
|
-
* Add the function URL as an environment variable.
|
|
981
|
-
*
|
|
982
|
-
* ```ts title="sst.config.ts"
|
|
983
|
-
* const fn = new sst.aws.Function("MyFunction", {
|
|
984
|
-
* handler: "src/handler.handler",
|
|
985
|
-
* url: true,
|
|
986
|
-
* });
|
|
987
|
-
*
|
|
988
|
-
* fn.addEnvironment({
|
|
989
|
-
* URL: fn.url,
|
|
990
|
-
* });
|
|
991
|
-
* ```
|
|
992
|
-
*/
|
|
993
|
-
addEnvironment(environment) {
|
|
994
|
-
return new FunctionEnvironmentUpdate(`${this.constructorName}EnvironmentUpdate`, {
|
|
995
|
-
functionName: this.name,
|
|
996
|
-
environment,
|
|
997
|
-
region: getRegionOutput(undefined, { parent: this }).name,
|
|
998
|
-
}, { parent: this });
|
|
999
|
-
}
|
|
1000
|
-
/** @internal */
|
|
1001
|
-
static fromDefinition(name, definition, override, argsTransform, opts) {
|
|
1002
|
-
return output(definition).apply((definition) => {
|
|
1003
|
-
if (typeof definition === "string") {
|
|
1004
|
-
return new Function(...transform(argsTransform, name, Object.assign({ handler: definition }, override), opts || {}));
|
|
1005
|
-
}
|
|
1006
|
-
else if (definition.handler) {
|
|
1007
|
-
return new Function(...transform(argsTransform, name, Object.assign(Object.assign(Object.assign({}, definition), override), { permissions: all([
|
|
1008
|
-
definition.permissions,
|
|
1009
|
-
override === null || override === void 0 ? void 0 : override.permissions,
|
|
1010
|
-
]).apply(([permissions, overridePermissions]) => [
|
|
1011
|
-
...(permissions !== null && permissions !== void 0 ? permissions : []),
|
|
1012
|
-
...(overridePermissions !== null && overridePermissions !== void 0 ? overridePermissions : []),
|
|
1013
|
-
]) }), opts || {}));
|
|
1014
|
-
}
|
|
1015
|
-
throw new Error(`Invalid function definition for the "${name}" Function`);
|
|
1016
|
-
});
|
|
1017
|
-
}
|
|
1018
|
-
/** @internal */
|
|
1019
|
-
getSSTLink() {
|
|
1020
|
-
return {
|
|
1021
|
-
properties: {
|
|
1022
|
-
name: this.name,
|
|
1023
|
-
url: this.urlEndpoint,
|
|
1024
|
-
},
|
|
1025
|
-
include: [
|
|
1026
|
-
permission({
|
|
1027
|
-
actions: ["lambda:InvokeFunction"],
|
|
1028
|
-
resources: [this.function.arn],
|
|
1029
|
-
}),
|
|
1030
|
-
],
|
|
1031
|
-
};
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
Function.encryptionKey = lazy(() => new RandomBytes("LambdaEncryptionKey", {
|
|
1035
|
-
length: 32,
|
|
1036
|
-
}));
|
|
1037
|
-
Function.appsync = lazy(() => rpc.call("Provider.Aws.Appsync", {}));
|
|
1038
|
-
const __pulumiType = "sst:aws:Function";
|
|
1039
|
-
// @ts-expect-error
|
|
1040
|
-
Function.__pulumiType = __pulumiType;
|
|
1041
|
-
//# sourceMappingURL=function.js.map
|