sst 1.16.0 → 2.0.0-rc.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/LICENSE +21 -0
- package/{dist/app.d.ts → app.d.ts} +8 -1
- package/app.js +122 -0
- package/{dist/bootstrap.d.ts → bootstrap.d.ts} +1 -0
- package/bootstrap.js +79 -0
- package/{dist/bus.d.ts → bus.d.ts} +0 -0
- package/{dist/bus.js → bus.js} +0 -0
- package/{dist/cache.d.ts → cache.d.ts} +0 -0
- package/{dist/cache.js → cache.js} +0 -0
- package/{dist/cdk → cdk}/cloudformation-deployments.d.ts +1 -1
- package/{dist/cdk → cdk}/cloudformation-deployments.js +1 -0
- package/{dist/cdk → cdk}/deploy-stack.d.ts +0 -0
- package/{dist/cdk → cdk}/deploy-stack.js +13 -6
- package/{dist/cli → cli}/commands/bind.d.ts +3 -1
- package/{dist/cli → cli}/commands/bind.js +8 -4
- package/{dist/cli → cli}/commands/build.d.ts +2 -0
- package/cli/commands/build.js +12 -0
- package/cli/commands/console.d.ts +9 -0
- package/cli/commands/console.js +15 -0
- package/{dist/cli → cli}/commands/deploy.d.ts +7 -1
- package/cli/commands/deploy.js +48 -0
- package/cli/commands/dev.d.ts +11 -0
- package/cli/commands/dev.js +188 -0
- package/cli/commands/env.d.ts +11 -0
- package/cli/commands/env.js +39 -0
- package/cli/commands/plugins/kysely.d.ts +1 -0
- package/cli/commands/plugins/kysely.js +91 -0
- package/cli/commands/plugins/pothos.d.ts +1 -0
- package/cli/commands/plugins/pothos.js +52 -0
- package/cli/commands/plugins/warmer.d.ts +1 -0
- package/cli/commands/plugins/warmer.js +33 -0
- package/cli/commands/remove.d.ts +13 -0
- package/cli/commands/remove.js +39 -0
- package/{dist/cli → cli}/commands/secrets/get.d.ts +2 -0
- package/{dist/cli → cli}/commands/secrets/get.js +0 -0
- package/{dist/cli → cli}/commands/secrets/list.d.ts +2 -0
- package/{dist/cli → cli}/commands/secrets/list.js +5 -5
- package/{dist/cli → cli}/commands/secrets/remove.d.ts +2 -0
- package/{dist/cli → cli}/commands/secrets/remove.js +0 -0
- package/{dist/cli → cli}/commands/secrets/secrets.d.ts +0 -0
- package/{dist/cli → cli}/commands/secrets/secrets.js +0 -0
- package/{dist/cli → cli}/commands/secrets/set.d.ts +2 -0
- package/{dist/cli → cli}/commands/secrets/set.js +13 -11
- package/{dist/cli → cli}/commands/update.d.ts +2 -0
- package/{dist/cli → cli}/commands/update.js +17 -21
- package/cli/local/router.d.ts +42 -0
- package/cli/local/router.js +43 -0
- package/cli/local/server.d.ts +20 -0
- package/cli/local/server.js +212 -0
- package/cli/program.d.ts +9 -0
- package/{dist/cli → cli}/program.js +6 -1
- package/{dist/cli → cli}/spinner.d.ts +0 -0
- package/{dist/cli → cli}/spinner.js +0 -0
- package/cli/sst.d.ts +2 -0
- package/{dist/cli → cli}/sst.js +27 -16
- package/cli/telemetry/environment.d.ts +15 -0
- package/cli/telemetry/environment.js +27 -0
- package/cli/telemetry/post-payload.d.ts +1 -0
- package/cli/telemetry/post-payload.js +18 -0
- package/cli/telemetry/project-id.d.ts +2 -0
- package/cli/telemetry/project-id.js +47 -0
- package/cli/telemetry/telemetry.d.ts +4 -0
- package/cli/telemetry/telemetry.js +90 -0
- package/cli/ui/deploy.d.ts +8 -0
- package/{dist/cli → cli}/ui/deploy.js +39 -1
- package/{dist/config.d.ts → config.d.ts} +0 -0
- package/{dist/config.js → config.js} +16 -4
- package/{dist/constructs → constructs}/Api.d.ts +98 -12
- package/{dist/constructs → constructs}/Api.js +93 -7
- package/{dist/constructs → constructs}/ApiGatewayV1Api.d.ts +0 -0
- package/{dist/constructs → constructs}/ApiGatewayV1Api.js +10 -5
- package/{dist/constructs → constructs}/App.d.ts +4 -26
- package/{dist/constructs → constructs}/App.js +119 -99
- package/{dist/constructs → constructs}/AppSyncApi.d.ts +3 -3
- package/{dist/constructs → constructs}/AppSyncApi.js +27 -20
- package/constructs/AstroSite.d.ts +25 -0
- package/constructs/AstroSite.js +111 -0
- package/constructs/AstroSite.tsdoc.d.ts +2 -0
- package/constructs/AstroSite.tsdoc.js +2 -0
- package/{dist/constructs → constructs}/Auth.d.ts +1 -1
- package/{dist/constructs → constructs}/Auth.js +6 -4
- package/{dist/constructs → constructs}/BaseSite.d.ts +0 -0
- package/{dist/constructs → constructs}/BaseSite.js +0 -0
- package/{dist/constructs → constructs}/Bucket.d.ts +0 -0
- package/{dist/constructs → constructs}/Bucket.js +6 -3
- package/{dist/constructs → constructs}/Cognito.d.ts +0 -0
- package/{dist/constructs → constructs}/Cognito.js +4 -1
- package/{dist/constructs → constructs}/Config.d.ts +0 -0
- package/{dist/constructs → constructs}/Config.js +0 -0
- package/{dist/constructs → constructs}/Construct.d.ts +0 -0
- package/{dist/constructs → constructs}/Construct.js +0 -0
- package/{dist/constructs → constructs}/Cron.d.ts +0 -0
- package/{dist/constructs → constructs}/Cron.js +7 -0
- package/{dist/constructs → constructs}/DebugApp.d.ts +2 -2
- package/{dist/constructs → constructs}/DebugApp.js +16 -0
- package/{dist/constructs → constructs}/DebugStack.d.ts +0 -0
- package/{dist/constructs → constructs}/DebugStack.js +4 -0
- package/{dist/constructs → constructs}/EdgeFunction.d.ts +1 -0
- package/{dist/constructs → constructs}/EdgeFunction.js +27 -22
- package/{dist/constructs → constructs}/EventBus.d.ts +0 -0
- package/{dist/constructs → constructs}/EventBus.js +7 -4
- package/{dist/constructs → constructs}/Function.d.ts +73 -174
- package/{dist/constructs → constructs}/Function.js +43 -83
- package/{dist/constructs → constructs}/FunctionalStack.d.ts +0 -0
- package/{dist/constructs → constructs}/FunctionalStack.js +5 -5
- package/{dist/constructs → constructs}/GraphQLApi.d.ts +11 -1
- package/{dist/constructs → constructs}/GraphQLApi.js +3 -0
- package/{dist/constructs → constructs}/Job.d.ts +0 -14
- package/{dist/constructs → constructs}/Job.js +50 -46
- package/{dist/constructs → constructs}/KinesisStream.d.ts +0 -0
- package/{dist/constructs → constructs}/KinesisStream.js +6 -3
- package/{dist/constructs → constructs}/Metadata.d.ts +1 -1
- package/{dist/constructs → constructs}/Metadata.js +0 -0
- package/constructs/NextjsSite.d.ts +33 -0
- package/constructs/NextjsSite.js +285 -0
- package/{dist/constructs → constructs}/Parameter.d.ts +0 -0
- package/{dist/constructs → constructs}/Parameter.js +3 -0
- package/{dist/constructs → constructs}/Queue.d.ts +0 -0
- package/{dist/constructs → constructs}/Queue.js +19 -12
- package/{dist/constructs → constructs}/RDS.d.ts +0 -0
- package/{dist/constructs → constructs}/RDS.js +26 -19
- package/{dist/constructs → constructs}/ReactStaticSite.d.ts +0 -0
- package/{dist/constructs → constructs}/ReactStaticSite.js +1 -1
- package/constructs/RemixSite.d.ts +28 -0
- package/constructs/RemixSite.js +150 -0
- package/constructs/RemixSite.tsdoc.d.ts +2 -0
- package/constructs/RemixSite.tsdoc.js +2 -0
- package/{dist/constructs → constructs}/Script/cfn-response.d.ts +0 -0
- package/{dist/constructs → constructs}/Script/cfn-response.js +0 -0
- package/{dist/constructs → constructs}/Script/index.d.ts +0 -0
- package/{dist/constructs → constructs}/Script/index.js +0 -0
- package/{dist/constructs → constructs}/Script/outbound.d.ts +1 -1
- package/{dist/constructs → constructs}/Script/outbound.js +0 -0
- package/{dist/constructs → constructs}/Script/util.d.ts +0 -0
- package/{dist/constructs → constructs}/Script/util.js +0 -0
- package/{dist/constructs → constructs}/Script.d.ts +0 -0
- package/{dist/constructs → constructs}/Script.js +13 -0
- package/{dist/constructs → constructs}/Secret.d.ts +0 -0
- package/{dist/constructs → constructs}/Secret.js +2 -0
- package/constructs/SolidStartSite.d.ts +24 -0
- package/constructs/SolidStartSite.js +103 -0
- package/constructs/SolidStartSite.tsdoc.d.ts +2 -0
- package/constructs/SolidStartSite.tsdoc.js +2 -0
- package/{dist/constructs/RemixSite.d.ts → constructs/SsrSite.d.ts} +69 -107
- package/{dist/constructs/RemixSite.js → constructs/SsrSite.js} +243 -446
- package/{dist/constructs → constructs}/Stack.d.ts +1 -1
- package/{dist/constructs → constructs}/Stack.js +19 -4
- package/{dist/constructs → constructs}/StaticSite.d.ts +44 -17
- package/{dist/constructs → constructs}/StaticSite.js +121 -72
- package/{dist/constructs → constructs}/Table.d.ts +0 -0
- package/{dist/constructs → constructs}/Table.js +9 -3
- package/{dist/constructs → constructs}/Topic.d.ts +0 -0
- package/{dist/constructs → constructs}/Topic.js +6 -3
- package/{dist/constructs → constructs}/ViteStaticSite.d.ts +0 -0
- package/{dist/constructs → constructs}/ViteStaticSite.js +2 -2
- package/{dist/constructs → constructs}/WebSocketApi.d.ts +0 -0
- package/{dist/constructs → constructs}/WebSocketApi.js +9 -4
- package/{dist/constructs → constructs}/context.d.ts +1 -1
- package/{dist/constructs → constructs}/context.js +0 -0
- package/{dist/constructs → constructs}/deferred_task.d.ts +0 -0
- package/{dist/constructs → constructs}/deferred_task.js +4 -2
- package/{dist/constructs → constructs/deprecated}/NextjsSite.d.ts +12 -8
- package/{dist/constructs → constructs/deprecated}/NextjsSite.js +112 -89
- package/{dist/constructs/nextjs-site → constructs/deprecated}/cross-region-helper.d.ts +0 -0
- package/{dist/constructs/nextjs-site → constructs/deprecated}/cross-region-helper.js +3 -3
- package/constructs/deprecated/index.d.ts +1 -0
- package/constructs/deprecated/index.js +1 -0
- package/{dist/constructs → constructs}/index.d.ts +3 -2
- package/{dist/constructs → constructs}/index.js +2 -0
- package/{dist/constructs → constructs}/util/apiGatewayV1AccessLog.d.ts +0 -0
- package/{dist/constructs → constructs}/util/apiGatewayV1AccessLog.js +0 -0
- package/{dist/constructs → constructs}/util/apiGatewayV2AccessLog.d.ts +0 -0
- package/{dist/constructs → constructs}/util/apiGatewayV2AccessLog.js +4 -4
- package/{dist/constructs → constructs}/util/apiGatewayV2Cors.d.ts +0 -0
- package/{dist/constructs → constructs}/util/apiGatewayV2Cors.js +0 -0
- package/{dist/constructs → constructs}/util/apiGatewayV2Domain.d.ts +0 -0
- package/{dist/constructs → constructs}/util/apiGatewayV2Domain.js +0 -0
- package/{dist/constructs → constructs}/util/appSyncApiDomain.d.ts +1 -1
- package/{dist/constructs → constructs}/util/appSyncApiDomain.js +15 -9
- package/{dist/constructs → constructs}/util/builder.d.ts +0 -0
- package/{dist/constructs → constructs}/util/builder.js +0 -0
- package/{dist/constructs → constructs}/util/duration.d.ts +0 -0
- package/{dist/constructs → constructs}/util/duration.js +0 -0
- package/{dist/constructs → constructs}/util/functionBinding.d.ts +0 -0
- package/{dist/constructs → constructs}/util/functionBinding.js +0 -0
- package/{dist/constructs → constructs}/util/functionUrlCors.d.ts +0 -0
- package/{dist/constructs → constructs}/util/functionUrlCors.js +0 -0
- package/{dist/constructs → constructs}/util/permission.d.ts +0 -0
- package/{dist/constructs → constructs}/util/permission.js +32 -16
- package/{dist/constructs → constructs}/util/python/bundling.d.ts +0 -0
- package/{dist/constructs → constructs}/util/python/bundling.js +0 -0
- package/{dist/constructs → constructs}/util/size.d.ts +0 -0
- package/{dist/constructs → constructs}/util/size.js +0 -0
- package/{dist/constructs → constructs}/util/warning.d.ts +0 -0
- package/{dist/constructs → constructs}/util/warning.js +0 -0
- package/{dist/context → context}/context.d.ts +1 -1
- package/{dist/context → context}/context.js +3 -4
- package/{dist/context → context}/handler.d.ts +0 -0
- package/{dist/context → context}/handler.js +1 -1
- package/{dist/context → context}/index.d.ts +0 -0
- package/{dist/context → context}/index.js +0 -0
- package/{dist/credentials.d.ts → credentials.d.ts} +3 -1
- package/{dist/credentials.js → credentials.js} +11 -3
- package/{dist/error.d.ts → error.d.ts} +0 -0
- package/{dist/error.js → error.js} +0 -0
- package/{dist/iot.d.ts → iot.d.ts} +0 -0
- package/{dist/iot.js → iot.js} +3 -0
- package/logger.d.ts +3 -0
- package/{dist/logger.js → logger.js} +12 -8
- package/node/api/index.d.ts +42 -0
- package/node/api/index.js +88 -0
- package/node/auth/adapter/adapter.d.ts +3 -0
- package/node/auth/adapter/adapter.js +3 -0
- package/node/auth/adapter/facebook.d.ts +2 -0
- package/node/auth/adapter/facebook.js +26 -0
- package/node/auth/adapter/github.d.ts +2 -0
- package/node/auth/adapter/github.js +21 -0
- package/node/auth/adapter/google.d.ts +9 -0
- package/node/auth/adapter/google.js +18 -0
- package/node/auth/adapter/link.d.ts +8 -0
- package/node/auth/adapter/link.js +39 -0
- package/node/auth/adapter/oauth.d.ts +25 -0
- package/node/auth/adapter/oauth.js +52 -0
- package/node/auth/adapter/oidc.d.ts +17 -0
- package/node/auth/adapter/oidc.js +50 -0
- package/node/auth/adapter/twitch.d.ts +2 -0
- package/node/auth/adapter/twitch.js +11 -0
- package/node/auth/auth.d.ts +24 -0
- package/node/auth/auth.js +118 -0
- package/node/auth/index.d.ts +10 -0
- package/node/auth/index.js +10 -0
- package/node/auth/session.d.ts +76 -0
- package/node/auth/session.js +109 -0
- package/node/bucket/index.d.ts +3 -0
- package/node/bucket/index.js +3 -0
- package/node/config/index.d.ts +13 -0
- package/node/config/index.js +88 -0
- package/node/event-bus/index.d.ts +3 -0
- package/node/event-bus/index.js +3 -0
- package/node/function/index.d.ts +3 -0
- package/node/function/index.js +3 -0
- package/node/graphql/index.d.ts +38 -0
- package/node/graphql/index.js +48 -0
- package/node/job/index.d.ts +34 -0
- package/node/job/index.js +51 -0
- package/node/kinesis-stream/index.d.ts +3 -0
- package/node/kinesis-stream/index.js +3 -0
- package/node/queue/index.d.ts +3 -0
- package/node/queue/index.js +3 -0
- package/node/rds/index.d.ts +3 -0
- package/node/rds/index.js +3 -0
- package/node/site/index.d.ts +15 -0
- package/node/site/index.js +64 -0
- package/node/table/index.d.ts +3 -0
- package/node/table/index.js +3 -0
- package/node/topic/index.d.ts +3 -0
- package/node/topic/index.js +3 -0
- package/node/util/index.d.ts +7 -0
- package/node/util/index.js +57 -0
- package/package.json +107 -40
- package/pothos.d.ts +8 -0
- package/pothos.js +156 -0
- package/runtime/handlers/dotnet.d.ts +1 -0
- package/runtime/handlers/dotnet.js +117 -0
- package/runtime/handlers/go.d.ts +1 -0
- package/runtime/handlers/go.js +105 -0
- package/runtime/handlers/java.d.ts +1 -0
- package/runtime/handlers/java.js +97 -0
- package/{dist/runtime → runtime/handlers}/node.d.ts +0 -0
- package/runtime/handlers/node.js +172 -0
- package/runtime/handlers/python.d.ts +1 -0
- package/runtime/handlers/python.js +89 -0
- package/{dist/runtime → runtime}/handlers.d.ts +30 -12
- package/runtime/handlers.js +117 -0
- package/{dist/runtime → runtime}/iot.d.ts +0 -0
- package/{dist/runtime → runtime}/iot.js +1 -1
- package/{dist/runtime → runtime}/runtime.d.ts +2 -0
- package/{dist/runtime → runtime}/runtime.js +0 -0
- package/{dist/runtime → runtime}/server.d.ts +0 -0
- package/{dist/runtime → runtime}/server.js +39 -3
- package/{dist/runtime → runtime}/workers.d.ts +1 -0
- package/{dist/runtime → runtime}/workers.js +12 -4
- package/{dist/cli/sst.d.ts → scrap.d.ts} +0 -0
- package/scrap.js +58 -0
- package/site-env.d.ts +13 -0
- package/site-env.js +47 -0
- package/sst.mjs +21848 -0
- package/{dist/stacks → stacks}/build.d.ts +0 -0
- package/{dist/stacks → stacks}/build.js +18 -9
- package/stacks/deploy.d.ts +8 -0
- package/stacks/deploy.js +105 -0
- package/stacks/index.d.ts +7 -0
- package/stacks/index.js +7 -0
- package/stacks/metadata.d.ts +9 -0
- package/{dist/stacks → stacks}/metadata.js +2 -14
- package/stacks/monitor.d.ts +27 -0
- package/stacks/monitor.js +111 -0
- package/stacks/remove.d.ts +8 -0
- package/stacks/remove.js +80 -0
- package/stacks/synth.d.ts +10 -0
- package/stacks/synth.js +77 -0
- package/support/astro-site-html-stub/index.html +99 -0
- package/support/base-site-archiver.cjs +12 -11
- package/support/base-site-archiver.mjs +20 -0
- package/support/bridge/bridge.mjs +59 -0
- package/{dist/support → support}/custom-resources/index.mjs +44209 -42781
- package/support/dotnet31-bootstrap/Program.cs +17 -0
- package/support/dotnet31-bootstrap/dotnet-bootstrap.csproj +12 -0
- package/support/dotnet31-bootstrap/release/Amazon.Lambda.Core.dll +0 -0
- package/support/dotnet31-bootstrap/release/Amazon.Lambda.RuntimeSupport.dll +0 -0
- package/support/dotnet31-bootstrap/release/System.Runtime.CompilerServices.Unsafe.dll +0 -0
- package/support/dotnet31-bootstrap/release/System.Text.Encodings.Web.dll +0 -0
- package/support/dotnet31-bootstrap/release/System.Text.Json.dll +0 -0
- package/support/dotnet31-bootstrap/release/dotnet-bootstrap +0 -0
- package/support/dotnet31-bootstrap/release/dotnet-bootstrap.deps.json +230 -0
- package/support/dotnet31-bootstrap/release/dotnet-bootstrap.dll +0 -0
- package/support/dotnet31-bootstrap/release/dotnet-bootstrap.pdb +0 -0
- package/support/dotnet31-bootstrap/release/dotnet-bootstrap.runtimeconfig.json +9 -0
- package/support/dotnet6-bootstrap/Program.cs +17 -0
- package/support/dotnet6-bootstrap/dotnet-bootstrap.csproj +12 -0
- package/support/dotnet6-bootstrap/release/Amazon.Lambda.Core.dll +0 -0
- package/support/dotnet6-bootstrap/release/Amazon.Lambda.RuntimeSupport.dll +0 -0
- package/support/dotnet6-bootstrap/release/dotnet-bootstrap +0 -0
- package/support/dotnet6-bootstrap/release/dotnet-bootstrap.deps.json +59 -0
- package/support/dotnet6-bootstrap/release/dotnet-bootstrap.dll +0 -0
- package/support/dotnet6-bootstrap/release/dotnet-bootstrap.pdb +0 -0
- package/support/dotnet6-bootstrap/release/dotnet-bootstrap.runtimeconfig.json +12 -0
- package/support/edge-function/edge-lambda-version.mjs +3 -0
- package/support/edge-function/edge-lambda.mjs +3 -0
- package/support/edge-function/s3-bucket.mjs +3 -0
- package/{dist/support/base-site-custom-resource/cf-invalidate.py → support/edge-function-code-replacer/lambda-code-updater.py} +56 -30
- package/support/java-runtime/install.sh +25 -0
- package/support/java-runtime/pom.xml +39 -0
- package/support/java-runtime/release/aws-lambda-java-core-1.2.0.jar +0 -0
- package/support/java-runtime/release/aws-lambda-java-runtime-interface-client-1.1.0.jar +0 -0
- package/support/java-runtime/release/aws-lambda-java-serialization-1.0.0.jar +0 -0
- package/support/nextjs-site-html-stub/index.html +99 -0
- package/{dist/support → support}/nodejs-runtime/index.mjs +7822 -2771
- package/support/python-runtime/runtime.py +116 -0
- package/support/rds-migrator/index.mjs +28 -0
- package/support/remix-site-function/edge-server.js +158 -0
- package/support/remix-site-function/polyfill.js +24 -0
- package/support/remix-site-function/regional-server.js +162 -0
- package/support/remix-site-html-stub/index.html +99 -0
- package/support/sls-nextjs-site-build-helper/build.cjs +91 -0
- package/support/sls-nextjs-site-build-helper/index-wrapper.js +19 -0
- package/support/sls-nextjs-site-stub/index.html +99 -0
- package/support/solid-start-site-html-stub/index.html +99 -0
- package/support/ssr-site-function-stub/index.js +5 -0
- package/util/fs.d.ts +4 -0
- package/util/fs.js +46 -0
- package/util/module.d.ts +1 -0
- package/util/module.js +5 -0
- package/util/process.d.ts +2 -0
- package/util/process.js +3 -0
- package/{dist/watcher.d.ts → watcher.d.ts} +0 -0
- package/{dist/watcher.js → watcher.js} +1 -1
- package/.build/sst-debug.log +0 -10
- package/.turbo/turbo-build.log +0 -2
- package/CHANGELOG.md +0 -332
- package/analyze +0 -11090
- package/bin/sst.mjs +0 -3
- package/build.mjs +0 -116
- package/debug.log +0 -6
- package/dist/app.js +0 -92
- package/dist/bootstrap.js +0 -23
- package/dist/cli/commands/build.js +0 -8
- package/dist/cli/commands/deploy.js +0 -20
- package/dist/cli/commands/env.d.ts +0 -0
- package/dist/cli/commands/env.js +0 -1
- package/dist/cli/commands/scrap.d.ts +0 -5
- package/dist/cli/commands/scrap.js +0 -1
- package/dist/cli/commands/start.d.ts +0 -7
- package/dist/cli/commands/start.js +0 -136
- package/dist/cli/program.d.ts +0 -7
- package/dist/cli/ui/deploy.d.ts +0 -6
- package/dist/constructs/nextjs-site/custom-resource/cfn-response.d.ts +0 -19
- package/dist/constructs/nextjs-site/custom-resource/cfn-response.js +0 -94
- package/dist/constructs/nextjs-site/custom-resource/edge-lambda-version.d.ts +0 -1
- package/dist/constructs/nextjs-site/custom-resource/edge-lambda-version.js +0 -138
- package/dist/constructs/nextjs-site/custom-resource/edge-lambda.d.ts +0 -1
- package/dist/constructs/nextjs-site/custom-resource/edge-lambda.js +0 -136
- package/dist/constructs/nextjs-site/custom-resource/s3-bucket.d.ts +0 -1
- package/dist/constructs/nextjs-site/custom-resource/s3-bucket.js +0 -94
- package/dist/constructs/nextjs-site/custom-resource/util.d.ts +0 -1
- package/dist/constructs/nextjs-site/custom-resource/util.js +0 -4
- package/dist/logger.d.ts +0 -9
- package/dist/runtime/handlers.js +0 -72
- package/dist/runtime/node.js +0 -99
- package/dist/sst.mjs +0 -164202
- package/dist/stacks/deploy.d.ts +0 -33
- package/dist/stacks/deploy.js +0 -168
- package/dist/stacks/index.d.ts +0 -21
- package/dist/stacks/index.js +0 -57
- package/dist/stacks/metadata.d.ts +0 -9
- package/dist/support/base-site-archiver.cjs +0 -115
- package/dist/support/base-site-custom-resource/s3-handler.py +0 -195
- package/dist/support/base-site-custom-resource/s3-upload.py +0 -91
- package/dist/support/bridge/bridge.mjs +0 -86
- package/dist/support/static-site-stub/index.html +0 -90
- package/src/app.ts +0 -140
- package/src/bootstrap.ts +0 -28
- package/src/bus.ts +0 -81
- package/src/cache.ts +0 -34
- package/src/cdk/cloudformation-deployments.ts +0 -730
- package/src/cdk/deploy-stack.ts +0 -1030
- package/src/cli/commands/bind.ts +0 -31
- package/src/cli/commands/build.ts +0 -16
- package/src/cli/commands/deploy.ts +0 -34
- package/src/cli/commands/env.ts +0 -0
- package/src/cli/commands/scrap.ts +0 -5
- package/src/cli/commands/secrets/get.ts +0 -50
- package/src/cli/commands/secrets/list.ts +0 -66
- package/src/cli/commands/secrets/remove.ts +0 -36
- package/src/cli/commands/secrets/secrets.ts +0 -17
- package/src/cli/commands/secrets/set.ts +0 -59
- package/src/cli/commands/start.tsx +0 -162
- package/src/cli/commands/update.ts +0 -100
- package/src/cli/program.ts +0 -22
- package/src/cli/spinner.ts +0 -14
- package/src/cli/sst.ts +0 -50
- package/src/cli/ui/deploy.tsx +0 -139
- package/src/config.ts +0 -226
- package/src/constructs/Api.ts +0 -1448
- package/src/constructs/ApiGatewayV1Api.ts +0 -1481
- package/src/constructs/App.ts +0 -744
- package/src/constructs/AppSyncApi.ts +0 -1045
- package/src/constructs/Auth.ts +0 -252
- package/src/constructs/BaseSite.ts +0 -146
- package/src/constructs/Bucket.ts +0 -670
- package/src/constructs/Cognito.ts +0 -708
- package/src/constructs/Config.ts +0 -4
- package/src/constructs/Construct.ts +0 -77
- package/src/constructs/Cron.ts +0 -235
- package/src/constructs/DebugApp.ts +0 -97
- package/src/constructs/DebugStack.ts +0 -182
- package/src/constructs/EdgeFunction.ts +0 -460
- package/src/constructs/EventBus.ts +0 -651
- package/src/constructs/Function.ts +0 -1329
- package/src/constructs/FunctionalStack.ts +0 -90
- package/src/constructs/GraphQLApi.ts +0 -140
- package/src/constructs/Job.ts +0 -557
- package/src/constructs/KinesisStream.ts +0 -388
- package/src/constructs/Metadata.ts +0 -75
- package/src/constructs/NextjsSite.ts +0 -1498
- package/src/constructs/Parameter.ts +0 -72
- package/src/constructs/Queue.ts +0 -360
- package/src/constructs/RDS.ts +0 -578
- package/src/constructs/ReactStaticSite.ts +0 -66
- package/src/constructs/RemixSite.ts +0 -1397
- package/src/constructs/Script/cfn-response.ts +0 -116
- package/src/constructs/Script/index.ts +0 -103
- package/src/constructs/Script/outbound.ts +0 -59
- package/src/constructs/Script/package.json +0 -3
- package/src/constructs/Script/util.ts +0 -19
- package/src/constructs/Script.ts +0 -270
- package/src/constructs/Secret.ts +0 -66
- package/src/constructs/Stack.ts +0 -319
- package/src/constructs/StaticSite.ts +0 -995
- package/src/constructs/Table.ts +0 -844
- package/src/constructs/Topic.ts +0 -486
- package/src/constructs/ViteStaticSite.ts +0 -99
- package/src/constructs/WebSocketApi.ts +0 -687
- package/src/constructs/context.ts +0 -12
- package/src/constructs/deferred_task.ts +0 -53
- package/src/constructs/descs.d.ts +0 -1
- package/src/constructs/index.ts +0 -39
- package/src/constructs/nextjs-site/cross-region-helper.ts +0 -189
- package/src/constructs/nextjs-site/custom-resource/cfn-response.ts +0 -146
- package/src/constructs/nextjs-site/custom-resource/edge-lambda-version.ts +0 -162
- package/src/constructs/nextjs-site/custom-resource/edge-lambda.ts +0 -167
- package/src/constructs/nextjs-site/custom-resource/s3-bucket.ts +0 -112
- package/src/constructs/nextjs-site/custom-resource/util.ts +0 -11
- package/src/constructs/util/apiGatewayV1AccessLog.ts +0 -106
- package/src/constructs/util/apiGatewayV2AccessLog.ts +0 -139
- package/src/constructs/util/apiGatewayV2Cors.ts +0 -94
- package/src/constructs/util/apiGatewayV2Domain.ts +0 -312
- package/src/constructs/util/appSyncApiDomain.ts +0 -204
- package/src/constructs/util/builder.ts +0 -17
- package/src/constructs/util/duration.ts +0 -27
- package/src/constructs/util/functionBinding.ts +0 -102
- package/src/constructs/util/functionUrlCors.ts +0 -96
- package/src/constructs/util/permission.ts +0 -299
- package/src/constructs/util/python/bundling.ts +0 -174
- package/src/constructs/util/size.ts +0 -13
- package/src/constructs/util/warning.ts +0 -20
- package/src/context/context.ts +0 -79
- package/src/context/handler.ts +0 -53
- package/src/context/index.ts +0 -2
- package/src/credentials.ts +0 -103
- package/src/error.ts +0 -5
- package/src/iot.ts +0 -105
- package/src/logger.ts +0 -35
- package/src/runtime/handlers.ts +0 -121
- package/src/runtime/iot.ts +0 -16
- package/src/runtime/node.ts +0 -111
- package/src/runtime/runtime.ts +0 -27
- package/src/runtime/server.ts +0 -149
- package/src/runtime/workers.ts +0 -96
- package/src/stacks/build.ts +0 -69
- package/src/stacks/deploy.ts +0 -232
- package/src/stacks/index.ts +0 -73
- package/src/stacks/metadata.ts +0 -125
- package/src/watcher.ts +0 -47
- package/sst.config.mjs +0 -6
- package/support/bridge/bridge.ts +0 -136
- package/support/bridge/build.mjs +0 -18
- package/support/custom-resources/auth-keys.ts +0 -113
- package/support/custom-resources/build.mjs +0 -18
- package/support/custom-resources/cfn-response.ts +0 -151
- package/support/custom-resources/index.ts +0 -18
- package/support/custom-resources/secrets-migration.ts +0 -82
- package/support/custom-resources/stack-metadata.ts +0 -75
- package/support/custom-resources/util.ts +0 -44
- package/support/nodejs-runtime/index.ts +0 -69
- package/support/tsconfig.json +0 -11
- package/tsconfig.json +0 -13
- package/yarn-error.log +0 -75
|
@@ -21,6 +21,13 @@ import { Function as Func, } from "./Function.js";
|
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
23
|
export class Cron extends Construct {
|
|
24
|
+
id;
|
|
25
|
+
cdk;
|
|
26
|
+
/**
|
|
27
|
+
* The internally created Function instance that'll be run on schedule.
|
|
28
|
+
*/
|
|
29
|
+
jobFunction;
|
|
30
|
+
props;
|
|
24
31
|
constructor(scope, id, props) {
|
|
25
32
|
super(scope, props.cdk?.id || id);
|
|
26
33
|
this.id = id;
|
|
@@ -26,11 +26,11 @@ export declare class DebugApp extends App {
|
|
|
26
26
|
*/
|
|
27
27
|
readonly name: string;
|
|
28
28
|
/**
|
|
29
|
-
* The stage the app is being deployed to. If this is not specified as the [`--stage`](/packages/
|
|
29
|
+
* The stage the app is being deployed to. If this is not specified as the [`--stage`](/packages/sst.md#--stage) option, it'll default to the stage configured during the initial run of the SST CLI.
|
|
30
30
|
*/
|
|
31
31
|
readonly stage: string;
|
|
32
32
|
/**
|
|
33
|
-
* The region the app is being deployed to. If this is not specified as the [`--region`](/packages/
|
|
33
|
+
* The region the app is being deployed to. If this is not specified as the [`--region`](/packages/sst.md#--region) option in the SST CLI, it'll default to the `region` in your `sst.json`.
|
|
34
34
|
*/
|
|
35
35
|
readonly region: string;
|
|
36
36
|
/**
|
|
@@ -4,6 +4,22 @@ import { isStackConstruct, isSSTDebugStack } from "./Construct.js";
|
|
|
4
4
|
* The DebugApp construct is used internally by SST to create the resources needed to power Live Lambda Development.
|
|
5
5
|
*/
|
|
6
6
|
export class DebugApp extends App {
|
|
7
|
+
/**
|
|
8
|
+
* The name of the app. This comes from the `name` in your `sst.json`.
|
|
9
|
+
*/
|
|
10
|
+
name;
|
|
11
|
+
/**
|
|
12
|
+
* The stage the app is being deployed to. If this is not specified as the [`--stage`](/packages/sst.md#--stage) option, it'll default to the stage configured during the initial run of the SST CLI.
|
|
13
|
+
*/
|
|
14
|
+
stage;
|
|
15
|
+
/**
|
|
16
|
+
* The region the app is being deployed to. If this is not specified as the [`--region`](/packages/sst.md#--region) option in the SST CLI, it'll default to the `region` in your `sst.json`.
|
|
17
|
+
*/
|
|
18
|
+
region;
|
|
19
|
+
/**
|
|
20
|
+
* The AWS account the app is being deployed to. This comes from the IAM credentials being used to run the SST CLI.
|
|
21
|
+
*/
|
|
22
|
+
account;
|
|
7
23
|
/**
|
|
8
24
|
* @internal
|
|
9
25
|
*/
|
|
File without changes
|
|
@@ -12,6 +12,10 @@ const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
|
|
12
12
|
* The `DebugStack` construct is used internally to create the resources needed to power Live Lambda Development. Note that, the `DebugStack` construct should only be created inside the [`DebugApp`](DebugApp).
|
|
13
13
|
*/
|
|
14
14
|
export class DebugStack extends cdk.Stack {
|
|
15
|
+
stage;
|
|
16
|
+
api;
|
|
17
|
+
table;
|
|
18
|
+
bucket;
|
|
15
19
|
constructor(scope, id, props) {
|
|
16
20
|
const app = scope.node.root;
|
|
17
21
|
const stackId = app.logicalPrefixedName(id);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import fs from "fs";
|
|
1
2
|
import url from "url";
|
|
2
3
|
import path from "path";
|
|
3
|
-
import fs from "fs-extra";
|
|
4
4
|
import crypto from "crypto";
|
|
5
5
|
import { Construct } from "constructs";
|
|
6
6
|
import * as iam from "aws-cdk-lib/aws-iam";
|
|
@@ -15,12 +15,17 @@ const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
|
|
15
15
|
// Construct
|
|
16
16
|
/////////////////////
|
|
17
17
|
export class EdgeFunction extends Construct {
|
|
18
|
+
role;
|
|
19
|
+
functionArn;
|
|
20
|
+
scope;
|
|
21
|
+
versionId;
|
|
22
|
+
props;
|
|
18
23
|
constructor(scope, id, props) {
|
|
19
24
|
super(scope, id);
|
|
20
25
|
this.props = props;
|
|
21
|
-
const {
|
|
26
|
+
const { format, scopeOverride } = props;
|
|
22
27
|
// Correct scope
|
|
23
|
-
this.scope =
|
|
28
|
+
this.scope = scopeOverride || this;
|
|
24
29
|
// Wrap function code
|
|
25
30
|
this.wrapFunctionCode();
|
|
26
31
|
// Create function asset
|
|
@@ -39,15 +44,19 @@ export class EdgeFunction extends Construct {
|
|
|
39
44
|
attachPermissionsToRole(this.role, permissions);
|
|
40
45
|
}
|
|
41
46
|
wrapFunctionCode() {
|
|
47
|
+
const { bundlePath, format } = this.props;
|
|
42
48
|
// Parse handler
|
|
43
49
|
const parts = this.props.handler.split(".");
|
|
44
50
|
const handlerImportPath = parts.slice(0, -1).join(".");
|
|
45
51
|
const handlerMethod = parts.slice(-1)[0];
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const index = require("./${handlerImportPath}")
|
|
50
|
-
|
|
52
|
+
const handlerExt = [".js", ".jsx", ".mjs", ".cjs"].find((ext) => fs.existsSync(path.join(bundlePath, handlerImportPath + ext)));
|
|
53
|
+
const imports = this.props.format === "esm"
|
|
54
|
+
? `import * as index from "./${handlerImportPath}${handlerExt}";`
|
|
55
|
+
: `"use strict"; const index = require("./${handlerImportPath}");`;
|
|
56
|
+
const exports = this.props.format === "esm"
|
|
57
|
+
? `export { handler };`
|
|
58
|
+
: `exports.handler = handler;`;
|
|
59
|
+
const content = `${imports}
|
|
51
60
|
const handler = async (event) => {
|
|
52
61
|
try {
|
|
53
62
|
// We expose an environment variable token which is used by the code
|
|
@@ -72,10 +81,9 @@ const handler = async (event) => {
|
|
|
72
81
|
return await index.${handlerMethod}(event);
|
|
73
82
|
};
|
|
74
83
|
|
|
75
|
-
exports
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
fs.writeFileSync(path.join(bundlePath, "index-wrapper.js"), content);
|
|
84
|
+
${exports}
|
|
85
|
+
`;
|
|
86
|
+
fs.writeFileSync(path.join(bundlePath, `index-wrapper.${format === "esm" ? "mjs" : "cjs"}`), content);
|
|
79
87
|
}
|
|
80
88
|
createAsset() {
|
|
81
89
|
const { bundlePath } = this.props;
|
|
@@ -113,7 +121,7 @@ exports.handler = handler;
|
|
|
113
121
|
S3Bucket: asset.s3BucketName,
|
|
114
122
|
S3Key: asset.s3ObjectKey,
|
|
115
123
|
},
|
|
116
|
-
Runtime: lambda.Runtime.
|
|
124
|
+
Runtime: lambda.Runtime.NODEJS_18_X.name,
|
|
117
125
|
MemorySize: memory || 512,
|
|
118
126
|
Timeout: Duration.seconds(timeout || 10).toSeconds(),
|
|
119
127
|
Role: this.role.roleArn,
|
|
@@ -143,6 +151,7 @@ exports.handler = handler;
|
|
|
143
151
|
// Note: Source code for the Lambda functions have "{{ ENV_KEY }}" in them.
|
|
144
152
|
// They need to be replaced with real values before the Lambda
|
|
145
153
|
// functions get deployed.
|
|
154
|
+
const { format } = this.props;
|
|
146
155
|
const providerId = "LambdaCodeReplacerProvider";
|
|
147
156
|
const resId = `${name}LambdaCodeReplacer`;
|
|
148
157
|
const stack = Stack.of(this);
|
|
@@ -150,11 +159,7 @@ exports.handler = handler;
|
|
|
150
159
|
// Create provider if not already created
|
|
151
160
|
if (!provider) {
|
|
152
161
|
provider = new lambda.Function(stack, providerId, {
|
|
153
|
-
code: lambda.Code.fromAsset(
|
|
154
|
-
// TODO: Move this file into a shared folder
|
|
155
|
-
// This references a Nextjs directory, but the underlying
|
|
156
|
-
// code appears to be generic enough to utilise in this case.
|
|
157
|
-
path.join(__dirname, "../assets/NextjsSite/custom-resource")),
|
|
162
|
+
code: lambda.Code.fromAsset(path.join(__dirname, "../support/edge-function-code-replacer")),
|
|
158
163
|
layers: [this.createSingletonAwsCliLayer()],
|
|
159
164
|
runtime: lambda.Runtime.PYTHON_3_7,
|
|
160
165
|
handler: "lambda-code-updater.handler",
|
|
@@ -178,7 +183,7 @@ exports.handler = handler;
|
|
|
178
183
|
ObjectKey: asset.s3ObjectKey,
|
|
179
184
|
},
|
|
180
185
|
ReplaceValues: [{
|
|
181
|
-
files:
|
|
186
|
+
files: `index-wrapper.${format === "esm" ? "mjs" : "cjs"}`,
|
|
182
187
|
search: '"{{ _SST_EDGE_FUNCTION_ENVIRONMENT_ }}"',
|
|
183
188
|
replace: JSON.stringify(this.props.environment || {}),
|
|
184
189
|
}],
|
|
@@ -197,7 +202,7 @@ exports.handler = handler;
|
|
|
197
202
|
}
|
|
198
203
|
// Create provider
|
|
199
204
|
const provider = new lambda.Function(stack, providerId, {
|
|
200
|
-
code: lambda.Code.fromAsset(path.join(__dirname, "
|
|
205
|
+
code: lambda.Code.fromAsset(path.join(__dirname, "../support/edge-function")),
|
|
201
206
|
handler: "s3-bucket.handler",
|
|
202
207
|
runtime: lambda.Runtime.NODEJS_16_X,
|
|
203
208
|
timeout: Duration.minutes(15),
|
|
@@ -229,7 +234,7 @@ exports.handler = handler;
|
|
|
229
234
|
// Create provider if not already created
|
|
230
235
|
if (!provider) {
|
|
231
236
|
provider = new lambda.Function(stack, providerId, {
|
|
232
|
-
code: lambda.Code.fromAsset(path.join(__dirname, "
|
|
237
|
+
code: lambda.Code.fromAsset(path.join(__dirname, "../support/edge-function")),
|
|
233
238
|
handler: "edge-lambda.handler",
|
|
234
239
|
runtime: lambda.Runtime.NODEJS_16_X,
|
|
235
240
|
timeout: Duration.minutes(15),
|
|
@@ -267,7 +272,7 @@ exports.handler = handler;
|
|
|
267
272
|
// Create provider if not already created
|
|
268
273
|
if (!provider) {
|
|
269
274
|
provider = new lambda.Function(stack, providerId, {
|
|
270
|
-
code: lambda.Code.fromAsset(path.join(__dirname, "
|
|
275
|
+
code: lambda.Code.fromAsset(path.join(__dirname, "../support/edge-function")),
|
|
271
276
|
handler: "edge-lambda-version.handler",
|
|
272
277
|
runtime: lambda.Runtime.NODEJS_16_X,
|
|
273
278
|
timeout: Duration.minutes(15),
|
|
File without changes
|
|
@@ -29,12 +29,15 @@ import { Function as Fn, } from "./Function.js";
|
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
31
|
export class EventBus extends Construct {
|
|
32
|
+
id;
|
|
33
|
+
cdk;
|
|
34
|
+
rulesData = {};
|
|
35
|
+
targetsData = {};
|
|
36
|
+
bindingForAllTargets = [];
|
|
37
|
+
permissionsAttachedForAllTargets = [];
|
|
38
|
+
props;
|
|
32
39
|
constructor(scope, id, props) {
|
|
33
40
|
super(scope, props?.cdk?.id || id);
|
|
34
|
-
this.rulesData = {};
|
|
35
|
-
this.targetsData = {};
|
|
36
|
-
this.bindingForAllTargets = [];
|
|
37
|
-
this.permissionsAttachedForAllTargets = [];
|
|
38
41
|
this.id = id;
|
|
39
42
|
this.props = props || {};
|
|
40
43
|
this.cdk = {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { Loader } from "esbuild";
|
|
1
|
+
import type { Loader, BuildOptions } from "esbuild";
|
|
2
2
|
import { Construct } from "constructs";
|
|
3
3
|
import * as cdk from "aws-cdk-lib";
|
|
4
4
|
import * as lambda from "aws-cdk-lib/aws-lambda";
|
|
5
|
-
import * as lambdaNode from "aws-cdk-lib/aws-lambda-nodejs";
|
|
6
5
|
import * as logs from "aws-cdk-lib/aws-logs";
|
|
7
6
|
import { Stack } from "./Stack.js";
|
|
8
7
|
import { Secret, Parameter } from "./Config.js";
|
|
@@ -20,6 +19,7 @@ declare const supportedRuntimes: {
|
|
|
20
19
|
"nodejs12.x": cdk.aws_lambda.Runtime;
|
|
21
20
|
"nodejs14.x": cdk.aws_lambda.Runtime;
|
|
22
21
|
"nodejs16.x": cdk.aws_lambda.Runtime;
|
|
22
|
+
"nodejs18.x": cdk.aws_lambda.Runtime;
|
|
23
23
|
"python2.7": cdk.aws_lambda.Runtime;
|
|
24
24
|
"python3.6": cdk.aws_lambda.Runtime;
|
|
25
25
|
"python3.7": cdk.aws_lambda.Runtime;
|
|
@@ -39,7 +39,40 @@ export declare type FunctionInlineDefinition = string | Function;
|
|
|
39
39
|
export declare type FunctionDefinition = string | Function | FunctionProps;
|
|
40
40
|
export interface FunctionUrlCorsProps extends functionUrlCors.CorsProps {
|
|
41
41
|
}
|
|
42
|
+
export interface FunctionHooks {
|
|
43
|
+
/**
|
|
44
|
+
* Hook to run before build
|
|
45
|
+
*/
|
|
46
|
+
beforeBuild?: (props: FunctionProps, out: string) => Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Hook to run after build
|
|
49
|
+
*/
|
|
50
|
+
afterBuild?: (props: FunctionProps, out: string) => Promise<void>;
|
|
51
|
+
}
|
|
42
52
|
export interface FunctionProps extends Omit<lambda.FunctionOptions, "functionName" | "memorySize" | "timeout" | "runtime" | "tracing" | "layers" | "architecture" | "logRetention"> {
|
|
53
|
+
/**
|
|
54
|
+
* Used to configure additional files to copy into the function bundle
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```js
|
|
58
|
+
* new Function(stack, "Function", {
|
|
59
|
+
* copyFiles: [{ from: "src/index.js" }]
|
|
60
|
+
* })
|
|
61
|
+
*```
|
|
62
|
+
*/
|
|
63
|
+
copyFiles?: FunctionBundleCopyFilesProps[];
|
|
64
|
+
/**
|
|
65
|
+
* Used to configure nodejs function properties
|
|
66
|
+
*/
|
|
67
|
+
nodejs?: NodeJSProps;
|
|
68
|
+
/**
|
|
69
|
+
* Used to configure java function properties
|
|
70
|
+
*/
|
|
71
|
+
java?: JavaProps;
|
|
72
|
+
/**
|
|
73
|
+
* Hooks to run before and after function builds
|
|
74
|
+
*/
|
|
75
|
+
hooks?: FunctionHooks;
|
|
43
76
|
/**
|
|
44
77
|
* The CPU architecture of the lambda function.
|
|
45
78
|
*
|
|
@@ -92,20 +125,6 @@ export interface FunctionProps extends Omit<lambda.FunctionOptions, "functionNam
|
|
|
92
125
|
* })
|
|
93
126
|
*```
|
|
94
127
|
*/
|
|
95
|
-
srcPath?: string;
|
|
96
|
-
/**
|
|
97
|
-
* The runtime environment. Only runtimes of the Node.js, Python, Go, and .NET (C# and F#) family are supported.
|
|
98
|
-
*
|
|
99
|
-
* @default "nodejs14.x"
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
* ```js
|
|
103
|
-
* new Function(stack, "Function", {
|
|
104
|
-
* handler: "src/function.handler",
|
|
105
|
-
* runtime: "nodejs16.x",
|
|
106
|
-
* })
|
|
107
|
-
*```
|
|
108
|
-
*/
|
|
109
128
|
runtime?: Runtime;
|
|
110
129
|
/**
|
|
111
130
|
* The amount of disk storage in MB allocated.
|
|
@@ -191,20 +210,6 @@ export interface FunctionProps extends Omit<lambda.FunctionOptions, "functionNam
|
|
|
191
210
|
* ```
|
|
192
211
|
*/
|
|
193
212
|
environment?: Record<string, string>;
|
|
194
|
-
/**
|
|
195
|
-
* Configure or disable bundling options
|
|
196
|
-
*
|
|
197
|
-
* @example
|
|
198
|
-
* ```js
|
|
199
|
-
* new Function(stack, "Function", {
|
|
200
|
-
* handler: "src/function.handler",
|
|
201
|
-
* bundle: {
|
|
202
|
-
* copyFiles: [{ from: "src/index.js" }]
|
|
203
|
-
* }
|
|
204
|
-
* })
|
|
205
|
-
*```
|
|
206
|
-
*/
|
|
207
|
-
bundle?: FunctionBundleProp;
|
|
208
213
|
/**
|
|
209
214
|
* Bind resources for the function
|
|
210
215
|
*
|
|
@@ -316,12 +321,6 @@ export interface FunctionNameProps {
|
|
|
316
321
|
*/
|
|
317
322
|
functionProps: FunctionProps;
|
|
318
323
|
}
|
|
319
|
-
export interface FunctionHandlerProps {
|
|
320
|
-
srcPath: string;
|
|
321
|
-
handler: string;
|
|
322
|
-
bundle: FunctionBundleProp;
|
|
323
|
-
runtime: string;
|
|
324
|
-
}
|
|
325
324
|
export interface FunctionUrlProps {
|
|
326
325
|
/**
|
|
327
326
|
* The authorizer for the function URL
|
|
@@ -364,36 +363,7 @@ export interface FunctionUrlProps {
|
|
|
364
363
|
*/
|
|
365
364
|
cors?: boolean | FunctionUrlCorsProps;
|
|
366
365
|
}
|
|
367
|
-
export
|
|
368
|
-
interface FunctionBundleBase {
|
|
369
|
-
/**
|
|
370
|
-
* Used to configure additional files to copy into the function bundle
|
|
371
|
-
*
|
|
372
|
-
* @example
|
|
373
|
-
* ```js
|
|
374
|
-
* new Function(stack, "Function", {
|
|
375
|
-
* bundle: {
|
|
376
|
-
* copyFiles: [{ from: "src/index.js" }]
|
|
377
|
-
* }
|
|
378
|
-
* })
|
|
379
|
-
*```
|
|
380
|
-
*/
|
|
381
|
-
copyFiles?: FunctionBundleCopyFilesProps[];
|
|
382
|
-
}
|
|
383
|
-
/**
|
|
384
|
-
* Used to configure NodeJS bundling options
|
|
385
|
-
*
|
|
386
|
-
* @example
|
|
387
|
-
* ```js
|
|
388
|
-
* new Function(stack, "Function", {
|
|
389
|
-
* bundle: {
|
|
390
|
-
* format: "esm",
|
|
391
|
-
* minify: false
|
|
392
|
-
* }
|
|
393
|
-
* })
|
|
394
|
-
* ```
|
|
395
|
-
*/
|
|
396
|
-
export interface FunctionBundleNodejsProps extends FunctionBundleBase {
|
|
366
|
+
export interface NodeJSProps {
|
|
397
367
|
/**
|
|
398
368
|
* Configure additional esbuild loaders for other file extensions
|
|
399
369
|
*
|
|
@@ -409,19 +379,6 @@ export interface FunctionBundleNodejsProps extends FunctionBundleBase {
|
|
|
409
379
|
* ```
|
|
410
380
|
*/
|
|
411
381
|
loader?: Record<string, Loader>;
|
|
412
|
-
/**
|
|
413
|
-
* Packages that will not be included in the bundle. Usually used to exclude dependencies that are provided in layers
|
|
414
|
-
*
|
|
415
|
-
* @example
|
|
416
|
-
* ```js
|
|
417
|
-
* new Function(stack, "Function", {
|
|
418
|
-
* bundle: {
|
|
419
|
-
* externalModules: ["prisma"]
|
|
420
|
-
* }
|
|
421
|
-
* })
|
|
422
|
-
* ```
|
|
423
|
-
*/
|
|
424
|
-
externalModules?: string[];
|
|
425
382
|
/**
|
|
426
383
|
* Packages that will be excluded from the bundle and installed into node_modules instead. Useful for dependencies that cannot be bundled, like those with binary dependencies.
|
|
427
384
|
*
|
|
@@ -434,7 +391,7 @@ export interface FunctionBundleNodejsProps extends FunctionBundleBase {
|
|
|
434
391
|
* })
|
|
435
392
|
* ```
|
|
436
393
|
*/
|
|
437
|
-
|
|
394
|
+
install?: string[];
|
|
438
395
|
/**
|
|
439
396
|
* Use this to insert an arbitrary string at the beginning of generated JavaScript and CSS files.
|
|
440
397
|
*
|
|
@@ -448,72 +405,10 @@ export interface FunctionBundleNodejsProps extends FunctionBundleBase {
|
|
|
448
405
|
* ```
|
|
449
406
|
*/
|
|
450
407
|
banner?: string;
|
|
451
|
-
/**
|
|
452
|
-
* Hooks to run at various stages of bundling
|
|
453
|
-
*/
|
|
454
|
-
commandHooks?: lambdaNode.ICommandHooks;
|
|
455
408
|
/**
|
|
456
409
|
* This allows you to customize esbuild config.
|
|
457
410
|
*/
|
|
458
|
-
|
|
459
|
-
/**
|
|
460
|
-
* Replace global identifiers with constant expressions.
|
|
461
|
-
*
|
|
462
|
-
* @example
|
|
463
|
-
* ```js
|
|
464
|
-
* new Function(stack, "Function", {
|
|
465
|
-
* bundle: {
|
|
466
|
-
* esbuildConfig: {
|
|
467
|
-
* define: {
|
|
468
|
-
* str: "text"
|
|
469
|
-
* }
|
|
470
|
-
* }
|
|
471
|
-
* }
|
|
472
|
-
* })
|
|
473
|
-
* ```
|
|
474
|
-
*/
|
|
475
|
-
define?: Record<string, string>;
|
|
476
|
-
/**
|
|
477
|
-
* When minifying preserve names of functions and variables
|
|
478
|
-
*
|
|
479
|
-
* @example
|
|
480
|
-
* ```js
|
|
481
|
-
* new Function(stack, "Function", {
|
|
482
|
-
* bundle: {
|
|
483
|
-
* esbuildConfig: {
|
|
484
|
-
* keepNames: true
|
|
485
|
-
* }
|
|
486
|
-
* }
|
|
487
|
-
* })
|
|
488
|
-
* ```
|
|
489
|
-
*/
|
|
490
|
-
keepNames?: boolean;
|
|
491
|
-
/**
|
|
492
|
-
* Path to a file that returns an array of esbuild plugins
|
|
493
|
-
*
|
|
494
|
-
* @example
|
|
495
|
-
* ```js
|
|
496
|
-
* new Function(stack, "Function", {
|
|
497
|
-
* bundle: {
|
|
498
|
-
* esbuildConfig: {
|
|
499
|
-
* plugins: "path/to/plugins.js"
|
|
500
|
-
* }
|
|
501
|
-
* }
|
|
502
|
-
* })
|
|
503
|
-
* ```
|
|
504
|
-
*
|
|
505
|
-
* Where `path/to/plugins.js` looks something like this:
|
|
506
|
-
*
|
|
507
|
-
* ```js
|
|
508
|
-
* const { esbuildDecorators } = require("@anatine/esbuild-decorators");
|
|
509
|
-
*
|
|
510
|
-
* module.exports = [
|
|
511
|
-
* esbuildDecorators(),
|
|
512
|
-
* ];
|
|
513
|
-
* ```
|
|
514
|
-
*/
|
|
515
|
-
plugins?: string;
|
|
516
|
-
};
|
|
411
|
+
esbuild?: BuildOptions;
|
|
517
412
|
/**
|
|
518
413
|
* Enable or disable minification
|
|
519
414
|
*
|
|
@@ -560,35 +455,10 @@ export interface FunctionBundleNodejsProps extends FunctionBundleBase {
|
|
|
560
455
|
*/
|
|
561
456
|
sourcemap?: boolean;
|
|
562
457
|
}
|
|
563
|
-
/**
|
|
564
|
-
* Used to configure Python bundling options
|
|
565
|
-
*/
|
|
566
|
-
export interface FunctionBundlePythonProps extends FunctionBundleBase {
|
|
567
|
-
/**
|
|
568
|
-
* A list of commands to override the [default installing behavior](Function#bundle) for Python dependencies.
|
|
569
|
-
*
|
|
570
|
-
* Each string in the array is a command that'll be run. For example:
|
|
571
|
-
*
|
|
572
|
-
* @default "[]"
|
|
573
|
-
*
|
|
574
|
-
* @example
|
|
575
|
-
* ```js
|
|
576
|
-
* new Function(stack, "Function", {
|
|
577
|
-
* bundle: {
|
|
578
|
-
* installCommands: [
|
|
579
|
-
* 'export VARNAME="my value"',
|
|
580
|
-
* 'pip install --index-url https://domain.com/pypi/myprivatemodule/simple/ --extra-index-url https://pypi.org/simple -r requirements.txt .',
|
|
581
|
-
* ]
|
|
582
|
-
* }
|
|
583
|
-
* })
|
|
584
|
-
* ```
|
|
585
|
-
*/
|
|
586
|
-
installCommands?: string[];
|
|
587
|
-
}
|
|
588
458
|
/**
|
|
589
459
|
* Used to configure Java package build options
|
|
590
460
|
*/
|
|
591
|
-
export interface
|
|
461
|
+
export interface JavaProps {
|
|
592
462
|
/**
|
|
593
463
|
* Gradle build command to generate the bundled .zip file.
|
|
594
464
|
*
|
|
@@ -635,6 +505,34 @@ export interface FunctionBundleJavaProps extends FunctionBundleBase {
|
|
|
635
505
|
*/
|
|
636
506
|
experimentalUseProvidedRuntime?: "provided" | "provided.al2";
|
|
637
507
|
}
|
|
508
|
+
export declare type FunctionBundleProp = FunctionBundlePythonProps | boolean;
|
|
509
|
+
interface FunctionBundleBase {
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Used to configure Python bundling options
|
|
513
|
+
*/
|
|
514
|
+
export interface FunctionBundlePythonProps extends FunctionBundleBase {
|
|
515
|
+
/**
|
|
516
|
+
* A list of commands to override the [default installing behavior](Function#bundle) for Python dependencies.
|
|
517
|
+
*
|
|
518
|
+
* Each string in the array is a command that'll be run. For example:
|
|
519
|
+
*
|
|
520
|
+
* @default "[]"
|
|
521
|
+
*
|
|
522
|
+
* @example
|
|
523
|
+
* ```js
|
|
524
|
+
* new Function(stack, "Function", {
|
|
525
|
+
* bundle: {
|
|
526
|
+
* installCommands: [
|
|
527
|
+
* 'export VARNAME="my value"',
|
|
528
|
+
* 'pip install --index-url https://domain.com/pypi/myprivatemodule/simple/ --extra-index-url https://pypi.org/simple -r requirements.txt .',
|
|
529
|
+
* ]
|
|
530
|
+
* }
|
|
531
|
+
* })
|
|
532
|
+
* ```
|
|
533
|
+
*/
|
|
534
|
+
installCommands?: string[];
|
|
535
|
+
}
|
|
638
536
|
/**
|
|
639
537
|
* Used to configure additional files to copy into the function bundle
|
|
640
538
|
*
|
|
@@ -675,7 +573,6 @@ export declare class Function extends lambda.Function implements SSTConstruct {
|
|
|
675
573
|
readonly _isLiveDevEnabled: boolean;
|
|
676
574
|
/** @internal */
|
|
677
575
|
_disableBind?: boolean;
|
|
678
|
-
private readonly localId;
|
|
679
576
|
private functionUrl?;
|
|
680
577
|
private props;
|
|
681
578
|
constructor(scope: Construct, id: string, props: FunctionProps);
|
|
@@ -722,10 +619,8 @@ export declare class Function extends lambda.Function implements SSTConstruct {
|
|
|
722
619
|
getConstructMetadata(): {
|
|
723
620
|
type: "Function";
|
|
724
621
|
data: {
|
|
725
|
-
localId: string;
|
|
726
|
-
srcPath: string | undefined;
|
|
727
|
-
handler: string | undefined;
|
|
728
622
|
arn: string;
|
|
623
|
+
localId: string;
|
|
729
624
|
secrets: string[];
|
|
730
625
|
};
|
|
731
626
|
};
|
|
@@ -749,10 +644,14 @@ export declare class Function extends lambda.Function implements SSTConstruct {
|
|
|
749
644
|
static normalizeTimeout(timeout?: number | Duration): cdk.Duration;
|
|
750
645
|
static normalizeRuntime(runtime?: Runtime): Runtime;
|
|
751
646
|
static normalizeSrcPath(srcPath: string): string;
|
|
752
|
-
static copyFiles(bundle: FunctionBundleProp | undefined, srcPath: string, buildPath: string): void;
|
|
753
647
|
static handleImportedLayer(scope: Construct, layer: lambda.ILayerVersion): lambda.ILayerVersion;
|
|
754
648
|
static isInlineDefinition(definition: any): definition is FunctionInlineDefinition;
|
|
755
649
|
static fromDefinition(scope: Construct, id: string, definition: FunctionDefinition, inheritedProps?: FunctionProps, inheritErrorMessage?: string): Function;
|
|
756
650
|
static mergeProps(baseProps?: FunctionProps, props?: FunctionProps): FunctionProps;
|
|
757
651
|
}
|
|
652
|
+
export declare const useFunctions: () => {
|
|
653
|
+
fromID(id: string): FunctionProps;
|
|
654
|
+
add(name: string, props: FunctionProps): void;
|
|
655
|
+
readonly all: Record<string, FunctionProps>;
|
|
656
|
+
};
|
|
758
657
|
export {};
|