@sst-community/sst 4.19.0 → 5.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -52
- package/package.json +35 -11
- package/platform/js/chunks/chunk-HIZZCEDS.js +328 -0
- package/platform/js/chunks/chunk-HIZZCEDS.js.map +6 -0
- package/platform/js/chunks/chunk-KOKHGKJ2.js +639 -0
- package/platform/js/chunks/chunk-KOKHGKJ2.js.map +6 -0
- package/platform/js/chunks/chunk-ONNI4XNK.js +367 -0
- package/platform/js/chunks/chunk-ONNI4XNK.js.map +6 -0
- package/platform/js/chunks/chunk-VIFHC73J.js +108 -0
- package/platform/js/chunks/chunk-VIFHC73J.js.map +6 -0
- package/platform/js/chunks/chunk-WJ6BVA46.js +10 -0
- package/platform/js/chunks/chunk-WJ6BVA46.js.map +6 -0
- package/platform/js/chunks/chunk-ZOXXXME5.js +472 -0
- package/platform/js/chunks/chunk-ZOXXXME5.js.map +6 -0
- package/platform/js/chunks/component-32FCLIRK.js +26 -0
- package/platform/js/chunks/component-32FCLIRK.js.map +6 -0
- package/platform/js/chunks/config-DMGMTLNB.js +10 -0
- package/platform/js/chunks/config-DMGMTLNB.js.map +6 -0
- package/platform/js/chunks/link-OJ3RNGQ3.js +9 -0
- package/platform/js/chunks/link-OJ3RNGQ3.js.map +6 -0
- package/platform/js/components/aws/index.js +35362 -0
- package/platform/js/components/aws/index.js.map +6 -0
- package/platform/js/components/cloudflare/index.js +3246 -0
- package/platform/js/components/cloudflare/index.js.map +6 -0
- package/platform/js/components/core.js +114 -0
- package/platform/js/components/core.js.map +6 -0
- package/platform/js/components/vercel/index.js +120 -0
- package/platform/js/components/vercel/index.js.map +6 -0
- package/platform/js/testing/index.js +569 -0
- package/platform/js/testing/index.js.map +6 -0
- package/platform/package.json +25 -0
- package/platform/src/ast/add.mjs +190 -0
- package/platform/src/auto/run.ts +109 -0
- package/platform/src/components/README.md +652 -0
- package/platform/src/components/args.ts +133 -0
- package/platform/src/components/aws/alb.ts +577 -0
- package/platform/src/components/aws/analog.ts +462 -0
- package/platform/src/components/aws/apigateway-websocket-route.ts +206 -0
- package/platform/src/components/aws/apigateway-websocket.ts +894 -0
- package/platform/src/components/aws/apigatewayv1-api-key.ts +90 -0
- package/platform/src/components/aws/apigatewayv1-authorizer.ts +178 -0
- package/platform/src/components/aws/apigatewayv1-base-route.ts +78 -0
- package/platform/src/components/aws/apigatewayv1-integration-route.ts +92 -0
- package/platform/src/components/aws/apigatewayv1-lambda-route.ts +152 -0
- package/platform/src/components/aws/apigatewayv1-usage-plan.ts +109 -0
- package/platform/src/components/aws/apigatewayv1.ts +1691 -0
- package/platform/src/components/aws/apigatewayv2-authorizer.ts +199 -0
- package/platform/src/components/aws/apigatewayv2-base-route.ts +69 -0
- package/platform/src/components/aws/apigatewayv2-lambda-route.ts +141 -0
- package/platform/src/components/aws/apigatewayv2-private-route.ts +101 -0
- package/platform/src/components/aws/apigatewayv2-url-route.ts +90 -0
- package/platform/src/components/aws/apigatewayv2.ts +1439 -0
- package/platform/src/components/aws/app-sync-data-source.ts +264 -0
- package/platform/src/components/aws/app-sync-function.ts +79 -0
- package/platform/src/components/aws/app-sync-resolver.ts +110 -0
- package/platform/src/components/aws/app-sync.ts +849 -0
- package/platform/src/components/aws/astro.ts +580 -0
- package/platform/src/components/aws/aurora.ts +1356 -0
- package/platform/src/components/aws/auth-v1.ts +69 -0
- package/platform/src/components/aws/auth.ts +417 -0
- package/platform/src/components/aws/bucket-lambda-subscriber.ts +162 -0
- package/platform/src/components/aws/bucket-notification.ts +254 -0
- package/platform/src/components/aws/bucket-queue-subscriber.ts +122 -0
- package/platform/src/components/aws/bucket-topic-subscriber.ts +144 -0
- package/platform/src/components/aws/bucket.ts +2046 -0
- package/platform/src/components/aws/bus-base-subscriber.ts +52 -0
- package/platform/src/components/aws/bus-lambda-subscriber.ts +125 -0
- package/platform/src/components/aws/bus-queue-subscriber.ts +88 -0
- package/platform/src/components/aws/bus.ts +630 -0
- package/platform/src/components/aws/cdn.ts +561 -0
- package/platform/src/components/aws/cluster-v1.ts +932 -0
- package/platform/src/components/aws/cluster.ts +584 -0
- package/platform/src/components/aws/cognito-identity-pool.ts +433 -0
- package/platform/src/components/aws/cognito-identity-provider.ts +96 -0
- package/platform/src/components/aws/cognito-user-pool-client.ts +114 -0
- package/platform/src/components/aws/cognito-user-pool.ts +1089 -0
- package/platform/src/components/aws/cron-v2.ts +555 -0
- package/platform/src/components/aws/cron.ts +435 -0
- package/platform/src/components/aws/dns-validated-certificate.ts +108 -0
- package/platform/src/components/aws/dns.ts +221 -0
- package/platform/src/components/aws/dsql.ts +741 -0
- package/platform/src/components/aws/dynamo-lambda-subscriber.ts +124 -0
- package/platform/src/components/aws/dynamo.ts +929 -0
- package/platform/src/components/aws/efs.ts +410 -0
- package/platform/src/components/aws/email.ts +673 -0
- package/platform/src/components/aws/fargate.ts +1279 -0
- package/platform/src/components/aws/function.ts +3227 -0
- package/platform/src/components/aws/helpers/apigateway-account.ts +78 -0
- package/platform/src/components/aws/helpers/apigatewayv2-domain.ts +144 -0
- package/platform/src/components/aws/helpers/arn.ts +182 -0
- package/platform/src/components/aws/helpers/bootstrap.ts +16 -0
- package/platform/src/components/aws/helpers/client.ts +76 -0
- package/platform/src/components/aws/helpers/container-builder.ts +33 -0
- package/platform/src/components/aws/helpers/custom-domain.ts +128 -0
- package/platform/src/components/aws/helpers/event-source.ts +41 -0
- package/platform/src/components/aws/helpers/fargate.ts +727 -0
- package/platform/src/components/aws/helpers/function-builder.ts +133 -0
- package/platform/src/components/aws/helpers/function-code.ts +224 -0
- package/platform/src/components/aws/helpers/function-part.ts +202 -0
- package/platform/src/components/aws/helpers/function-permission.ts +29 -0
- package/platform/src/components/aws/helpers/load-balancer-args.ts +88 -0
- package/platform/src/components/aws/helpers/load-balancer.ts +17 -0
- package/platform/src/components/aws/helpers/provider.ts +36 -0
- package/platform/src/components/aws/helpers/queue-policy.ts +33 -0
- package/platform/src/components/aws/helpers/rds.ts +212 -0
- package/platform/src/components/aws/helpers/site-builder.ts +41 -0
- package/platform/src/components/aws/helpers/subscriber.ts +23 -0
- package/platform/src/components/aws/helpers/vpc.ts +27 -0
- package/platform/src/components/aws/https-redirect.ts +216 -0
- package/platform/src/components/aws/iam-edit.ts +50 -0
- package/platform/src/components/aws/index.ts +61 -0
- package/platform/src/components/aws/kinesis-stream-lambda-subscriber.ts +122 -0
- package/platform/src/components/aws/kinesis-stream.ts +416 -0
- package/platform/src/components/aws/linkable.ts +32 -0
- package/platform/src/components/aws/logging.ts +25 -0
- package/platform/src/components/aws/microvm.ts +988 -0
- package/platform/src/components/aws/mysql.ts +1047 -0
- package/platform/src/components/aws/nextjs.ts +1052 -0
- package/platform/src/components/aws/nuxt.ts +527 -0
- package/platform/src/components/aws/open-search.ts +603 -0
- package/platform/src/components/aws/opencontrol.ts +235 -0
- package/platform/src/components/aws/permission.ts +80 -0
- package/platform/src/components/aws/postgres-v1.ts +537 -0
- package/platform/src/components/aws/postgres.ts +1074 -0
- package/platform/src/components/aws/providers/bucket-files.ts +32 -0
- package/platform/src/components/aws/providers/distribution-deployment-waiter.ts +27 -0
- package/platform/src/components/aws/providers/distribution-invalidation.ts +24 -0
- package/platform/src/components/aws/providers/function-environment-update.ts +46 -0
- package/platform/src/components/aws/providers/hosted-zone-lookup.ts +25 -0
- package/platform/src/components/aws/providers/kv-keys.ts +15 -0
- package/platform/src/components/aws/providers/kv-routes-update.ts +24 -0
- package/platform/src/components/aws/providers/microvm-image-prune.ts +48 -0
- package/platform/src/components/aws/providers/origin-access-control.ts +21 -0
- package/platform/src/components/aws/providers/rds-role-lookup.ts +21 -0
- package/platform/src/components/aws/providers/vector-table.ts +25 -0
- package/platform/src/components/aws/queue-lambda-subscriber.ts +135 -0
- package/platform/src/components/aws/queue.ts +712 -0
- package/platform/src/components/aws/react.ts +510 -0
- package/platform/src/components/aws/realtime-lambda-subscriber.ts +129 -0
- package/platform/src/components/aws/realtime.ts +345 -0
- package/platform/src/components/aws/redis-v1.ts +595 -0
- package/platform/src/components/aws/redis.ts +1078 -0
- package/platform/src/components/aws/remix.ts +576 -0
- package/platform/src/components/aws/router-base-route.ts +83 -0
- package/platform/src/components/aws/router-bucket-route.ts +63 -0
- package/platform/src/components/aws/router-url-route.ts +75 -0
- package/platform/src/components/aws/router.ts +3281 -0
- package/platform/src/components/aws/service-v1.ts +876 -0
- package/platform/src/components/aws/service.ts +2994 -0
- package/platform/src/components/aws/sns-topic-lambda-subscriber.ts +127 -0
- package/platform/src/components/aws/sns-topic-queue-subscriber.ts +105 -0
- package/platform/src/components/aws/sns-topic.ts +700 -0
- package/platform/src/components/aws/solid-start.ts +467 -0
- package/platform/src/components/aws/ssr-site.ts +2204 -0
- package/platform/src/components/aws/static-site.ts +1389 -0
- package/platform/src/components/aws/step-functions/choice.ts +123 -0
- package/platform/src/components/aws/step-functions/fail.ts +69 -0
- package/platform/src/components/aws/step-functions/map.ts +264 -0
- package/platform/src/components/aws/step-functions/parallel.ts +170 -0
- package/platform/src/components/aws/step-functions/pass.ts +48 -0
- package/platform/src/components/aws/step-functions/state.ts +376 -0
- package/platform/src/components/aws/step-functions/succeed.ts +31 -0
- package/platform/src/components/aws/step-functions/task.ts +538 -0
- package/platform/src/components/aws/step-functions/wait.ts +105 -0
- package/platform/src/components/aws/step-functions.ts +804 -0
- package/platform/src/components/aws/svelte-kit.ts +563 -0
- package/platform/src/components/aws/takeover/alb.ts +9 -0
- package/platform/src/components/aws/takeover/apigatewayv2.ts +43 -0
- package/platform/src/components/aws/takeover/app-sync.ts +45 -0
- package/platform/src/components/aws/takeover/aurora.ts +19 -0
- package/platform/src/components/aws/takeover/bucket.ts +94 -0
- package/platform/src/components/aws/takeover/bus.ts +43 -0
- package/platform/src/components/aws/takeover/cognito-user-pool.ts +21 -0
- package/platform/src/components/aws/takeover/cron-v2.ts +9 -0
- package/platform/src/components/aws/takeover/dsql.ts +12 -0
- package/platform/src/components/aws/takeover/dynamo.ts +31 -0
- package/platform/src/components/aws/takeover/efs.ts +9 -0
- package/platform/src/components/aws/takeover/function.ts +21 -0
- package/platform/src/components/aws/takeover/helpers.ts +26 -0
- package/platform/src/components/aws/takeover/index.ts +27 -0
- package/platform/src/components/aws/takeover/mysql.ts +17 -0
- package/platform/src/components/aws/takeover/postgres.ts +17 -0
- package/platform/src/components/aws/takeover/queue.ts +21 -0
- package/platform/src/components/aws/takeover/redis.ts +10 -0
- package/platform/src/components/aws/takeover/service.ts +22 -0
- package/platform/src/components/aws/takeover/sns-topic.ts +27 -0
- package/platform/src/components/aws/takeover/task.ts +13 -0
- package/platform/src/components/aws/tan-stack-start.ts +479 -0
- package/platform/src/components/aws/task.ts +571 -0
- package/platform/src/components/aws/v5/alb.ts +310 -0
- package/platform/src/components/aws/v5/apigatewayv2.ts +845 -0
- package/platform/src/components/aws/v5/app-sync.ts +673 -0
- package/platform/src/components/aws/v5/aurora.ts +855 -0
- package/platform/src/components/aws/v5/bucket.ts +1001 -0
- package/platform/src/components/aws/v5/bus.ts +321 -0
- package/platform/src/components/aws/v5/cluster.ts +230 -0
- package/platform/src/components/aws/v5/cognito-user-pool-client.ts +100 -0
- package/platform/src/components/aws/v5/cognito-user-pool.ts +693 -0
- package/platform/src/components/aws/v5/cron-v2.ts +316 -0
- package/platform/src/components/aws/v5/dsql.ts +665 -0
- package/platform/src/components/aws/v5/dynamo.ts +477 -0
- package/platform/src/components/aws/v5/efs.ts +311 -0
- package/platform/src/components/aws/v5/function.ts +1527 -0
- package/platform/src/components/aws/v5/index.ts +26 -0
- package/platform/src/components/aws/v5/mysql.ts +604 -0
- package/platform/src/components/aws/v5/postgres.ts +612 -0
- package/platform/src/components/aws/v5/queue.ts +271 -0
- package/platform/src/components/aws/v5/redis.ts +550 -0
- package/platform/src/components/aws/v5/service.ts +2209 -0
- package/platform/src/components/aws/v5/sns-topic.ts +284 -0
- package/platform/src/components/aws/v5/task.ts +549 -0
- package/platform/src/components/aws/vector.ts +316 -0
- package/platform/src/components/aws/vpc-v1.ts +580 -0
- package/platform/src/components/aws/vpc.ts +1641 -0
- package/platform/src/components/aws/workflow.ts +421 -0
- package/platform/src/components/base/base-site.ts +101 -0
- package/platform/src/components/base/base-ssr-site.ts +120 -0
- package/platform/src/components/base/base-static-site.ts +314 -0
- package/platform/src/components/cloudflare/account-id.ts +1 -0
- package/platform/src/components/cloudflare/ai.ts +77 -0
- package/platform/src/components/cloudflare/astro.ts +355 -0
- package/platform/src/components/cloudflare/auth.ts +69 -0
- package/platform/src/components/cloudflare/binding.ts +132 -0
- package/platform/src/components/cloudflare/bucket.ts +142 -0
- package/platform/src/components/cloudflare/cron.ts +207 -0
- package/platform/src/components/cloudflare/d1.ts +230 -0
- package/platform/src/components/cloudflare/dns.ts +253 -0
- package/platform/src/components/cloudflare/durable-object.ts +144 -0
- package/platform/src/components/cloudflare/experimental/index.ts +3 -0
- package/platform/src/components/cloudflare/experimental/solid-start.ts +288 -0
- package/platform/src/components/cloudflare/experimental/static-site.ts +4 -0
- package/platform/src/components/cloudflare/helpers/compatibility.ts +44 -0
- package/platform/src/components/cloudflare/helpers/fetch.ts +81 -0
- package/platform/src/components/cloudflare/helpers/validation.ts +74 -0
- package/platform/src/components/cloudflare/helpers/worker-builder.ts +57 -0
- package/platform/src/components/cloudflare/helpers/wrangler.ts +222 -0
- package/platform/src/components/cloudflare/hyperdrive.ts +402 -0
- package/platform/src/components/cloudflare/index.ts +25 -0
- package/platform/src/components/cloudflare/kv.ts +218 -0
- package/platform/src/components/cloudflare/providers/dns-record.ts +43 -0
- package/platform/src/components/cloudflare/providers/kv-data.ts +107 -0
- package/platform/src/components/cloudflare/providers/worker-assets.ts +41 -0
- package/platform/src/components/cloudflare/providers/worker-placement.ts +93 -0
- package/platform/src/components/cloudflare/providers/worker-script.ts +47 -0
- package/platform/src/components/cloudflare/providers/worker-url.ts +109 -0
- package/platform/src/components/cloudflare/providers/zone-lookup.ts +85 -0
- package/platform/src/components/cloudflare/queue-worker-subscriber.ts +192 -0
- package/platform/src/components/cloudflare/queue.ts +310 -0
- package/platform/src/components/cloudflare/rate-limit.ts +178 -0
- package/platform/src/components/cloudflare/react-router.ts +322 -0
- package/platform/src/components/cloudflare/ssr-site.ts +293 -0
- package/platform/src/components/cloudflare/static-site-v2.ts +428 -0
- package/platform/src/components/cloudflare/static-site.ts +470 -0
- package/platform/src/components/cloudflare/tan-stack-start.ts +408 -0
- package/platform/src/components/cloudflare/worker.ts +1080 -0
- package/platform/src/components/cloudflare/workflow.ts +319 -0
- package/platform/src/components/component.ts +242 -0
- package/platform/src/components/core.ts +43 -0
- package/platform/src/components/cpu.ts +10 -0
- package/platform/src/components/dns.ts +82 -0
- package/platform/src/components/duration.ts +67 -0
- package/platform/src/components/error.ts +5 -0
- package/platform/src/components/esbuild.ts +15 -0
- package/platform/src/components/experimental/dev-command.ts +127 -0
- package/platform/src/components/experimental/index.ts +1 -0
- package/platform/src/components/groups.ts +9 -0
- package/platform/src/components/index.ts +9 -0
- package/platform/src/components/input.ts +2 -0
- package/platform/src/components/link.ts +201 -0
- package/platform/src/components/linkable.ts +360 -0
- package/platform/src/components/naming-rules.ts +299 -0
- package/platform/src/components/naming.ts +189 -0
- package/platform/src/components/parts-component.ts +662 -0
- package/platform/src/components/parts.ts +299 -0
- package/platform/src/components/path.ts +5 -0
- package/platform/src/components/rpc/rpc.ts +110 -0
- package/platform/src/components/secret.ts +159 -0
- package/platform/src/components/size.ts +28 -0
- package/platform/src/components/takeover.ts +131 -0
- package/platform/src/components/transform.ts +107 -0
- package/platform/src/components/vercel/account-id.ts +1 -0
- package/platform/src/components/vercel/dns.ts +171 -0
- package/platform/src/components/vercel/index.ts +2 -0
- package/platform/src/components/vercel/providers/dns-record.ts +34 -0
- package/platform/src/config.ts +1460 -0
- package/platform/src/global-aliases.d.ts +37 -0
- package/platform/src/global.d.ts +374 -0
- package/platform/src/internal.d.ts +18 -0
- package/platform/src/runtime/worker/unenv.d.ts +14 -0
- package/platform/src/runtime/worker/unenv.mjs +26 -0
- package/platform/src/shim/run.js +25 -0
- package/platform/src/testing/global.ts +83 -0
- package/platform/src/testing/index.ts +103 -0
- package/platform/src/testing/mock.ts +646 -0
- package/platform/src/testing/vitest.ts +36 -0
- package/platform/src/util/compare-semver.ts +23 -0
- package/platform/src/util/fs.ts +49 -0
- package/platform/src/util/lazy.ts +12 -0
- package/platform/src/util/minify.ts +10 -0
- package/platform/src/util/package.ts +29 -0
- package/platform/src/util/semaphore.ts +29 -0
- package/platform/src/util/warn.ts +7 -0
- package/platform/types/auto/run.d.ts +9 -0
- package/platform/types/auto/run.d.ts.map +1 -0
- package/platform/types/components/args.d.ts +77 -0
- package/platform/types/components/args.d.ts.map +1 -0
- package/platform/types/components/aws/alb.d.ts +283 -0
- package/platform/types/components/aws/alb.d.ts.map +1 -0
- package/platform/types/components/aws/analog.d.ts +408 -0
- package/platform/types/components/aws/analog.d.ts.map +1 -0
- package/platform/types/components/aws/apigateway-websocket-route.d.ts +74 -0
- package/platform/types/components/aws/apigateway-websocket-route.d.ts.map +1 -0
- package/platform/types/components/aws/apigateway-websocket.d.ts +560 -0
- package/platform/types/components/aws/apigateway-websocket.d.ts.map +1 -0
- package/platform/types/components/aws/apigatewayv1-api-key.d.ts +48 -0
- package/platform/types/components/aws/apigatewayv1-api-key.d.ts.map +1 -0
- package/platform/types/components/aws/apigatewayv1-authorizer.d.ts +55 -0
- package/platform/types/components/aws/apigatewayv1-authorizer.d.ts.map +1 -0
- package/platform/types/components/aws/apigatewayv1-base-route.d.ts +36 -0
- package/platform/types/components/aws/apigatewayv1-base-route.d.ts.map +1 -0
- package/platform/types/components/aws/apigatewayv1-integration-route.d.ts +39 -0
- package/platform/types/components/aws/apigatewayv1-integration-route.d.ts.map +1 -0
- package/platform/types/components/aws/apigatewayv1-lambda-route.d.ts +53 -0
- package/platform/types/components/aws/apigatewayv1-lambda-route.d.ts.map +1 -0
- package/platform/types/components/aws/apigatewayv1-usage-plan.d.ts +53 -0
- package/platform/types/components/aws/apigatewayv1-usage-plan.d.ts.map +1 -0
- package/platform/types/components/aws/apigatewayv1.d.ts +1028 -0
- package/platform/types/components/aws/apigatewayv1.d.ts.map +1 -0
- package/platform/types/components/aws/apigatewayv2-authorizer.d.ts +54 -0
- package/platform/types/components/aws/apigatewayv2-authorizer.d.ts.map +1 -0
- package/platform/types/components/aws/apigatewayv2-base-route.d.ts +28 -0
- package/platform/types/components/aws/apigatewayv2-base-route.d.ts.map +1 -0
- package/platform/types/components/aws/apigatewayv2-lambda-route.d.ts +59 -0
- package/platform/types/components/aws/apigatewayv2-lambda-route.d.ts.map +1 -0
- package/platform/types/components/aws/apigatewayv2-private-route.d.ts +54 -0
- package/platform/types/components/aws/apigatewayv2-private-route.d.ts.map +1 -0
- package/platform/types/components/aws/apigatewayv2-url-route.d.ts +44 -0
- package/platform/types/components/aws/apigatewayv2-url-route.d.ts.map +1 -0
- package/platform/types/components/aws/apigatewayv2.d.ts +955 -0
- package/platform/types/components/aws/apigatewayv2.d.ts.map +1 -0
- package/platform/types/components/aws/app-sync-data-source.d.ts +52 -0
- package/platform/types/components/aws/app-sync-data-source.d.ts.map +1 -0
- package/platform/types/components/aws/app-sync-function.d.ts +33 -0
- package/platform/types/components/aws/app-sync-function.d.ts.map +1 -0
- package/platform/types/components/aws/app-sync-resolver.d.ts +41 -0
- package/platform/types/components/aws/app-sync-resolver.d.ts.map +1 -0
- package/platform/types/components/aws/app-sync.d.ts +638 -0
- package/platform/types/components/aws/app-sync.d.ts.map +1 -0
- package/platform/types/components/aws/astro.d.ts +409 -0
- package/platform/types/components/aws/astro.d.ts.map +1 -0
- package/platform/types/components/aws/aurora.d.ts +720 -0
- package/platform/types/components/aws/aurora.d.ts.map +1 -0
- package/platform/types/components/aws/auth-v1.d.ts +26 -0
- package/platform/types/components/aws/auth-v1.d.ts.map +1 -0
- package/platform/types/components/aws/auth.d.ts +295 -0
- package/platform/types/components/aws/auth.d.ts.map +1 -0
- package/platform/types/components/aws/bucket-lambda-subscriber.d.ts +61 -0
- package/platform/types/components/aws/bucket-lambda-subscriber.d.ts.map +1 -0
- package/platform/types/components/aws/bucket-notification.d.ts +47 -0
- package/platform/types/components/aws/bucket-notification.d.ts.map +1 -0
- package/platform/types/components/aws/bucket-queue-subscriber.d.ts +55 -0
- package/platform/types/components/aws/bucket-queue-subscriber.d.ts.map +1 -0
- package/platform/types/components/aws/bucket-topic-subscriber.d.ts +55 -0
- package/platform/types/components/aws/bucket-topic-subscriber.d.ts.map +1 -0
- package/platform/types/components/aws/bucket.d.ts +1356 -0
- package/platform/types/components/aws/bucket.d.ts.map +1 -0
- package/platform/types/components/aws/bus-base-subscriber.d.ts +20 -0
- package/platform/types/components/aws/bus-base-subscriber.d.ts.map +1 -0
- package/platform/types/components/aws/bus-lambda-subscriber.d.ts +50 -0
- package/platform/types/components/aws/bus-lambda-subscriber.d.ts.map +1 -0
- package/platform/types/components/aws/bus-queue-subscriber.d.ts +44 -0
- package/platform/types/components/aws/bus-queue-subscriber.d.ts.map +1 -0
- package/platform/types/components/aws/bus.d.ts +447 -0
- package/platform/types/components/aws/bus.d.ts.map +1 -0
- package/platform/types/components/aws/cdn.d.ts +310 -0
- package/platform/types/components/aws/cdn.d.ts.map +1 -0
- package/platform/types/components/aws/cluster-v1.d.ts +885 -0
- package/platform/types/components/aws/cluster-v1.d.ts.map +1 -0
- package/platform/types/components/aws/cluster.d.ts +364 -0
- package/platform/types/components/aws/cluster.d.ts.map +1 -0
- package/platform/types/components/aws/cognito-identity-pool.d.ts +199 -0
- package/platform/types/components/aws/cognito-identity-pool.d.ts.map +1 -0
- package/platform/types/components/aws/cognito-identity-provider.d.ts +38 -0
- package/platform/types/components/aws/cognito-identity-provider.d.ts.map +1 -0
- package/platform/types/components/aws/cognito-user-pool-client.d.ts +50 -0
- package/platform/types/components/aws/cognito-user-pool-client.d.ts.map +1 -0
- package/platform/types/components/aws/cognito-user-pool.d.ts +703 -0
- package/platform/types/components/aws/cognito-user-pool.d.ts.map +1 -0
- package/platform/types/components/aws/cron-v2.d.ts +325 -0
- package/platform/types/components/aws/cron-v2.d.ts.map +1 -0
- package/platform/types/components/aws/cron.d.ts +259 -0
- package/platform/types/components/aws/cron.d.ts.map +1 -0
- package/platform/types/components/aws/dns-validated-certificate.d.ts +27 -0
- package/platform/types/components/aws/dns-validated-certificate.d.ts.map +1 -0
- package/platform/types/components/aws/dns.d.ts +94 -0
- package/platform/types/components/aws/dns.d.ts.map +1 -0
- package/platform/types/components/aws/dsql.d.ts +369 -0
- package/platform/types/components/aws/dsql.d.ts.map +1 -0
- package/platform/types/components/aws/dynamo-lambda-subscriber.d.ts +55 -0
- package/platform/types/components/aws/dynamo-lambda-subscriber.d.ts.map +1 -0
- package/platform/types/components/aws/dynamo.d.ts +628 -0
- package/platform/types/components/aws/dynamo.d.ts.map +1 -0
- package/platform/types/components/aws/efs.d.ts +217 -0
- package/platform/types/components/aws/efs.d.ts.map +1 -0
- package/platform/types/components/aws/email.d.ts +370 -0
- package/platform/types/components/aws/email.d.ts.map +1 -0
- package/platform/types/components/aws/fargate.d.ts +894 -0
- package/platform/types/components/aws/fargate.d.ts.map +1 -0
- package/platform/types/components/aws/function.d.ts +1755 -0
- package/platform/types/components/aws/function.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/apigateway-account.d.ts +3 -0
- package/platform/types/components/aws/helpers/apigateway-account.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/apigatewayv2-domain.d.ts +144 -0
- package/platform/types/components/aws/helpers/apigatewayv2-domain.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/arn.d.ts +51 -0
- package/platform/types/components/aws/helpers/arn.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/bootstrap.d.ts +13 -0
- package/platform/types/components/aws/helpers/bootstrap.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/client.d.ts +7 -0
- package/platform/types/components/aws/helpers/client.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/container-builder.d.ts +4 -0
- package/platform/types/components/aws/helpers/container-builder.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/custom-domain.d.ts +111 -0
- package/platform/types/components/aws/helpers/custom-domain.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/event-source.d.ts +26 -0
- package/platform/types/components/aws/helpers/event-source.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/fargate.d.ts +225 -0
- package/platform/types/components/aws/helpers/fargate.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/function-builder.d.ts +14 -0
- package/platform/types/components/aws/helpers/function-builder.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/function-code.d.ts +80 -0
- package/platform/types/components/aws/helpers/function-code.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/function-part.d.ts +61 -0
- package/platform/types/components/aws/helpers/function-part.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/function-permission.d.ts +17 -0
- package/platform/types/components/aws/helpers/function-permission.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/load-balancer-args.d.ts +40 -0
- package/platform/types/components/aws/helpers/load-balancer-args.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/load-balancer.d.ts +9 -0
- package/platform/types/components/aws/helpers/load-balancer.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/provider.d.ts +3 -0
- package/platform/types/components/aws/helpers/provider.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/queue-policy.d.ts +11 -0
- package/platform/types/components/aws/helpers/queue-policy.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/rds.d.ts +98 -0
- package/platform/types/components/aws/helpers/rds.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/site-builder.d.ts +4 -0
- package/platform/types/components/aws/helpers/site-builder.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/subscriber.d.ts +6 -0
- package/platform/types/components/aws/helpers/subscriber.d.ts.map +1 -0
- package/platform/types/components/aws/helpers/vpc.d.ts +14 -0
- package/platform/types/components/aws/helpers/vpc.d.ts.map +1 -0
- package/platform/types/components/aws/https-redirect.d.ts +38 -0
- package/platform/types/components/aws/https-redirect.d.ts.map +1 -0
- package/platform/types/components/aws/iam-edit.d.ts +39 -0
- package/platform/types/components/aws/iam-edit.d.ts.map +1 -0
- package/platform/types/components/aws/index.d.ts +56 -0
- package/platform/types/components/aws/index.d.ts.map +1 -0
- package/platform/types/components/aws/kinesis-stream-lambda-subscriber.d.ts +49 -0
- package/platform/types/components/aws/kinesis-stream-lambda-subscriber.d.ts.map +1 -0
- package/platform/types/components/aws/kinesis-stream.d.ts +254 -0
- package/platform/types/components/aws/kinesis-stream.d.ts.map +1 -0
- package/platform/types/components/aws/linkable.d.ts +17 -0
- package/platform/types/components/aws/linkable.d.ts.map +1 -0
- package/platform/types/components/aws/logging.d.ts +26 -0
- package/platform/types/components/aws/logging.d.ts.map +1 -0
- package/platform/types/components/aws/microvm.d.ts +439 -0
- package/platform/types/components/aws/microvm.d.ts.map +1 -0
- package/platform/types/components/aws/mysql.d.ts +525 -0
- package/platform/types/components/aws/mysql.d.ts.map +1 -0
- package/platform/types/components/aws/nextjs.d.ts +534 -0
- package/platform/types/components/aws/nextjs.d.ts.map +1 -0
- package/platform/types/components/aws/nuxt.d.ts +480 -0
- package/platform/types/components/aws/nuxt.d.ts.map +1 -0
- package/platform/types/components/aws/open-search.d.ts +306 -0
- package/platform/types/components/aws/open-search.d.ts.map +1 -0
- package/platform/types/components/aws/opencontrol.d.ts +169 -0
- package/platform/types/components/aws/opencontrol.d.ts.map +1 -0
- package/platform/types/components/aws/permission.d.ts +80 -0
- package/platform/types/components/aws/permission.d.ts.map +1 -0
- package/platform/types/components/aws/postgres-v1.d.ts +328 -0
- package/platform/types/components/aws/postgres-v1.d.ts.map +1 -0
- package/platform/types/components/aws/postgres.d.ts +529 -0
- package/platform/types/components/aws/postgres.d.ts.map +1 -0
- package/platform/types/components/aws/providers/bucket-files.d.ts +18 -0
- package/platform/types/components/aws/providers/bucket-files.d.ts.map +1 -0
- package/platform/types/components/aws/providers/distribution-deployment-waiter.d.ts +13 -0
- package/platform/types/components/aws/providers/distribution-deployment-waiter.d.ts.map +1 -0
- package/platform/types/components/aws/providers/distribution-invalidation.d.ts +11 -0
- package/platform/types/components/aws/providers/distribution-invalidation.d.ts.map +1 -0
- package/platform/types/components/aws/providers/function-environment-update.d.ts +33 -0
- package/platform/types/components/aws/providers/function-environment-update.d.ts.map +1 -0
- package/platform/types/components/aws/providers/hosted-zone-lookup.d.ts +11 -0
- package/platform/types/components/aws/providers/hosted-zone-lookup.d.ts.map +1 -0
- package/platform/types/components/aws/providers/kv-keys.d.ts +11 -0
- package/platform/types/components/aws/providers/kv-keys.d.ts.map +1 -0
- package/platform/types/components/aws/providers/kv-routes-update.d.ts +11 -0
- package/platform/types/components/aws/providers/kv-routes-update.d.ts.map +1 -0
- package/platform/types/components/aws/providers/microvm-image-prune.d.ts +35 -0
- package/platform/types/components/aws/providers/microvm-image-prune.d.ts.map +1 -0
- package/platform/types/components/aws/providers/origin-access-control.d.ts +8 -0
- package/platform/types/components/aws/providers/origin-access-control.d.ts.map +1 -0
- package/platform/types/components/aws/providers/rds-role-lookup.d.ts +8 -0
- package/platform/types/components/aws/providers/rds-role-lookup.d.ts.map +1 -0
- package/platform/types/components/aws/providers/vector-table.d.ts +12 -0
- package/platform/types/components/aws/providers/vector-table.d.ts.map +1 -0
- package/platform/types/components/aws/queue-lambda-subscriber.d.ts +53 -0
- package/platform/types/components/aws/queue-lambda-subscriber.d.ts.map +1 -0
- package/platform/types/components/aws/queue.d.ts +494 -0
- package/platform/types/components/aws/queue.d.ts.map +1 -0
- package/platform/types/components/aws/react.d.ts +407 -0
- package/platform/types/components/aws/react.d.ts.map +1 -0
- package/platform/types/components/aws/realtime-lambda-subscriber.d.ts +53 -0
- package/platform/types/components/aws/realtime-lambda-subscriber.d.ts.map +1 -0
- package/platform/types/components/aws/realtime.d.ts +237 -0
- package/platform/types/components/aws/realtime.d.ts.map +1 -0
- package/platform/types/components/aws/redis-v1.d.ts +348 -0
- package/platform/types/components/aws/redis-v1.d.ts.map +1 -0
- package/platform/types/components/aws/redis.d.ts +545 -0
- package/platform/types/components/aws/redis.d.ts.map +1 -0
- package/platform/types/components/aws/remix.d.ts +408 -0
- package/platform/types/components/aws/remix.d.ts.map +1 -0
- package/platform/types/components/aws/router-base-route.d.ts +28 -0
- package/platform/types/components/aws/router-base-route.d.ts.map +1 -0
- package/platform/types/components/aws/router-bucket-route.d.ts +29 -0
- package/platform/types/components/aws/router-bucket-route.d.ts.map +1 -0
- package/platform/types/components/aws/router-url-route.d.ts +28 -0
- package/platform/types/components/aws/router-url-route.d.ts.map +1 -0
- package/platform/types/components/aws/router.d.ts +1754 -0
- package/platform/types/components/aws/router.d.ts.map +1 -0
- package/platform/types/components/aws/service-v1.d.ts +78 -0
- package/platform/types/components/aws/service-v1.d.ts.map +1 -0
- package/platform/types/components/aws/service.d.ts +1756 -0
- package/platform/types/components/aws/service.d.ts.map +1 -0
- package/platform/types/components/aws/sns-topic-lambda-subscriber.d.ts +53 -0
- package/platform/types/components/aws/sns-topic-lambda-subscriber.d.ts.map +1 -0
- package/platform/types/components/aws/sns-topic-queue-subscriber.d.ts +55 -0
- package/platform/types/components/aws/sns-topic-queue-subscriber.d.ts.map +1 -0
- package/platform/types/components/aws/sns-topic.d.ts +394 -0
- package/platform/types/components/aws/sns-topic.d.ts.map +1 -0
- package/platform/types/components/aws/solid-start.d.ts +399 -0
- package/platform/types/components/aws/solid-start.d.ts.map +1 -0
- package/platform/types/components/aws/ssr-site.d.ts +895 -0
- package/platform/types/components/aws/ssr-site.d.ts.map +1 -0
- package/platform/types/components/aws/static-site.d.ts +744 -0
- package/platform/types/components/aws/static-site.d.ts.map +1 -0
- package/platform/types/components/aws/step-functions/choice.d.ts +73 -0
- package/platform/types/components/aws/step-functions/choice.d.ts.map +1 -0
- package/platform/types/components/aws/step-functions/fail.d.ts +63 -0
- package/platform/types/components/aws/step-functions/fail.d.ts.map +1 -0
- package/platform/types/components/aws/step-functions/map.d.ts +236 -0
- package/platform/types/components/aws/step-functions/map.d.ts.map +1 -0
- package/platform/types/components/aws/step-functions/parallel.d.ts +127 -0
- package/platform/types/components/aws/step-functions/parallel.d.ts.map +1 -0
- package/platform/types/components/aws/step-functions/pass.d.ts +39 -0
- package/platform/types/components/aws/step-functions/pass.d.ts.map +1 -0
- package/platform/types/components/aws/step-functions/state.d.ts +231 -0
- package/platform/types/components/aws/step-functions/state.d.ts.map +1 -0
- package/platform/types/components/aws/step-functions/succeed.d.ts +26 -0
- package/platform/types/components/aws/step-functions/succeed.d.ts.map +1 -0
- package/platform/types/components/aws/step-functions/task.d.ts +485 -0
- package/platform/types/components/aws/step-functions/task.d.ts.map +1 -0
- package/platform/types/components/aws/step-functions/wait.d.ts +91 -0
- package/platform/types/components/aws/step-functions/wait.d.ts.map +1 -0
- package/platform/types/components/aws/step-functions.d.ts +478 -0
- package/platform/types/components/aws/step-functions.d.ts.map +1 -0
- package/platform/types/components/aws/svelte-kit.d.ts +456 -0
- package/platform/types/components/aws/svelte-kit.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/alb.d.ts +2 -0
- package/platform/types/components/aws/takeover/alb.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/apigatewayv2.d.ts +2 -0
- package/platform/types/components/aws/takeover/apigatewayv2.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/app-sync.d.ts +2 -0
- package/platform/types/components/aws/takeover/app-sync.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/aurora.d.ts +2 -0
- package/platform/types/components/aws/takeover/aurora.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/bucket.d.ts +2 -0
- package/platform/types/components/aws/takeover/bucket.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/bus.d.ts +2 -0
- package/platform/types/components/aws/takeover/bus.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/cognito-user-pool.d.ts +2 -0
- package/platform/types/components/aws/takeover/cognito-user-pool.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/cron-v2.d.ts +2 -0
- package/platform/types/components/aws/takeover/cron-v2.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/dsql.d.ts +2 -0
- package/platform/types/components/aws/takeover/dsql.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/dynamo.d.ts +2 -0
- package/platform/types/components/aws/takeover/dynamo.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/efs.d.ts +2 -0
- package/platform/types/components/aws/takeover/efs.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/function.d.ts +2 -0
- package/platform/types/components/aws/takeover/function.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/helpers.d.ts +16 -0
- package/platform/types/components/aws/takeover/helpers.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/index.d.ts +28 -0
- package/platform/types/components/aws/takeover/index.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/mysql.d.ts +2 -0
- package/platform/types/components/aws/takeover/mysql.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/postgres.d.ts +2 -0
- package/platform/types/components/aws/takeover/postgres.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/queue.d.ts +2 -0
- package/platform/types/components/aws/takeover/queue.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/redis.d.ts +2 -0
- package/platform/types/components/aws/takeover/redis.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/service.d.ts +2 -0
- package/platform/types/components/aws/takeover/service.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/sns-topic.d.ts +2 -0
- package/platform/types/components/aws/takeover/sns-topic.d.ts.map +1 -0
- package/platform/types/components/aws/takeover/task.d.ts +2 -0
- package/platform/types/components/aws/takeover/task.d.ts.map +1 -0
- package/platform/types/components/aws/tan-stack-start.d.ts +359 -0
- package/platform/types/components/aws/tan-stack-start.d.ts.map +1 -0
- package/platform/types/components/aws/task.d.ts +342 -0
- package/platform/types/components/aws/task.d.ts.map +1 -0
- package/platform/types/components/aws/v5/alb.d.ts +177 -0
- package/platform/types/components/aws/v5/alb.d.ts.map +1 -0
- package/platform/types/components/aws/v5/apigatewayv2.d.ts +482 -0
- package/platform/types/components/aws/v5/apigatewayv2.d.ts.map +1 -0
- package/platform/types/components/aws/v5/app-sync.d.ts +424 -0
- package/platform/types/components/aws/v5/app-sync.d.ts.map +1 -0
- package/platform/types/components/aws/v5/aurora.d.ts +459 -0
- package/platform/types/components/aws/v5/aurora.d.ts.map +1 -0
- package/platform/types/components/aws/v5/bucket.d.ts +578 -0
- package/platform/types/components/aws/v5/bucket.d.ts.map +1 -0
- package/platform/types/components/aws/v5/bus.d.ts +255 -0
- package/platform/types/components/aws/v5/bus.d.ts.map +1 -0
- package/platform/types/components/aws/v5/cluster.d.ts +167 -0
- package/platform/types/components/aws/v5/cluster.d.ts.map +1 -0
- package/platform/types/components/aws/v5/cognito-user-pool-client.d.ts +69 -0
- package/platform/types/components/aws/v5/cognito-user-pool-client.d.ts.map +1 -0
- package/platform/types/components/aws/v5/cognito-user-pool.d.ts +396 -0
- package/platform/types/components/aws/v5/cognito-user-pool.d.ts.map +1 -0
- package/platform/types/components/aws/v5/cron-v2.d.ts +206 -0
- package/platform/types/components/aws/v5/cron-v2.d.ts.map +1 -0
- package/platform/types/components/aws/v5/dsql.d.ts +453 -0
- package/platform/types/components/aws/v5/dsql.d.ts.map +1 -0
- package/platform/types/components/aws/v5/dynamo.d.ts +328 -0
- package/platform/types/components/aws/v5/dynamo.d.ts.map +1 -0
- package/platform/types/components/aws/v5/efs.d.ts +178 -0
- package/platform/types/components/aws/v5/efs.d.ts.map +1 -0
- package/platform/types/components/aws/v5/function.d.ts +582 -0
- package/platform/types/components/aws/v5/function.d.ts.map +1 -0
- package/platform/types/components/aws/v5/index.d.ts +27 -0
- package/platform/types/components/aws/v5/index.d.ts.map +1 -0
- package/platform/types/components/aws/v5/mysql.d.ts +347 -0
- package/platform/types/components/aws/v5/mysql.d.ts.map +1 -0
- package/platform/types/components/aws/v5/postgres.d.ts +348 -0
- package/platform/types/components/aws/v5/postgres.d.ts.map +1 -0
- package/platform/types/components/aws/v5/queue.d.ts +190 -0
- package/platform/types/components/aws/v5/queue.d.ts.map +1 -0
- package/platform/types/components/aws/v5/redis.d.ts +214 -0
- package/platform/types/components/aws/v5/redis.d.ts.map +1 -0
- package/platform/types/components/aws/v5/service.d.ts +1347 -0
- package/platform/types/components/aws/v5/service.d.ts.map +1 -0
- package/platform/types/components/aws/v5/sns-topic.d.ts +226 -0
- package/platform/types/components/aws/v5/sns-topic.d.ts.map +1 -0
- package/platform/types/components/aws/v5/task.d.ts +346 -0
- package/platform/types/components/aws/v5/task.d.ts.map +1 -0
- package/platform/types/components/aws/vector.d.ts +163 -0
- package/platform/types/components/aws/vector.d.ts.map +1 -0
- package/platform/types/components/aws/vpc-v1.d.ts +208 -0
- package/platform/types/components/aws/vpc-v1.d.ts.map +1 -0
- package/platform/types/components/aws/vpc.d.ts +491 -0
- package/platform/types/components/aws/vpc.d.ts.map +1 -0
- package/platform/types/components/aws/workflow.d.ts +331 -0
- package/platform/types/components/aws/workflow.d.ts.map +1 -0
- package/platform/types/components/base/base-site.d.ts +53 -0
- package/platform/types/components/base/base-site.d.ts.map +1 -0
- package/platform/types/components/base/base-ssr-site.d.ts +13 -0
- package/platform/types/components/base/base-ssr-site.d.ts.map +1 -0
- package/platform/types/components/base/base-static-site.d.ts +199 -0
- package/platform/types/components/base/base-static-site.d.ts.map +1 -0
- package/platform/types/components/cloudflare/account-id.d.ts +2 -0
- package/platform/types/components/cloudflare/account-id.d.ts.map +1 -0
- package/platform/types/components/cloudflare/ai.d.ts +68 -0
- package/platform/types/components/cloudflare/ai.d.ts.map +1 -0
- package/platform/types/components/cloudflare/astro.d.ts +249 -0
- package/platform/types/components/cloudflare/astro.d.ts.map +1 -0
- package/platform/types/components/cloudflare/auth.d.ts +22 -0
- package/platform/types/components/cloudflare/auth.d.ts.map +1 -0
- package/platform/types/components/cloudflare/binding.d.ts +109 -0
- package/platform/types/components/cloudflare/binding.d.ts.map +1 -0
- package/platform/types/components/cloudflare/bucket.d.ts +98 -0
- package/platform/types/components/cloudflare/bucket.d.ts.map +1 -0
- package/platform/types/components/cloudflare/cron.d.ts +151 -0
- package/platform/types/components/cloudflare/cron.d.ts.map +1 -0
- package/platform/types/components/cloudflare/d1.d.ts +142 -0
- package/platform/types/components/cloudflare/d1.d.ts.map +1 -0
- package/platform/types/components/cloudflare/dns.d.ts +100 -0
- package/platform/types/components/cloudflare/dns.d.ts.map +1 -0
- package/platform/types/components/cloudflare/durable-object.d.ts +125 -0
- package/platform/types/components/cloudflare/durable-object.d.ts.map +1 -0
- package/platform/types/components/cloudflare/experimental/index.d.ts +4 -0
- package/platform/types/components/cloudflare/experimental/index.d.ts.map +1 -0
- package/platform/types/components/cloudflare/experimental/solid-start.d.ts +219 -0
- package/platform/types/components/cloudflare/experimental/solid-start.d.ts.map +1 -0
- package/platform/types/components/cloudflare/experimental/static-site.d.ts +3 -0
- package/platform/types/components/cloudflare/experimental/static-site.d.ts.map +1 -0
- package/platform/types/components/cloudflare/helpers/compatibility.d.ts +21 -0
- package/platform/types/components/cloudflare/helpers/compatibility.d.ts.map +1 -0
- package/platform/types/components/cloudflare/helpers/fetch.d.ts +19 -0
- package/platform/types/components/cloudflare/helpers/fetch.d.ts.map +1 -0
- package/platform/types/components/cloudflare/helpers/validation.d.ts +15 -0
- package/platform/types/components/cloudflare/helpers/validation.d.ts.map +1 -0
- package/platform/types/components/cloudflare/helpers/worker-builder.d.ts +10 -0
- package/platform/types/components/cloudflare/helpers/worker-builder.d.ts.map +1 -0
- package/platform/types/components/cloudflare/helpers/wrangler.d.ts +31 -0
- package/platform/types/components/cloudflare/helpers/wrangler.d.ts.map +1 -0
- package/platform/types/components/cloudflare/hyperdrive.d.ts +302 -0
- package/platform/types/components/cloudflare/hyperdrive.d.ts.map +1 -0
- package/platform/types/components/cloudflare/index.d.ts +25 -0
- package/platform/types/components/cloudflare/index.d.ts.map +1 -0
- package/platform/types/components/cloudflare/kv.d.ts +140 -0
- package/platform/types/components/cloudflare/kv.d.ts.map +1 -0
- package/platform/types/components/cloudflare/providers/dns-record.d.ts +21 -0
- package/platform/types/components/cloudflare/providers/dns-record.d.ts.map +1 -0
- package/platform/types/components/cloudflare/providers/kv-data.d.ts +23 -0
- package/platform/types/components/cloudflare/providers/kv-data.d.ts.map +1 -0
- package/platform/types/components/cloudflare/providers/worker-assets.d.ts +19 -0
- package/platform/types/components/cloudflare/providers/worker-assets.d.ts.map +1 -0
- package/platform/types/components/cloudflare/providers/worker-placement.d.ts +27 -0
- package/platform/types/components/cloudflare/providers/worker-placement.d.ts.map +1 -0
- package/platform/types/components/cloudflare/providers/worker-script.d.ts +23 -0
- package/platform/types/components/cloudflare/providers/worker-script.d.ts.map +1 -0
- package/platform/types/components/cloudflare/providers/worker-url.d.ts +24 -0
- package/platform/types/components/cloudflare/providers/worker-url.d.ts.map +1 -0
- package/platform/types/components/cloudflare/providers/zone-lookup.d.ts +22 -0
- package/platform/types/components/cloudflare/providers/zone-lookup.d.ts.map +1 -0
- package/platform/types/components/cloudflare/queue-worker-subscriber.d.ts +122 -0
- package/platform/types/components/cloudflare/queue-worker-subscriber.d.ts.map +1 -0
- package/platform/types/components/cloudflare/queue.d.ts +235 -0
- package/platform/types/components/cloudflare/queue.d.ts.map +1 -0
- package/platform/types/components/cloudflare/rate-limit.d.ts +117 -0
- package/platform/types/components/cloudflare/rate-limit.d.ts.map +1 -0
- package/platform/types/components/cloudflare/react-router.d.ts +262 -0
- package/platform/types/components/cloudflare/react-router.d.ts.map +1 -0
- package/platform/types/components/cloudflare/ssr-site.d.ts +60 -0
- package/platform/types/components/cloudflare/ssr-site.d.ts.map +1 -0
- package/platform/types/components/cloudflare/static-site-v2.d.ts +302 -0
- package/platform/types/components/cloudflare/static-site-v2.d.ts.map +1 -0
- package/platform/types/components/cloudflare/static-site.d.ts +270 -0
- package/platform/types/components/cloudflare/static-site.d.ts.map +1 -0
- package/platform/types/components/cloudflare/tan-stack-start.d.ts +259 -0
- package/platform/types/components/cloudflare/tan-stack-start.d.ts.map +1 -0
- package/platform/types/components/cloudflare/worker.d.ts +483 -0
- package/platform/types/components/cloudflare/worker.d.ts.map +1 -0
- package/platform/types/components/cloudflare/workflow.d.ts +248 -0
- package/platform/types/components/cloudflare/workflow.d.ts.map +1 -0
- package/platform/types/components/component.d.ts +67 -0
- package/platform/types/components/component.d.ts.map +1 -0
- package/platform/types/components/core.d.ts +16 -0
- package/platform/types/components/core.d.ts.map +1 -0
- package/platform/types/components/cpu.d.ts +3 -0
- package/platform/types/components/cpu.d.ts.map +1 -0
- package/platform/types/components/dns.d.ts +63 -0
- package/platform/types/components/dns.d.ts.map +1 -0
- package/platform/types/components/duration.d.ts +9 -0
- package/platform/types/components/duration.d.ts.map +1 -0
- package/platform/types/components/error.d.ts +4 -0
- package/platform/types/components/error.d.ts.map +1 -0
- package/platform/types/components/esbuild.d.ts +3 -0
- package/platform/types/components/esbuild.d.ts.map +1 -0
- package/platform/types/components/experimental/dev-command.d.ts +99 -0
- package/platform/types/components/experimental/dev-command.d.ts.map +1 -0
- package/platform/types/components/experimental/index.d.ts +2 -0
- package/platform/types/components/experimental/index.d.ts.map +1 -0
- package/platform/types/components/groups.d.ts +6 -0
- package/platform/types/components/groups.d.ts.map +1 -0
- package/platform/types/components/index.d.ts +5 -0
- package/platform/types/components/index.d.ts.map +1 -0
- package/platform/types/components/input.d.ts +3 -0
- package/platform/types/components/input.d.ts.map +1 -0
- package/platform/types/components/link.d.ts +41 -0
- package/platform/types/components/link.d.ts.map +1 -0
- package/platform/types/components/linkable.d.ts +301 -0
- package/platform/types/components/linkable.d.ts.map +1 -0
- package/platform/types/components/naming-rules.d.ts +32 -0
- package/platform/types/components/naming-rules.d.ts.map +1 -0
- package/platform/types/components/naming.d.ts +21 -0
- package/platform/types/components/naming.d.ts.map +1 -0
- package/platform/types/components/parts-component.d.ts +241 -0
- package/platform/types/components/parts-component.d.ts.map +1 -0
- package/platform/types/components/parts.d.ts +194 -0
- package/platform/types/components/parts.d.ts.map +1 -0
- package/platform/types/components/path.d.ts +2 -0
- package/platform/types/components/path.d.ts.map +1 -0
- package/platform/types/components/rpc/rpc.d.ts +19 -0
- package/platform/types/components/rpc/rpc.d.ts.map +1 -0
- package/platform/types/components/secret.d.ts +123 -0
- package/platform/types/components/secret.d.ts.map +1 -0
- package/platform/types/components/size.d.ts +5 -0
- package/platform/types/components/size.d.ts.map +1 -0
- package/platform/types/components/takeover.d.ts +88 -0
- package/platform/types/components/takeover.d.ts.map +1 -0
- package/platform/types/components/transform.d.ts +34 -0
- package/platform/types/components/transform.d.ts.map +1 -0
- package/platform/types/components/vercel/account-id.d.ts +2 -0
- package/platform/types/components/vercel/account-id.d.ts.map +1 -0
- package/platform/types/components/vercel/dns.d.ts +73 -0
- package/platform/types/components/vercel/dns.d.ts.map +1 -0
- package/platform/types/components/vercel/index.d.ts +3 -0
- package/platform/types/components/vercel/index.d.ts.map +1 -0
- package/platform/types/components/vercel/providers/dns-record.d.ts +15 -0
- package/platform/types/components/vercel/providers/dns-record.d.ts.map +1 -0
- package/platform/types/config.d.ts +1437 -0
- package/platform/types/config.d.ts.map +1 -0
- package/platform/types/global-aliases.d.ts +37 -0
- package/platform/types/global.d.ts +374 -0
- package/platform/types/internal.d.ts +18 -0
- package/platform/types/runtime/worker/unenv.d.ts +14 -0
- package/platform/types/testing/global.d.ts +11 -0
- package/platform/types/testing/global.d.ts.map +1 -0
- package/platform/types/testing/index.d.ts +80 -0
- package/platform/types/testing/index.d.ts.map +1 -0
- package/platform/types/testing/mock.d.ts +136 -0
- package/platform/types/testing/mock.d.ts.map +1 -0
- package/platform/types/testing/vitest.d.ts +19 -0
- package/platform/types/testing/vitest.d.ts.map +1 -0
- package/platform/types/util/compare-semver.d.ts +4 -0
- package/platform/types/util/compare-semver.d.ts.map +1 -0
- package/platform/types/util/fs.d.ts +5 -0
- package/platform/types/util/fs.d.ts.map +1 -0
- package/platform/types/util/lazy.d.ts +2 -0
- package/platform/types/util/lazy.d.ts.map +1 -0
- package/platform/types/util/minify.d.ts +2 -0
- package/platform/types/util/minify.d.ts.map +1 -0
- package/platform/types/util/package.d.ts +10 -0
- package/platform/types/util/package.d.ts.map +1 -0
- package/platform/types/util/semaphore.d.ts +9 -0
- package/platform/types/util/semaphore.d.ts.map +1 -0
- package/platform/types/util/warn.d.ts +2 -0
- package/platform/types/util/warn.d.ts.map +1 -0
|
@@ -0,0 +1,1641 @@
|
|
|
1
|
+
import {
|
|
2
|
+
all,
|
|
3
|
+
ComponentResourceOptions,
|
|
4
|
+
interpolate,
|
|
5
|
+
Output,
|
|
6
|
+
output,
|
|
7
|
+
} from "@pulumi/pulumi";
|
|
8
|
+
import { Component, Transform, transform } from "../component";
|
|
9
|
+
import { Input } from "../input";
|
|
10
|
+
import {
|
|
11
|
+
ec2,
|
|
12
|
+
getAvailabilityZonesOutput,
|
|
13
|
+
getPartitionOutput,
|
|
14
|
+
iam,
|
|
15
|
+
route53,
|
|
16
|
+
servicediscovery,
|
|
17
|
+
ssm,
|
|
18
|
+
} from "@pulumi/aws";
|
|
19
|
+
import { Vpc as VpcV1 } from "./vpc-v1";
|
|
20
|
+
import { Link } from "../link";
|
|
21
|
+
import { VisibleError } from "../error";
|
|
22
|
+
import { PrivateKey } from "@pulumi/tls";
|
|
23
|
+
import { rootStackResource } from "@pulumi/pulumi";
|
|
24
|
+
|
|
25
|
+
export type { VpcArgs as VpcV1Args } from "./vpc-v1";
|
|
26
|
+
|
|
27
|
+
export interface VpcArgs {
|
|
28
|
+
/**
|
|
29
|
+
* Specify the Availability Zones or AZs for the VPC.
|
|
30
|
+
*
|
|
31
|
+
* You can specify a number of AZs or a list of AZs. If you specify a number, it will
|
|
32
|
+
* look up the availability zones in the region and automatically select that number of
|
|
33
|
+
* AZs. If you specify a list of AZs, it will use that list of AZs.
|
|
34
|
+
*
|
|
35
|
+
* By default, it creates a VPC with 2 availability zones since services like RDS and
|
|
36
|
+
* Fargate need at least 2 AZs.
|
|
37
|
+
* @default `2`
|
|
38
|
+
* @example
|
|
39
|
+
* Create a VPC with 3 AZs
|
|
40
|
+
* ```ts
|
|
41
|
+
* {
|
|
42
|
+
* az: 3
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* Create a VPC with specific AZs
|
|
47
|
+
* ```ts
|
|
48
|
+
* {
|
|
49
|
+
* az: ["us-east-1a", "us-east-1b"]
|
|
50
|
+
* }
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
az?: Input<number | Input<string>[]>;
|
|
54
|
+
/**
|
|
55
|
+
* Configures NAT. Enabling NAT allows resources in private subnets to connect to the internet.
|
|
56
|
+
*
|
|
57
|
+
* There are two NAT options:
|
|
58
|
+
* 1. `"managed"` creates a [NAT Gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html)
|
|
59
|
+
* 2. `"ec2"` creates an [EC2 instance](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html)
|
|
60
|
+
* with the [fck-nat](https://github.com/AndrewGuenther/fck-nat) AMI
|
|
61
|
+
*
|
|
62
|
+
* For `"managed"`, a NAT Gateway is created in each AZ. All the traffic from
|
|
63
|
+
* the private subnets are routed to the NAT Gateway in the same AZ.
|
|
64
|
+
*
|
|
65
|
+
* NAT Gateways are billed per hour and per gigabyte of data processed. A NAT Gateway for
|
|
66
|
+
* two AZs costs $65 per month. This is relatively expensive but it automatically scales
|
|
67
|
+
* based on the traffic.
|
|
68
|
+
*
|
|
69
|
+
* For `"ec2"`, an EC2 instance of type `t4g.nano` will be launched in each AZ
|
|
70
|
+
* with the [fck-nat](https://github.com/AndrewGuenther/fck-nat) AMI. All the traffic from
|
|
71
|
+
* the private subnets are routed to the Elastic Network Interface (ENI) of the EC2 instance
|
|
72
|
+
* in the same AZ.
|
|
73
|
+
*
|
|
74
|
+
* :::tip
|
|
75
|
+
* The `"ec2"` option uses fck-nat and is 10x cheaper than the `"managed"` NAT Gateway.
|
|
76
|
+
* :::
|
|
77
|
+
*
|
|
78
|
+
* NAT EC2 instances are much cheaper than NAT Gateways, the `t4g.nano` instance type is around
|
|
79
|
+
* $3 per month. But you'll need to scale it up manually if you need more bandwidth.
|
|
80
|
+
*
|
|
81
|
+
* @default NAT is disabled
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* {
|
|
85
|
+
* nat: "managed"
|
|
86
|
+
* }
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
nat?: Input<
|
|
90
|
+
| "ec2"
|
|
91
|
+
| "managed"
|
|
92
|
+
| {
|
|
93
|
+
/**
|
|
94
|
+
* Configures the type of NAT to create.
|
|
95
|
+
*
|
|
96
|
+
* - If `nat.ec2` is provided, `nat.type` defaults to `"ec2"`.
|
|
97
|
+
* - Otherwise, `nat.type` must be explicitly specified.
|
|
98
|
+
*/
|
|
99
|
+
type?: Input<"ec2" | "managed">;
|
|
100
|
+
/**
|
|
101
|
+
* A list of Elastic IP allocation IDs to use for the NAT Gateways or NAT
|
|
102
|
+
* instances. The number of allocation IDs must match the number of AZs.
|
|
103
|
+
*
|
|
104
|
+
* By default, new Elastic IP addresses are created.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```ts
|
|
108
|
+
* {
|
|
109
|
+
* nat: {
|
|
110
|
+
* ip: ["eipalloc-0123456789abcdef0", "eipalloc-0123456789abcdef1"]
|
|
111
|
+
* }
|
|
112
|
+
* }
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
ip?: Input<Input<string>[]>;
|
|
116
|
+
/**
|
|
117
|
+
* Configures the NAT EC2 instance.
|
|
118
|
+
* @default `{instance: "t4g.nano"}`
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* {
|
|
122
|
+
* nat: {
|
|
123
|
+
* ec2: {
|
|
124
|
+
* instance: "t4g.large"
|
|
125
|
+
* }
|
|
126
|
+
* }
|
|
127
|
+
* }
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
ec2?: Input<{
|
|
131
|
+
/**
|
|
132
|
+
* The type of instance to use for the NAT.
|
|
133
|
+
*
|
|
134
|
+
* @default `"t4g.nano"`
|
|
135
|
+
*/
|
|
136
|
+
instance: Input<string>;
|
|
137
|
+
/**
|
|
138
|
+
* The AMI to use for the NAT.
|
|
139
|
+
*
|
|
140
|
+
* By default, the latest public [`fck-nat`](https://github.com/AndrewGuenther/fck-nat)
|
|
141
|
+
* AMI is used. However, if the AMI is not available in the region you are
|
|
142
|
+
* deploying to or you want to use a custom AMI, you can specify a different AMI.
|
|
143
|
+
*
|
|
144
|
+
* @default The latest `fck-nat` AMI
|
|
145
|
+
* @example
|
|
146
|
+
* ```ts
|
|
147
|
+
* {
|
|
148
|
+
* nat: {
|
|
149
|
+
* ec2: {
|
|
150
|
+
* ami: "ami-1234567890abcdef0"
|
|
151
|
+
* }
|
|
152
|
+
* }
|
|
153
|
+
* }
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
ami?: Input<string>;
|
|
157
|
+
/**
|
|
158
|
+
* The Name of an existing IAM role to use for the NAT instance.
|
|
159
|
+
*
|
|
160
|
+
* By default, a new IAM role with SSM managed instance core permissions is created.
|
|
161
|
+
* Use this to provide a custom role with additional permissions or to comply with
|
|
162
|
+
* organizational policies.
|
|
163
|
+
*
|
|
164
|
+
* @default A new IAM role is created
|
|
165
|
+
* @example
|
|
166
|
+
* ```ts
|
|
167
|
+
* {
|
|
168
|
+
* nat: {
|
|
169
|
+
* ec2: {
|
|
170
|
+
* role: "my-nat-instance-role"
|
|
171
|
+
* }
|
|
172
|
+
* }
|
|
173
|
+
* }
|
|
174
|
+
* ```
|
|
175
|
+
*/
|
|
176
|
+
role?: Input<string>;
|
|
177
|
+
}>;
|
|
178
|
+
}
|
|
179
|
+
>;
|
|
180
|
+
/**
|
|
181
|
+
* Configures a bastion host that can be used to connect to resources in the VPC.
|
|
182
|
+
*
|
|
183
|
+
* When enabled, an EC2 instance of type `t4g.nano` with the bastion AMI will be launched
|
|
184
|
+
* in a public subnet. The instance will have AWS SSM (AWS Session Manager) enabled for
|
|
185
|
+
* secure access without the need for SSH key. You can optionally provide an existing
|
|
186
|
+
* IAM instance profile by name for the bastion.
|
|
187
|
+
*
|
|
188
|
+
* It costs roughly $3 per month to run the `t4g.nano` instance.
|
|
189
|
+
*
|
|
190
|
+
* :::note
|
|
191
|
+
* If `nat: "ec2"` is enabled, the bastion host will reuse the NAT EC2 instance.
|
|
192
|
+
* :::
|
|
193
|
+
*
|
|
194
|
+
* However if `nat: "ec2"` is enabled, the EC2 instance that NAT creates will be used
|
|
195
|
+
* as the bastion host. No additional EC2 instance will be created.
|
|
196
|
+
*
|
|
197
|
+
* If you are running `sst dev`, a tunnel will be automatically created to the bastion host.
|
|
198
|
+
* This uses a network interface to forward traffic from your local machine to the bastion host.
|
|
199
|
+
*
|
|
200
|
+
* You can learn more about [`sst tunnel`](/docs/reference/cli#tunnel).
|
|
201
|
+
*
|
|
202
|
+
* @default `false`
|
|
203
|
+
* @example
|
|
204
|
+
* ```ts
|
|
205
|
+
* {
|
|
206
|
+
* bastion: true
|
|
207
|
+
* }
|
|
208
|
+
* ```
|
|
209
|
+
*
|
|
210
|
+
* Use an existing instance profile by name.
|
|
211
|
+
* Bastion is automatically enabled when you provide an instance profile.
|
|
212
|
+
* @example
|
|
213
|
+
* ```ts
|
|
214
|
+
* {
|
|
215
|
+
* bastion: {
|
|
216
|
+
* instanceProfile: "my-bastion-profile"
|
|
217
|
+
* }
|
|
218
|
+
* }
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
bastion?: Input<
|
|
222
|
+
| boolean
|
|
223
|
+
| {
|
|
224
|
+
/**
|
|
225
|
+
* The name of an existing IAM instance profile to use for the bastion.
|
|
226
|
+
*/
|
|
227
|
+
instanceProfile: Input<string>;
|
|
228
|
+
}
|
|
229
|
+
>;
|
|
230
|
+
/**
|
|
231
|
+
* [Transform](/docs/components#transform) how this component creates its underlying
|
|
232
|
+
* resources.
|
|
233
|
+
*/
|
|
234
|
+
transform?: {
|
|
235
|
+
/**
|
|
236
|
+
* Transform the EC2 VPC resource.
|
|
237
|
+
*/
|
|
238
|
+
vpc?: Transform<ec2.VpcArgs>;
|
|
239
|
+
/**
|
|
240
|
+
* Transform the EC2 Internet Gateway resource.
|
|
241
|
+
*/
|
|
242
|
+
internetGateway?: Transform<ec2.InternetGatewayArgs>;
|
|
243
|
+
/**
|
|
244
|
+
* Transform the EC2 NAT Gateway resource.
|
|
245
|
+
*/
|
|
246
|
+
natGateway?: Transform<ec2.NatGatewayArgs>;
|
|
247
|
+
/**
|
|
248
|
+
* Transform the EC2 NAT instance resource.
|
|
249
|
+
*/
|
|
250
|
+
natInstance?: Transform<ec2.InstanceArgs>;
|
|
251
|
+
/**
|
|
252
|
+
* Transform the EC2 NAT security group resource.
|
|
253
|
+
*/
|
|
254
|
+
natSecurityGroup?: Transform<ec2.SecurityGroupArgs>;
|
|
255
|
+
/**
|
|
256
|
+
* Transform the EC2 Elastic IP resource.
|
|
257
|
+
*/
|
|
258
|
+
elasticIp?: Transform<ec2.EipArgs>;
|
|
259
|
+
/**
|
|
260
|
+
* Transform the EC2 Security Group resource.
|
|
261
|
+
*/
|
|
262
|
+
securityGroup?: Transform<ec2.SecurityGroupArgs>;
|
|
263
|
+
/**
|
|
264
|
+
* Transform the EC2 public subnet resource.
|
|
265
|
+
*/
|
|
266
|
+
publicSubnet?: Transform<ec2.SubnetArgs>;
|
|
267
|
+
/**
|
|
268
|
+
* Transform the EC2 private subnet resource.
|
|
269
|
+
*/
|
|
270
|
+
privateSubnet?: Transform<ec2.SubnetArgs>;
|
|
271
|
+
/**
|
|
272
|
+
* Transform the EC2 route table resource for the public subnet.
|
|
273
|
+
*/
|
|
274
|
+
publicRouteTable?: Transform<ec2.RouteTableArgs>;
|
|
275
|
+
/**
|
|
276
|
+
* Transform the EC2 route table resource for the private subnet.
|
|
277
|
+
*/
|
|
278
|
+
privateRouteTable?: Transform<ec2.RouteTableArgs>;
|
|
279
|
+
/**
|
|
280
|
+
* Transform the EC2 bastion instance resource.
|
|
281
|
+
*/
|
|
282
|
+
bastionInstance?: Transform<ec2.InstanceArgs>;
|
|
283
|
+
/**
|
|
284
|
+
* Transform the EC2 bastion security group resource.
|
|
285
|
+
*/
|
|
286
|
+
bastionSecurityGroup?: Transform<ec2.SecurityGroupArgs>;
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
interface VpcRef {
|
|
291
|
+
ref: boolean;
|
|
292
|
+
vpcId: Input<string>;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* The `Vpc` component lets you add a VPC to your app. It uses [Amazon VPC](https://docs.aws.amazon.com/vpc/). This is useful for services like RDS and Fargate that need to be hosted inside
|
|
297
|
+
* a VPC.
|
|
298
|
+
*
|
|
299
|
+
* This creates a VPC with 2 Availability Zones by default. It also creates the following
|
|
300
|
+
* resources:
|
|
301
|
+
*
|
|
302
|
+
* 1. A default security group blocking all incoming internet traffic.
|
|
303
|
+
* 2. A public subnet in each AZ.
|
|
304
|
+
* 3. A private subnet in each AZ.
|
|
305
|
+
* 4. An Internet Gateway. All the traffic from the public subnets are routed through it.
|
|
306
|
+
* 5. If `nat` is enabled, a NAT Gateway or NAT instance in each AZ. All the traffic from
|
|
307
|
+
* the private subnets are routed to the NAT in the same AZ.
|
|
308
|
+
*
|
|
309
|
+
* :::note
|
|
310
|
+
* By default, this does not create NAT Gateways or NAT instances.
|
|
311
|
+
* :::
|
|
312
|
+
*
|
|
313
|
+
* @example
|
|
314
|
+
*
|
|
315
|
+
* #### Create a VPC
|
|
316
|
+
*
|
|
317
|
+
* ```ts title="sst.config.ts"
|
|
318
|
+
* new sst.aws.Vpc("MyVPC");
|
|
319
|
+
* ```
|
|
320
|
+
*
|
|
321
|
+
* #### Create it with 3 Availability Zones
|
|
322
|
+
*
|
|
323
|
+
* ```ts title="sst.config.ts" {2}
|
|
324
|
+
* new sst.aws.Vpc("MyVPC", {
|
|
325
|
+
* az: 3
|
|
326
|
+
* });
|
|
327
|
+
* ```
|
|
328
|
+
*
|
|
329
|
+
* #### Enable NAT
|
|
330
|
+
*
|
|
331
|
+
* ```ts title="sst.config.ts" {2}
|
|
332
|
+
* new sst.aws.Vpc("MyVPC", {
|
|
333
|
+
* nat: "managed"
|
|
334
|
+
* });
|
|
335
|
+
* ```
|
|
336
|
+
*
|
|
337
|
+
* ---
|
|
338
|
+
*
|
|
339
|
+
* ### Cost
|
|
340
|
+
*
|
|
341
|
+
* By default, this component costs **$0.50 per month** for the CloudMap hosted zone used for
|
|
342
|
+
* service discovery. Following is the cost to enable the `nat` or `bastion` options.
|
|
343
|
+
*
|
|
344
|
+
* #### Managed NAT
|
|
345
|
+
*
|
|
346
|
+
* If you enable `nat` with the `managed` option, it uses a _NAT Gateway_ per `az` at $0.045 per
|
|
347
|
+
* hour, and $0.045 per GB processed per month.
|
|
348
|
+
*
|
|
349
|
+
* That works out to a minimum of $0.045 x 2 x 24 x 30 or **$65 per month**. Adjust this for the
|
|
350
|
+
* number of `az` and add $0.045 per GB processed per month.
|
|
351
|
+
*
|
|
352
|
+
* The above are rough estimates for _us-east-1_, check out the
|
|
353
|
+
* [NAT Gateway pricing](https://aws.amazon.com/vpc/pricing/) for more details. Standard [data
|
|
354
|
+
* transfer charges](https://aws.amazon.com/ec2/pricing/on-demand/#Data_Transfer) apply.
|
|
355
|
+
*
|
|
356
|
+
* #### EC2 NAT
|
|
357
|
+
*
|
|
358
|
+
* If you enable `nat` with the `ec2` option, it uses `t4g.nano` EC2 _On Demand_ instances per
|
|
359
|
+
* `az` at $0.0042 per hour, and $0.09 per GB processed per month for the first 10TB.
|
|
360
|
+
*
|
|
361
|
+
* That works out to a minimum of $0.0042 x 2 x 24 x 30 or **$6 per month**. Adjust this for the
|
|
362
|
+
* `nat.ec2.instance` you are using and add $0.09 per GB processed per month.
|
|
363
|
+
*
|
|
364
|
+
* The above are rough estimates for _us-east-1_, check out the
|
|
365
|
+
* [EC2 On-Demand pricing](https://aws.amazon.com/vpc/pricing/) and the
|
|
366
|
+
* [EC2 Data Transfer pricing](https://aws.amazon.com/ec2/pricing/on-demand/#Data_Transfer)
|
|
367
|
+
* for more details.
|
|
368
|
+
*
|
|
369
|
+
* #### Bastion
|
|
370
|
+
*
|
|
371
|
+
* If you enable `bastion`, it uses a single `t4g.nano` EC2 _On Demand_ instance at
|
|
372
|
+
* $0.0042 per hour, and $0.09 per GB processed per month for the first 10TB.
|
|
373
|
+
*
|
|
374
|
+
* That works out to $0.0042 x 24 x 30 or **$3 per month**. Add $0.09 per GB processed per month.
|
|
375
|
+
*
|
|
376
|
+
* However if `nat: "ec2"` is enabled, one of the NAT EC2 instances will be reused; making this
|
|
377
|
+
* **free**.
|
|
378
|
+
*
|
|
379
|
+
* The above are rough estimates for _us-east-1_, check out the
|
|
380
|
+
* [EC2 On-Demand pricing](https://aws.amazon.com/vpc/pricing/) and the
|
|
381
|
+
* [EC2 Data Transfer pricing](https://aws.amazon.com/ec2/pricing/on-demand/#Data_Transfer)
|
|
382
|
+
* for more details.
|
|
383
|
+
*/
|
|
384
|
+
export class Vpc extends Component implements Link.Linkable {
|
|
385
|
+
private vpc: ec2.Vpc;
|
|
386
|
+
private internetGateway: ec2.InternetGateway;
|
|
387
|
+
private securityGroup: ec2.SecurityGroup;
|
|
388
|
+
private natGateways: Output<ec2.NatGateway[]>;
|
|
389
|
+
private natInstances: Output<ec2.Instance[]>;
|
|
390
|
+
private natSecurityGroup: Output<ec2.SecurityGroup | undefined>;
|
|
391
|
+
private elasticIps: Output<ec2.Eip[]>;
|
|
392
|
+
private _publicSubnets: Output<ec2.Subnet[]>;
|
|
393
|
+
private _privateSubnets: Output<ec2.Subnet[]>;
|
|
394
|
+
private publicRouteTables: Output<ec2.RouteTable[]>;
|
|
395
|
+
private privateRouteTables: Output<ec2.RouteTable[]>;
|
|
396
|
+
private bastionInstance: Output<ec2.Instance | undefined>;
|
|
397
|
+
private bastionSecurityGroup: Output<ec2.SecurityGroup | undefined>;
|
|
398
|
+
private cloudmapNamespace: servicediscovery.PrivateDnsNamespace;
|
|
399
|
+
private privateKeyValue: Output<string | undefined>;
|
|
400
|
+
public static v1 = VpcV1;
|
|
401
|
+
|
|
402
|
+
constructor(
|
|
403
|
+
name: string,
|
|
404
|
+
args: VpcArgs = {},
|
|
405
|
+
opts?: ComponentResourceOptions,
|
|
406
|
+
) {
|
|
407
|
+
super(__pulumiType, name, args, opts);
|
|
408
|
+
const _version = 2;
|
|
409
|
+
const _refVersion = 2;
|
|
410
|
+
const self = this;
|
|
411
|
+
|
|
412
|
+
if (args && "ref" in args) {
|
|
413
|
+
const ref = reference();
|
|
414
|
+
this.vpc = ref.vpc;
|
|
415
|
+
this.internetGateway = ref.internetGateway;
|
|
416
|
+
this.securityGroup = ref.securityGroup;
|
|
417
|
+
this._publicSubnets = output(ref.publicSubnets);
|
|
418
|
+
this._privateSubnets = output(ref.privateSubnets);
|
|
419
|
+
this.publicRouteTables = output(ref.publicRouteTables);
|
|
420
|
+
this.privateRouteTables = output(ref.privateRouteTables);
|
|
421
|
+
this.natGateways = output(ref.natGateways);
|
|
422
|
+
this.natInstances = output(ref.natInstances);
|
|
423
|
+
this.natSecurityGroup = output(ref.natSecurityGroup);
|
|
424
|
+
this.elasticIps = ref.elasticIps;
|
|
425
|
+
this.bastionInstance = ref.bastionInstance;
|
|
426
|
+
this.bastionSecurityGroup = output(ref.bastionSecurityGroup);
|
|
427
|
+
this.cloudmapNamespace = ref.cloudmapNamespace;
|
|
428
|
+
this.privateKeyValue = output(ref.privateKeyValue);
|
|
429
|
+
registerOutputs();
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
registerVersion();
|
|
434
|
+
const zones = normalizeAz();
|
|
435
|
+
const nat = normalizeNat();
|
|
436
|
+
const bastion = normalizeBastion();
|
|
437
|
+
const partition = getPartitionOutput({}, opts).partition;
|
|
438
|
+
|
|
439
|
+
const vpc = createVpc();
|
|
440
|
+
const { keyPair, privateKeyValue } = createKeyPair();
|
|
441
|
+
const internetGateway = createInternetGateway();
|
|
442
|
+
const securityGroup = createSecurityGroup();
|
|
443
|
+
const { publicSubnets, publicRouteTables } = createPublicSubnets();
|
|
444
|
+
const elasticIps = createElasticIps();
|
|
445
|
+
const natGateways = createNatGateways();
|
|
446
|
+
const { natInstances, natSecurityGroup } = createNatInstances();
|
|
447
|
+
const { privateSubnets, privateRouteTables } = createPrivateSubnets();
|
|
448
|
+
const { bastionInstance, bastionSecurityGroup } = createBastion();
|
|
449
|
+
const cloudmapNamespace = createCloudmapNamespace();
|
|
450
|
+
|
|
451
|
+
this.vpc = vpc;
|
|
452
|
+
this.internetGateway = internetGateway;
|
|
453
|
+
this.securityGroup = securityGroup;
|
|
454
|
+
this.natGateways = natGateways;
|
|
455
|
+
this.natInstances = natInstances;
|
|
456
|
+
this.natSecurityGroup = natSecurityGroup;
|
|
457
|
+
this.elasticIps = elasticIps;
|
|
458
|
+
this._publicSubnets = publicSubnets;
|
|
459
|
+
this._privateSubnets = privateSubnets;
|
|
460
|
+
this.publicRouteTables = publicRouteTables;
|
|
461
|
+
this.privateRouteTables = privateRouteTables;
|
|
462
|
+
this.bastionInstance = output(bastionInstance);
|
|
463
|
+
this.bastionSecurityGroup = bastionSecurityGroup;
|
|
464
|
+
this.cloudmapNamespace = cloudmapNamespace;
|
|
465
|
+
this.privateKeyValue = output(privateKeyValue);
|
|
466
|
+
registerOutputs();
|
|
467
|
+
|
|
468
|
+
function reference() {
|
|
469
|
+
const ref = args as VpcRef;
|
|
470
|
+
const vpc = ec2.Vpc.get(`${name}Vpc`, ref.vpcId, undefined, {
|
|
471
|
+
parent: self,
|
|
472
|
+
});
|
|
473
|
+
|
|
474
|
+
const vpcId = vpc.tagsAll.apply((tags) => {
|
|
475
|
+
registerVersion(
|
|
476
|
+
tags?.["sst:component-version"]
|
|
477
|
+
? parseInt(tags["sst:component-version"])
|
|
478
|
+
: undefined,
|
|
479
|
+
);
|
|
480
|
+
|
|
481
|
+
if (tags?.["sst:ref-version"] !== _refVersion.toString()) {
|
|
482
|
+
throw new VisibleError(
|
|
483
|
+
[
|
|
484
|
+
`There have been some minor changes to the "Vpc" component that's being referenced by "${name}".\n`,
|
|
485
|
+
`To update, you'll need to redeploy the stage where the VPC was created. And then redeploy this stage.`,
|
|
486
|
+
].join("\n"),
|
|
487
|
+
);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
return output(ref.vpcId);
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
const internetGateway = ec2.InternetGateway.get(
|
|
494
|
+
`${name}InstanceGateway`,
|
|
495
|
+
ec2.getInternetGatewayOutput(
|
|
496
|
+
{
|
|
497
|
+
filters: [{ name: "attachment.vpc-id", values: [vpcId] }],
|
|
498
|
+
},
|
|
499
|
+
{ parent: self },
|
|
500
|
+
).internetGatewayId,
|
|
501
|
+
undefined,
|
|
502
|
+
{ parent: self },
|
|
503
|
+
);
|
|
504
|
+
const securityGroup = ec2.SecurityGroup.get(
|
|
505
|
+
`${name}SecurityGroup`,
|
|
506
|
+
all([
|
|
507
|
+
ec2
|
|
508
|
+
.getSecurityGroupsOutput(
|
|
509
|
+
{
|
|
510
|
+
filters: [
|
|
511
|
+
{ name: "group-name", values: ["default"] },
|
|
512
|
+
{ name: "vpc-id", values: [vpcId] },
|
|
513
|
+
],
|
|
514
|
+
},
|
|
515
|
+
{ parent: self },
|
|
516
|
+
)
|
|
517
|
+
.ids,
|
|
518
|
+
vpcId,
|
|
519
|
+
]).apply(([ids, vpcId]) => {
|
|
520
|
+
if (!ids.length) {
|
|
521
|
+
throw new VisibleError(
|
|
522
|
+
`Security group not found in VPC ${vpcId}`,
|
|
523
|
+
);
|
|
524
|
+
}
|
|
525
|
+
return ids[0];
|
|
526
|
+
}),
|
|
527
|
+
undefined,
|
|
528
|
+
{ parent: self },
|
|
529
|
+
);
|
|
530
|
+
const privateSubnets = ec2
|
|
531
|
+
.getSubnetsOutput(
|
|
532
|
+
{
|
|
533
|
+
filters: [
|
|
534
|
+
{ name: "vpc-id", values: [vpcId] },
|
|
535
|
+
{ name: "tag:Name", values: ["*Private*"] },
|
|
536
|
+
],
|
|
537
|
+
},
|
|
538
|
+
{ parent: self },
|
|
539
|
+
)
|
|
540
|
+
.ids.apply((ids) =>
|
|
541
|
+
ids.map((id, i) =>
|
|
542
|
+
ec2.Subnet.get(`${name}PrivateSubnet${i + 1}`, id, undefined, {
|
|
543
|
+
parent: self,
|
|
544
|
+
}),
|
|
545
|
+
),
|
|
546
|
+
);
|
|
547
|
+
const privateRouteTables = privateSubnets.apply((subnets) =>
|
|
548
|
+
subnets.map((subnet, i) =>
|
|
549
|
+
ec2.RouteTable.get(
|
|
550
|
+
`${name}PrivateRouteTable${i + 1}`,
|
|
551
|
+
ec2.getRouteTableOutput({ subnetId: subnet.id }, { parent: self })
|
|
552
|
+
.routeTableId,
|
|
553
|
+
undefined,
|
|
554
|
+
{ parent: self },
|
|
555
|
+
),
|
|
556
|
+
),
|
|
557
|
+
);
|
|
558
|
+
const publicSubnets = ec2
|
|
559
|
+
.getSubnetsOutput(
|
|
560
|
+
{
|
|
561
|
+
filters: [
|
|
562
|
+
{ name: "vpc-id", values: [vpcId] },
|
|
563
|
+
{ name: "tag:Name", values: ["*Public*"] },
|
|
564
|
+
],
|
|
565
|
+
},
|
|
566
|
+
{ parent: self },
|
|
567
|
+
)
|
|
568
|
+
.ids.apply((ids) =>
|
|
569
|
+
ids.map((id, i) =>
|
|
570
|
+
ec2.Subnet.get(`${name}PublicSubnet${i + 1}`, id, undefined, {
|
|
571
|
+
parent: self,
|
|
572
|
+
}),
|
|
573
|
+
),
|
|
574
|
+
);
|
|
575
|
+
const publicRouteTables = publicSubnets.apply((subnets) =>
|
|
576
|
+
subnets.map((subnet, i) =>
|
|
577
|
+
ec2.RouteTable.get(
|
|
578
|
+
`${name}PublicRouteTable${i + 1}`,
|
|
579
|
+
ec2.getRouteTableOutput({ subnetId: subnet.id }, { parent: self })
|
|
580
|
+
.routeTableId,
|
|
581
|
+
undefined,
|
|
582
|
+
{ parent: self },
|
|
583
|
+
),
|
|
584
|
+
),
|
|
585
|
+
);
|
|
586
|
+
const natGateways = publicSubnets.apply((subnets) => {
|
|
587
|
+
const natGatewayIds = subnets.map((subnet, i) =>
|
|
588
|
+
ec2
|
|
589
|
+
.getNatGatewaysOutput(
|
|
590
|
+
{
|
|
591
|
+
filters: [
|
|
592
|
+
{ name: "subnet-id", values: [subnet.id] },
|
|
593
|
+
{ name: "state", values: ["available"] },
|
|
594
|
+
],
|
|
595
|
+
},
|
|
596
|
+
{ parent: self },
|
|
597
|
+
)
|
|
598
|
+
.ids.apply((ids) => ids[0]),
|
|
599
|
+
);
|
|
600
|
+
return output(natGatewayIds).apply((ids) =>
|
|
601
|
+
ids
|
|
602
|
+
.filter((id) => id)
|
|
603
|
+
.map((id, i) =>
|
|
604
|
+
ec2.NatGateway.get(`${name}NatGateway${i + 1}`, id, undefined, {
|
|
605
|
+
parent: self,
|
|
606
|
+
}),
|
|
607
|
+
),
|
|
608
|
+
);
|
|
609
|
+
});
|
|
610
|
+
const natInstances = ec2
|
|
611
|
+
.getInstancesOutput(
|
|
612
|
+
{
|
|
613
|
+
filters: [
|
|
614
|
+
{ name: "tag:sst:is-nat", values: ["true"] },
|
|
615
|
+
{ name: "vpc-id", values: [vpcId] },
|
|
616
|
+
],
|
|
617
|
+
},
|
|
618
|
+
{ parent: self },
|
|
619
|
+
)
|
|
620
|
+
.ids.apply((ids) =>
|
|
621
|
+
ids.map((id, i) =>
|
|
622
|
+
ec2.Instance.get(`${name}NatInstance${i + 1}`, id, undefined, {
|
|
623
|
+
parent: self,
|
|
624
|
+
}),
|
|
625
|
+
),
|
|
626
|
+
);
|
|
627
|
+
const natSecurityGroup = ec2
|
|
628
|
+
.getSecurityGroupsOutput(
|
|
629
|
+
{
|
|
630
|
+
filters: [
|
|
631
|
+
{ name: "tag:sst:is-nat-sg", values: ["true"] },
|
|
632
|
+
{ name: "vpc-id", values: [vpcId] },
|
|
633
|
+
],
|
|
634
|
+
},
|
|
635
|
+
{ parent: self },
|
|
636
|
+
)
|
|
637
|
+
.ids.apply((ids) =>
|
|
638
|
+
ids.length
|
|
639
|
+
? ec2.SecurityGroup.get(`${name}NatInstanceSecurityGroup`, ids[0], undefined, {
|
|
640
|
+
parent: self
|
|
641
|
+
})
|
|
642
|
+
: undefined,
|
|
643
|
+
);
|
|
644
|
+
const elasticIps = all([natGateways, natInstances]).apply(
|
|
645
|
+
([natGateways, natInstances]) => {
|
|
646
|
+
if (natGateways.length) {
|
|
647
|
+
return output(
|
|
648
|
+
natGateways.map((nat, i) =>
|
|
649
|
+
ec2.Eip.get(
|
|
650
|
+
`${name}ElasticIp${i + 1}`,
|
|
651
|
+
nat.allocationId as Output<string>,
|
|
652
|
+
undefined,
|
|
653
|
+
{ parent: self },
|
|
654
|
+
),
|
|
655
|
+
),
|
|
656
|
+
);
|
|
657
|
+
}
|
|
658
|
+
if (natInstances.length) {
|
|
659
|
+
return ec2
|
|
660
|
+
.getEipsOutput(
|
|
661
|
+
{
|
|
662
|
+
filters: [
|
|
663
|
+
{
|
|
664
|
+
name: "instance-id",
|
|
665
|
+
values: natInstances.map((instance) => instance.id),
|
|
666
|
+
},
|
|
667
|
+
],
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
parent: self,
|
|
671
|
+
},
|
|
672
|
+
)
|
|
673
|
+
.allocationIds.apply((ids) =>
|
|
674
|
+
ids.map((id, i) =>
|
|
675
|
+
ec2.Eip.get(`${name}ElasticIp${i + 1}`, id, undefined, {
|
|
676
|
+
parent: self,
|
|
677
|
+
}),
|
|
678
|
+
),
|
|
679
|
+
);
|
|
680
|
+
}
|
|
681
|
+
return output([]);
|
|
682
|
+
},
|
|
683
|
+
);
|
|
684
|
+
const bastionInstance = ec2
|
|
685
|
+
.getInstancesOutput(
|
|
686
|
+
{
|
|
687
|
+
filters: [
|
|
688
|
+
{ name: "tag:sst:is-bastion", values: ["true"] },
|
|
689
|
+
{ name: "vpc-id", values: [vpcId] },
|
|
690
|
+
],
|
|
691
|
+
},
|
|
692
|
+
{ parent: self },
|
|
693
|
+
)
|
|
694
|
+
.ids.apply((ids) =>
|
|
695
|
+
ids.length
|
|
696
|
+
? ec2.Instance.get(`${name}BastionInstance`, ids[0], undefined, {
|
|
697
|
+
parent: self,
|
|
698
|
+
})
|
|
699
|
+
: undefined,
|
|
700
|
+
);
|
|
701
|
+
const bastionSecurityGroup = ec2
|
|
702
|
+
.getSecurityGroupsOutput(
|
|
703
|
+
{
|
|
704
|
+
filters: [
|
|
705
|
+
{ name: "tag:sst:is-bastion-sg", values: ["true"] },
|
|
706
|
+
{ name: "vpc-id", values: [vpcId] },
|
|
707
|
+
],
|
|
708
|
+
},
|
|
709
|
+
{ parent: self },
|
|
710
|
+
)
|
|
711
|
+
.ids.apply((ids) =>
|
|
712
|
+
ids.length
|
|
713
|
+
? ec2.SecurityGroup.get(`${name}BastionSecurityGroup`, ids[0], undefined, {
|
|
714
|
+
parent: self
|
|
715
|
+
})
|
|
716
|
+
: undefined,
|
|
717
|
+
);
|
|
718
|
+
|
|
719
|
+
// Note: can also use servicediscovery.getDnsNamespaceOutput() here, ie.
|
|
720
|
+
// ```ts
|
|
721
|
+
// const namespaceId = servicediscovery.getDnsNamespaceOutput({
|
|
722
|
+
// name: "sst",
|
|
723
|
+
// type: "DNS_PRIVATE",
|
|
724
|
+
// }).id;
|
|
725
|
+
// ```
|
|
726
|
+
// but if user deployed multiple VPCs into the same account. This will error because
|
|
727
|
+
// there are multiple results. Even though `getDnsNamespaceOutput()` takes tags in args,
|
|
728
|
+
// the tags are not used for lookup.
|
|
729
|
+
const zone = output(vpcId).apply((vpcId) =>
|
|
730
|
+
route53.getZone(
|
|
731
|
+
{
|
|
732
|
+
name: "sst",
|
|
733
|
+
privateZone: true,
|
|
734
|
+
vpcId,
|
|
735
|
+
},
|
|
736
|
+
{ parent: self },
|
|
737
|
+
),
|
|
738
|
+
);
|
|
739
|
+
const namespaceId = zone.linkedServiceDescription.apply((description) => {
|
|
740
|
+
const match = description.match(/:namespace\/(ns-[a-z1-9]*)/)?.[1];
|
|
741
|
+
if (!match) {
|
|
742
|
+
throw new VisibleError(
|
|
743
|
+
`Cloud Map namespace not found for VPC ${vpcId}`,
|
|
744
|
+
);
|
|
745
|
+
}
|
|
746
|
+
return match;
|
|
747
|
+
});
|
|
748
|
+
const cloudmapNamespace = servicediscovery.PrivateDnsNamespace.get(
|
|
749
|
+
`${name}CloudmapNamespace`,
|
|
750
|
+
namespaceId,
|
|
751
|
+
{ vpc: vpcId },
|
|
752
|
+
{ parent: self },
|
|
753
|
+
);
|
|
754
|
+
|
|
755
|
+
const privateKeyValue = bastionInstance.apply((v) => {
|
|
756
|
+
if (!v) return;
|
|
757
|
+
const param = ssm.Parameter.get(
|
|
758
|
+
`${name}PrivateKeyValue`,
|
|
759
|
+
interpolate`/sst/vpc/${vpcId}/private-key-value`,
|
|
760
|
+
undefined,
|
|
761
|
+
{ parent: self },
|
|
762
|
+
);
|
|
763
|
+
return param.value;
|
|
764
|
+
});
|
|
765
|
+
|
|
766
|
+
return {
|
|
767
|
+
vpc,
|
|
768
|
+
internetGateway,
|
|
769
|
+
securityGroup,
|
|
770
|
+
publicSubnets,
|
|
771
|
+
publicRouteTables,
|
|
772
|
+
privateSubnets,
|
|
773
|
+
privateRouteTables,
|
|
774
|
+
natGateways,
|
|
775
|
+
natInstances,
|
|
776
|
+
natSecurityGroup,
|
|
777
|
+
elasticIps,
|
|
778
|
+
bastionInstance,
|
|
779
|
+
bastionSecurityGroup,
|
|
780
|
+
cloudmapNamespace,
|
|
781
|
+
privateKeyValue,
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
function registerVersion(overrideVersion?: number) {
|
|
786
|
+
self.registerVersion({
|
|
787
|
+
new: _version,
|
|
788
|
+
old: overrideVersion ?? $cli.state.version[name],
|
|
789
|
+
message: [
|
|
790
|
+
`There is a new version of "Vpc" that has breaking changes.`,
|
|
791
|
+
``,
|
|
792
|
+
`To continue using the previous version, rename "Vpc" to "Vpc.v${$cli.state.version[name]}". Or recreate this component to update - https://sst-community.github.io/sst/docs/components/#versioning`,
|
|
793
|
+
].join("\n"),
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
function registerOutputs() {
|
|
798
|
+
self.registerOutputs({
|
|
799
|
+
_tunnel: all([
|
|
800
|
+
self.bastionInstance,
|
|
801
|
+
self.elasticIps,
|
|
802
|
+
self.natInstances,
|
|
803
|
+
self.privateKeyValue,
|
|
804
|
+
self._privateSubnets,
|
|
805
|
+
self._publicSubnets,
|
|
806
|
+
]).apply(
|
|
807
|
+
([
|
|
808
|
+
bastion,
|
|
809
|
+
elasticIps,
|
|
810
|
+
natInstances,
|
|
811
|
+
privateKeyValue,
|
|
812
|
+
privateSubnets,
|
|
813
|
+
publicSubnets,
|
|
814
|
+
]) => {
|
|
815
|
+
if (!bastion) return;
|
|
816
|
+
return {
|
|
817
|
+
ip:
|
|
818
|
+
natInstances.length && elasticIps[0]
|
|
819
|
+
? elasticIps[0].publicIp
|
|
820
|
+
: bastion.publicIp,
|
|
821
|
+
username: "ec2-user",
|
|
822
|
+
privateKey: privateKeyValue!,
|
|
823
|
+
subnets: [...privateSubnets, ...publicSubnets].map(
|
|
824
|
+
(s) => s.cidrBlock,
|
|
825
|
+
),
|
|
826
|
+
};
|
|
827
|
+
},
|
|
828
|
+
),
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
function normalizeAz() {
|
|
833
|
+
return output(args.az).apply((az) => {
|
|
834
|
+
if (Array.isArray(az)) return output(az);
|
|
835
|
+
|
|
836
|
+
const zones = getAvailabilityZonesOutput(
|
|
837
|
+
{
|
|
838
|
+
state: "available",
|
|
839
|
+
},
|
|
840
|
+
{ parent: self },
|
|
841
|
+
);
|
|
842
|
+
return all([zones, args.az ?? 2]).apply(([zones, az]) =>
|
|
843
|
+
Array(az)
|
|
844
|
+
.fill(0)
|
|
845
|
+
.map((_, i) => zones.names[i]),
|
|
846
|
+
);
|
|
847
|
+
});
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
function normalizeNat() {
|
|
851
|
+
return all([args.nat, zones]).apply(([nat, zones]) => {
|
|
852
|
+
if (nat === "managed") {
|
|
853
|
+
return { type: "managed" as const };
|
|
854
|
+
}
|
|
855
|
+
if (nat === "ec2") {
|
|
856
|
+
return {
|
|
857
|
+
type: "ec2" as const,
|
|
858
|
+
ec2: { instance: "t4g.nano", ami: undefined, role: undefined },
|
|
859
|
+
};
|
|
860
|
+
}
|
|
861
|
+
if (nat) {
|
|
862
|
+
if (nat.ec2 && nat.type === "managed")
|
|
863
|
+
throw new VisibleError(
|
|
864
|
+
`The "nat.type" cannot be "managed" when "nat.ec2" is specified.`,
|
|
865
|
+
);
|
|
866
|
+
|
|
867
|
+
if (!nat.type && !nat.ec2)
|
|
868
|
+
throw new VisibleError(
|
|
869
|
+
`Missing "nat.type" for the "${name}" VPC. It is required when "nat.ec2" is not specified.`,
|
|
870
|
+
);
|
|
871
|
+
|
|
872
|
+
if (nat.ip && nat.ip.length !== zones.length)
|
|
873
|
+
throw new VisibleError(
|
|
874
|
+
`The number of Elastic IP allocation IDs must match the number of AZs.`,
|
|
875
|
+
);
|
|
876
|
+
|
|
877
|
+
return nat.ec2 || nat.type === "ec2"
|
|
878
|
+
? {
|
|
879
|
+
type: "ec2" as const,
|
|
880
|
+
ip: nat.ip,
|
|
881
|
+
ec2: {
|
|
882
|
+
instance: nat.ec2?.instance ?? "t4g.nano",
|
|
883
|
+
ami: nat.ec2?.ami,
|
|
884
|
+
role: nat.ec2?.role,
|
|
885
|
+
},
|
|
886
|
+
}
|
|
887
|
+
: {
|
|
888
|
+
type: "managed" as const,
|
|
889
|
+
ip: nat.ip,
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
return undefined;
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
function normalizeBastion() {
|
|
897
|
+
return output(args.bastion).apply((bastion) => {
|
|
898
|
+
if (!bastion) return { enabled: false, instanceProfileName: undefined };
|
|
899
|
+
if (typeof bastion === "boolean")
|
|
900
|
+
return { enabled: bastion, instanceProfileName: undefined };
|
|
901
|
+
|
|
902
|
+
return {
|
|
903
|
+
enabled: true,
|
|
904
|
+
instanceProfileName: bastion.instanceProfile,
|
|
905
|
+
};
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
function createVpc() {
|
|
910
|
+
return new ec2.Vpc(
|
|
911
|
+
...transform(
|
|
912
|
+
args.transform?.vpc,
|
|
913
|
+
`${name}Vpc`,
|
|
914
|
+
{
|
|
915
|
+
cidrBlock: "10.0.0.0/16",
|
|
916
|
+
enableDnsSupport: true,
|
|
917
|
+
enableDnsHostnames: true,
|
|
918
|
+
tags: {
|
|
919
|
+
Name: `${$app.name}-${$app.stage}-${name} VPC`,
|
|
920
|
+
"sst:component-version": _version.toString(),
|
|
921
|
+
"sst:ref-version": _refVersion.toString(),
|
|
922
|
+
},
|
|
923
|
+
},
|
|
924
|
+
{ parent: self },
|
|
925
|
+
),
|
|
926
|
+
);
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
function createKeyPair() {
|
|
930
|
+
const ret = bastion.apply((bastion) => {
|
|
931
|
+
if (!bastion.enabled) return {};
|
|
932
|
+
|
|
933
|
+
const tlsPrivateKey = new PrivateKey(
|
|
934
|
+
`${name}TlsPrivateKey`,
|
|
935
|
+
{
|
|
936
|
+
algorithm: "RSA",
|
|
937
|
+
rsaBits: 4096,
|
|
938
|
+
},
|
|
939
|
+
{ parent: self },
|
|
940
|
+
);
|
|
941
|
+
|
|
942
|
+
new ssm.Parameter(
|
|
943
|
+
`${name}PrivateKeyValue`,
|
|
944
|
+
{
|
|
945
|
+
name: interpolate`/sst/vpc/${vpc.id}/private-key-value`,
|
|
946
|
+
description: "Bastion host private key",
|
|
947
|
+
type: ssm.ParameterType.SecureString,
|
|
948
|
+
value: tlsPrivateKey.privateKeyOpenssh,
|
|
949
|
+
},
|
|
950
|
+
{ parent: self },
|
|
951
|
+
);
|
|
952
|
+
|
|
953
|
+
const keyPair = new ec2.KeyPair(
|
|
954
|
+
`${name}KeyPair`,
|
|
955
|
+
{
|
|
956
|
+
publicKey: tlsPrivateKey.publicKeyOpenssh,
|
|
957
|
+
},
|
|
958
|
+
{ parent: self },
|
|
959
|
+
);
|
|
960
|
+
|
|
961
|
+
return { keyPair, privateKeyValue: tlsPrivateKey.privateKeyOpenssh };
|
|
962
|
+
});
|
|
963
|
+
return {
|
|
964
|
+
keyPair: output(ret.keyPair),
|
|
965
|
+
privateKeyValue: output(ret.privateKeyValue),
|
|
966
|
+
};
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
function createInternetGateway() {
|
|
970
|
+
return new ec2.InternetGateway(
|
|
971
|
+
...transform(
|
|
972
|
+
args.transform?.internetGateway,
|
|
973
|
+
`${name}InternetGateway`,
|
|
974
|
+
{
|
|
975
|
+
vpcId: vpc.id,
|
|
976
|
+
},
|
|
977
|
+
{ parent: self },
|
|
978
|
+
),
|
|
979
|
+
);
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
function createSecurityGroup() {
|
|
983
|
+
return new ec2.DefaultSecurityGroup(
|
|
984
|
+
...transform(
|
|
985
|
+
args.transform?.securityGroup,
|
|
986
|
+
`${name}SecurityGroup`,
|
|
987
|
+
{
|
|
988
|
+
description: "Managed by SST",
|
|
989
|
+
vpcId: vpc.id,
|
|
990
|
+
egress: [
|
|
991
|
+
{
|
|
992
|
+
fromPort: 0,
|
|
993
|
+
toPort: 0,
|
|
994
|
+
protocol: "-1",
|
|
995
|
+
cidrBlocks: ["0.0.0.0/0"],
|
|
996
|
+
},
|
|
997
|
+
],
|
|
998
|
+
ingress: [
|
|
999
|
+
{
|
|
1000
|
+
fromPort: 0,
|
|
1001
|
+
toPort: 0,
|
|
1002
|
+
protocol: "-1",
|
|
1003
|
+
// Restricts inbound traffic to only within the VPC
|
|
1004
|
+
cidrBlocks: [vpc.cidrBlock],
|
|
1005
|
+
},
|
|
1006
|
+
],
|
|
1007
|
+
},
|
|
1008
|
+
{ parent: self },
|
|
1009
|
+
),
|
|
1010
|
+
);
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
function createElasticIps() {
|
|
1014
|
+
return all([nat, publicSubnets]).apply(([nat, subnets]) => {
|
|
1015
|
+
if (!nat) return [];
|
|
1016
|
+
if (nat.ip)
|
|
1017
|
+
return nat.ip.map((allocationId, i) =>
|
|
1018
|
+
ec2.Eip.get(`${name}ElasticIp${i + 1}`, allocationId, undefined, {
|
|
1019
|
+
parent: self,
|
|
1020
|
+
}),
|
|
1021
|
+
);
|
|
1022
|
+
|
|
1023
|
+
return subnets.map(
|
|
1024
|
+
(_, i) =>
|
|
1025
|
+
new ec2.Eip(
|
|
1026
|
+
...transform(
|
|
1027
|
+
args.transform?.elasticIp,
|
|
1028
|
+
`${name}ElasticIp${i + 1}`,
|
|
1029
|
+
{
|
|
1030
|
+
domain: "vpc",
|
|
1031
|
+
},
|
|
1032
|
+
{ parent: self },
|
|
1033
|
+
),
|
|
1034
|
+
),
|
|
1035
|
+
);
|
|
1036
|
+
});
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
function createNatGateways() {
|
|
1040
|
+
return all([nat, publicSubnets, elasticIps]).apply(
|
|
1041
|
+
([nat, subnets, elasticIps]) => {
|
|
1042
|
+
if (nat?.type !== "managed") return [];
|
|
1043
|
+
|
|
1044
|
+
return subnets.map(
|
|
1045
|
+
(subnet, i) =>
|
|
1046
|
+
new ec2.NatGateway(
|
|
1047
|
+
...transform(
|
|
1048
|
+
args.transform?.natGateway,
|
|
1049
|
+
`${name}NatGateway${i + 1}`,
|
|
1050
|
+
{
|
|
1051
|
+
subnetId: subnet.id,
|
|
1052
|
+
allocationId: elasticIps[i]?.id ?? nat.ip![i],
|
|
1053
|
+
},
|
|
1054
|
+
{ parent: self },
|
|
1055
|
+
),
|
|
1056
|
+
),
|
|
1057
|
+
);
|
|
1058
|
+
},
|
|
1059
|
+
);
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
function createNatInstances() {
|
|
1063
|
+
return nat.apply((nat) => {
|
|
1064
|
+
if (nat?.type !== "ec2")
|
|
1065
|
+
return output({
|
|
1066
|
+
natSecurityGroup: undefined,
|
|
1067
|
+
natInstances: [] as ec2.Instance[],
|
|
1068
|
+
});
|
|
1069
|
+
|
|
1070
|
+
const natSecurityGroup = new ec2.SecurityGroup(
|
|
1071
|
+
...transform(
|
|
1072
|
+
args.transform?.natSecurityGroup,
|
|
1073
|
+
`${name}NatInstanceSecurityGroup`,
|
|
1074
|
+
{
|
|
1075
|
+
vpcId: vpc.id,
|
|
1076
|
+
ingress: [
|
|
1077
|
+
{
|
|
1078
|
+
protocol: "-1",
|
|
1079
|
+
fromPort: 0,
|
|
1080
|
+
toPort: 0,
|
|
1081
|
+
cidrBlocks: ["0.0.0.0/0"],
|
|
1082
|
+
},
|
|
1083
|
+
],
|
|
1084
|
+
egress: [
|
|
1085
|
+
{
|
|
1086
|
+
protocol: "-1",
|
|
1087
|
+
fromPort: 0,
|
|
1088
|
+
toPort: 0,
|
|
1089
|
+
cidrBlocks: ["0.0.0.0/0"],
|
|
1090
|
+
},
|
|
1091
|
+
],
|
|
1092
|
+
tags: {
|
|
1093
|
+
"sst:is-nat-sg": "true",
|
|
1094
|
+
},
|
|
1095
|
+
},
|
|
1096
|
+
{ parent: self },
|
|
1097
|
+
),
|
|
1098
|
+
);
|
|
1099
|
+
|
|
1100
|
+
const role = nat.ec2.role
|
|
1101
|
+
? iam.Role.get(
|
|
1102
|
+
`${name}NatInstanceRole`,
|
|
1103
|
+
nat.ec2.role,
|
|
1104
|
+
{},
|
|
1105
|
+
{ parent: self },
|
|
1106
|
+
)
|
|
1107
|
+
: new iam.Role(
|
|
1108
|
+
`${name}NatInstanceRole`,
|
|
1109
|
+
{
|
|
1110
|
+
assumeRolePolicy: iam.getPolicyDocumentOutput({
|
|
1111
|
+
statements: [
|
|
1112
|
+
{
|
|
1113
|
+
actions: ["sts:AssumeRole"],
|
|
1114
|
+
principals: [
|
|
1115
|
+
{
|
|
1116
|
+
type: "Service",
|
|
1117
|
+
identifiers: ["ec2.amazonaws.com"],
|
|
1118
|
+
},
|
|
1119
|
+
],
|
|
1120
|
+
},
|
|
1121
|
+
],
|
|
1122
|
+
}).json,
|
|
1123
|
+
managedPolicyArns: [
|
|
1124
|
+
interpolate`arn:${partition}:iam::aws:policy/AmazonSSMManagedInstanceCore`,
|
|
1125
|
+
],
|
|
1126
|
+
},
|
|
1127
|
+
{ parent: self },
|
|
1128
|
+
);
|
|
1129
|
+
|
|
1130
|
+
const instanceProfile = new iam.InstanceProfile(
|
|
1131
|
+
`${name}NatInstanceProfile`,
|
|
1132
|
+
{ role: role.name },
|
|
1133
|
+
{ parent: self },
|
|
1134
|
+
);
|
|
1135
|
+
|
|
1136
|
+
const ami =
|
|
1137
|
+
nat.ec2.ami ??
|
|
1138
|
+
ec2.getAmiOutput(
|
|
1139
|
+
{
|
|
1140
|
+
owners: ["568608671756"], // AWS account ID for fck-nat AMI
|
|
1141
|
+
filters: [
|
|
1142
|
+
{
|
|
1143
|
+
name: "name",
|
|
1144
|
+
// The AMI has the SSM agent pre-installed
|
|
1145
|
+
values: ["fck-nat-al2023-*"],
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
name: "architecture",
|
|
1149
|
+
values: ["arm64"],
|
|
1150
|
+
},
|
|
1151
|
+
],
|
|
1152
|
+
mostRecent: true,
|
|
1153
|
+
},
|
|
1154
|
+
{ parent: self },
|
|
1155
|
+
).id;
|
|
1156
|
+
|
|
1157
|
+
return all([zones, publicSubnets, elasticIps, keyPair, bastion, natSecurityGroup]).apply(
|
|
1158
|
+
([zones, publicSubnets, elasticIps, keyPair, bastion, natSecurityGroup]) => ({
|
|
1159
|
+
natInstances: zones.map((_, i) => {
|
|
1160
|
+
const instance = new ec2.Instance(
|
|
1161
|
+
...transform(
|
|
1162
|
+
args.transform?.natInstance,
|
|
1163
|
+
`${name}NatInstance${i + 1}`,
|
|
1164
|
+
{
|
|
1165
|
+
instanceType: nat.ec2.instance,
|
|
1166
|
+
ami,
|
|
1167
|
+
subnetId: publicSubnets[i].id,
|
|
1168
|
+
vpcSecurityGroupIds: [natSecurityGroup.id],
|
|
1169
|
+
iamInstanceProfile: instanceProfile.name,
|
|
1170
|
+
sourceDestCheck: false,
|
|
1171
|
+
keyName: keyPair?.keyName,
|
|
1172
|
+
tags: {
|
|
1173
|
+
Name: `${name} NAT Instance`,
|
|
1174
|
+
"sst:is-nat": "true",
|
|
1175
|
+
...(bastion.enabled && i === 0
|
|
1176
|
+
? { "sst:is-bastion": "true" }
|
|
1177
|
+
: {}),
|
|
1178
|
+
},
|
|
1179
|
+
},
|
|
1180
|
+
{ parent: self },
|
|
1181
|
+
),
|
|
1182
|
+
);
|
|
1183
|
+
|
|
1184
|
+
new ec2.EipAssociation(
|
|
1185
|
+
`${name}NatInstanceEipAssociation${i + 1}`,
|
|
1186
|
+
{
|
|
1187
|
+
instanceId: instance.id,
|
|
1188
|
+
allocationId: elasticIps[i]?.id ?? nat.ip![i],
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
parent: self,
|
|
1192
|
+
aliases: [{ parent: rootStackResource }],
|
|
1193
|
+
},
|
|
1194
|
+
);
|
|
1195
|
+
|
|
1196
|
+
return instance;
|
|
1197
|
+
}),
|
|
1198
|
+
natSecurityGroup,
|
|
1199
|
+
}),
|
|
1200
|
+
);
|
|
1201
|
+
});
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
function createPublicSubnets() {
|
|
1205
|
+
const ret = zones.apply((zones) =>
|
|
1206
|
+
zones.map((zone, i) => {
|
|
1207
|
+
const subnet = new ec2.Subnet(
|
|
1208
|
+
...transform(
|
|
1209
|
+
args.transform?.publicSubnet,
|
|
1210
|
+
`${name}PublicSubnet${i + 1}`,
|
|
1211
|
+
{
|
|
1212
|
+
vpcId: vpc.id,
|
|
1213
|
+
cidrBlock: `10.0.${8 * i}.0/22`,
|
|
1214
|
+
availabilityZone: zone,
|
|
1215
|
+
mapPublicIpOnLaunch: true,
|
|
1216
|
+
},
|
|
1217
|
+
{ parent: self },
|
|
1218
|
+
),
|
|
1219
|
+
);
|
|
1220
|
+
|
|
1221
|
+
const routeTable = new ec2.RouteTable(
|
|
1222
|
+
...transform(
|
|
1223
|
+
args.transform?.publicRouteTable,
|
|
1224
|
+
`${name}PublicRouteTable${i + 1}`,
|
|
1225
|
+
{
|
|
1226
|
+
vpcId: vpc.id,
|
|
1227
|
+
routes: [
|
|
1228
|
+
{
|
|
1229
|
+
cidrBlock: "0.0.0.0/0",
|
|
1230
|
+
gatewayId: internetGateway.id,
|
|
1231
|
+
},
|
|
1232
|
+
],
|
|
1233
|
+
},
|
|
1234
|
+
{ parent: self },
|
|
1235
|
+
),
|
|
1236
|
+
);
|
|
1237
|
+
|
|
1238
|
+
new ec2.RouteTableAssociation(
|
|
1239
|
+
`${name}PublicRouteTableAssociation${i + 1}`,
|
|
1240
|
+
{
|
|
1241
|
+
subnetId: subnet.id,
|
|
1242
|
+
routeTableId: routeTable.id,
|
|
1243
|
+
},
|
|
1244
|
+
{ parent: self },
|
|
1245
|
+
);
|
|
1246
|
+
|
|
1247
|
+
return { subnet, routeTable };
|
|
1248
|
+
}),
|
|
1249
|
+
);
|
|
1250
|
+
|
|
1251
|
+
return {
|
|
1252
|
+
publicSubnets: ret.apply((ret) => ret.map((r) => r.subnet)),
|
|
1253
|
+
publicRouteTables: ret.apply((ret) => ret.map((r) => r.routeTable)),
|
|
1254
|
+
};
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
function createPrivateSubnets() {
|
|
1258
|
+
const ret = zones.apply((zones) =>
|
|
1259
|
+
zones.map((zone, i) => {
|
|
1260
|
+
const subnet = new ec2.Subnet(
|
|
1261
|
+
...transform(
|
|
1262
|
+
args.transform?.privateSubnet,
|
|
1263
|
+
`${name}PrivateSubnet${i + 1}`,
|
|
1264
|
+
{
|
|
1265
|
+
vpcId: vpc.id,
|
|
1266
|
+
cidrBlock: `10.0.${8 * i + 4}.0/22`,
|
|
1267
|
+
availabilityZone: zone,
|
|
1268
|
+
},
|
|
1269
|
+
{ parent: self },
|
|
1270
|
+
),
|
|
1271
|
+
);
|
|
1272
|
+
|
|
1273
|
+
const routeTable = new ec2.RouteTable(
|
|
1274
|
+
...transform(
|
|
1275
|
+
args.transform?.privateRouteTable,
|
|
1276
|
+
`${name}PrivateRouteTable${i + 1}`,
|
|
1277
|
+
{
|
|
1278
|
+
vpcId: vpc.id,
|
|
1279
|
+
routes: all([natGateways, natInstances]).apply(
|
|
1280
|
+
([natGateways, natInstances]) => [
|
|
1281
|
+
...(natGateways[i]
|
|
1282
|
+
? [
|
|
1283
|
+
{
|
|
1284
|
+
cidrBlock: "0.0.0.0/0",
|
|
1285
|
+
natGatewayId: natGateways[i].id,
|
|
1286
|
+
},
|
|
1287
|
+
]
|
|
1288
|
+
: []),
|
|
1289
|
+
...(natInstances[i]
|
|
1290
|
+
? [
|
|
1291
|
+
{
|
|
1292
|
+
cidrBlock: "0.0.0.0/0",
|
|
1293
|
+
networkInterfaceId:
|
|
1294
|
+
natInstances[i].primaryNetworkInterfaceId,
|
|
1295
|
+
},
|
|
1296
|
+
]
|
|
1297
|
+
: []),
|
|
1298
|
+
],
|
|
1299
|
+
),
|
|
1300
|
+
},
|
|
1301
|
+
{ parent: self },
|
|
1302
|
+
),
|
|
1303
|
+
);
|
|
1304
|
+
|
|
1305
|
+
new ec2.RouteTableAssociation(
|
|
1306
|
+
`${name}PrivateRouteTableAssociation${i + 1}`,
|
|
1307
|
+
{
|
|
1308
|
+
subnetId: subnet.id,
|
|
1309
|
+
routeTableId: routeTable.id,
|
|
1310
|
+
},
|
|
1311
|
+
{ parent: self },
|
|
1312
|
+
);
|
|
1313
|
+
|
|
1314
|
+
return { subnet, routeTable };
|
|
1315
|
+
}),
|
|
1316
|
+
);
|
|
1317
|
+
|
|
1318
|
+
return {
|
|
1319
|
+
privateSubnets: ret.apply((ret) => ret.map((r) => r.subnet)),
|
|
1320
|
+
privateRouteTables: ret.apply((ret) => ret.map((r) => r.routeTable)),
|
|
1321
|
+
};
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
function createBastion() {
|
|
1325
|
+
return all([bastion, natInstances, natSecurityGroup, keyPair]).apply(
|
|
1326
|
+
([bastion, natInstances, natSecurityGroup, keyPair]) => {
|
|
1327
|
+
if (!bastion.enabled)
|
|
1328
|
+
return {
|
|
1329
|
+
bastionSecurityGroup: undefined,
|
|
1330
|
+
bastionInstance: undefined,
|
|
1331
|
+
};
|
|
1332
|
+
|
|
1333
|
+
if (natInstances.length)
|
|
1334
|
+
return {
|
|
1335
|
+
bastionSecurityGroup: natSecurityGroup,
|
|
1336
|
+
bastionInstance: natInstances[0],
|
|
1337
|
+
};
|
|
1338
|
+
|
|
1339
|
+
const bastionSecurityGroup = new ec2.SecurityGroup(
|
|
1340
|
+
...transform(
|
|
1341
|
+
args.transform?.bastionSecurityGroup,
|
|
1342
|
+
`${name}BastionSecurityGroup`,
|
|
1343
|
+
{
|
|
1344
|
+
vpcId: vpc.id,
|
|
1345
|
+
ingress: [
|
|
1346
|
+
{
|
|
1347
|
+
protocol: "tcp",
|
|
1348
|
+
fromPort: 22,
|
|
1349
|
+
toPort: 22,
|
|
1350
|
+
cidrBlocks: ["0.0.0.0/0"],
|
|
1351
|
+
},
|
|
1352
|
+
],
|
|
1353
|
+
egress: [
|
|
1354
|
+
{
|
|
1355
|
+
protocol: "-1",
|
|
1356
|
+
fromPort: 0,
|
|
1357
|
+
toPort: 0,
|
|
1358
|
+
cidrBlocks: ["0.0.0.0/0"],
|
|
1359
|
+
},
|
|
1360
|
+
],
|
|
1361
|
+
tags: {
|
|
1362
|
+
"sst:is-bastion-sg": "true",
|
|
1363
|
+
},
|
|
1364
|
+
},
|
|
1365
|
+
{ parent: self },
|
|
1366
|
+
),
|
|
1367
|
+
);
|
|
1368
|
+
|
|
1369
|
+
const instanceProfile = output(
|
|
1370
|
+
bastion.instanceProfileName,
|
|
1371
|
+
).apply((instanceProfileName) => {
|
|
1372
|
+
if (instanceProfileName) {
|
|
1373
|
+
if (instanceProfileName.startsWith("arn:")) {
|
|
1374
|
+
throw new VisibleError(
|
|
1375
|
+
"Bastion instance profile must be a name, not an ARN.",
|
|
1376
|
+
);
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
return iam.InstanceProfile.get(
|
|
1380
|
+
`${name}BastionProfile`,
|
|
1381
|
+
instanceProfileName,
|
|
1382
|
+
{},
|
|
1383
|
+
{ parent: self },
|
|
1384
|
+
);
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
const role = new iam.Role(
|
|
1388
|
+
`${name}BastionRole`,
|
|
1389
|
+
{
|
|
1390
|
+
assumeRolePolicy: iam.getPolicyDocumentOutput({
|
|
1391
|
+
statements: [
|
|
1392
|
+
{
|
|
1393
|
+
actions: ["sts:AssumeRole"],
|
|
1394
|
+
principals: [
|
|
1395
|
+
{
|
|
1396
|
+
type: "Service",
|
|
1397
|
+
identifiers: ["ec2.amazonaws.com"],
|
|
1398
|
+
},
|
|
1399
|
+
],
|
|
1400
|
+
},
|
|
1401
|
+
],
|
|
1402
|
+
}).json,
|
|
1403
|
+
managedPolicyArns: [
|
|
1404
|
+
interpolate`arn:${partition}:iam::aws:policy/AmazonSSMManagedInstanceCore`,
|
|
1405
|
+
],
|
|
1406
|
+
},
|
|
1407
|
+
{ parent: self },
|
|
1408
|
+
);
|
|
1409
|
+
|
|
1410
|
+
return new iam.InstanceProfile(
|
|
1411
|
+
`${name}BastionProfile`,
|
|
1412
|
+
{ role: role.name },
|
|
1413
|
+
{ parent: self },
|
|
1414
|
+
);
|
|
1415
|
+
});
|
|
1416
|
+
|
|
1417
|
+
const ami = ec2.getAmiOutput(
|
|
1418
|
+
{
|
|
1419
|
+
owners: ["amazon"],
|
|
1420
|
+
filters: [
|
|
1421
|
+
{
|
|
1422
|
+
name: "name",
|
|
1423
|
+
// The AMI has the SSM agent pre-installed
|
|
1424
|
+
values: ["al2023-ami-20*"],
|
|
1425
|
+
},
|
|
1426
|
+
{
|
|
1427
|
+
name: "architecture",
|
|
1428
|
+
values: ["arm64"],
|
|
1429
|
+
},
|
|
1430
|
+
],
|
|
1431
|
+
mostRecent: true,
|
|
1432
|
+
},
|
|
1433
|
+
{ parent: self },
|
|
1434
|
+
);
|
|
1435
|
+
const bastionInstance = new ec2.Instance(
|
|
1436
|
+
...transform(
|
|
1437
|
+
args.transform?.bastionInstance,
|
|
1438
|
+
`${name}BastionInstance`,
|
|
1439
|
+
{
|
|
1440
|
+
instanceType: "t4g.nano",
|
|
1441
|
+
ami: ami.id,
|
|
1442
|
+
subnetId: publicSubnets.apply((v) => v[0].id),
|
|
1443
|
+
vpcSecurityGroupIds: [bastionSecurityGroup.id],
|
|
1444
|
+
iamInstanceProfile: instanceProfile.apply(
|
|
1445
|
+
(ip) => ip.name,
|
|
1446
|
+
),
|
|
1447
|
+
keyName: keyPair?.keyName,
|
|
1448
|
+
tags: {
|
|
1449
|
+
"sst:is-bastion": "true",
|
|
1450
|
+
},
|
|
1451
|
+
},
|
|
1452
|
+
{ parent: self },
|
|
1453
|
+
),
|
|
1454
|
+
);
|
|
1455
|
+
return { bastionInstance, bastionSecurityGroup };
|
|
1456
|
+
},
|
|
1457
|
+
);
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
function createCloudmapNamespace() {
|
|
1461
|
+
return new servicediscovery.PrivateDnsNamespace(
|
|
1462
|
+
`${name}CloudmapNamespace`,
|
|
1463
|
+
{
|
|
1464
|
+
name: "sst",
|
|
1465
|
+
vpc: vpc.id,
|
|
1466
|
+
},
|
|
1467
|
+
{ parent: self },
|
|
1468
|
+
);
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
/**
|
|
1473
|
+
* The VPC ID.
|
|
1474
|
+
*/
|
|
1475
|
+
public get id() {
|
|
1476
|
+
return this.vpc.id;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
/**
|
|
1480
|
+
* A list of public subnet IDs in the VPC.
|
|
1481
|
+
*/
|
|
1482
|
+
public get publicSubnets() {
|
|
1483
|
+
return this._publicSubnets.apply((subnets) =>
|
|
1484
|
+
subnets.map((subnet) => subnet.id),
|
|
1485
|
+
);
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
/**
|
|
1489
|
+
* A list of private subnet IDs in the VPC.
|
|
1490
|
+
*/
|
|
1491
|
+
public get privateSubnets() {
|
|
1492
|
+
return this._privateSubnets.apply((subnets) =>
|
|
1493
|
+
subnets.map((subnet) => subnet.id),
|
|
1494
|
+
);
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
/**
|
|
1498
|
+
* A list of VPC security group IDs.
|
|
1499
|
+
*/
|
|
1500
|
+
public get securityGroups() {
|
|
1501
|
+
return output(this.securityGroup).apply((v) => [v.id]);
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
/**
|
|
1505
|
+
* The bastion instance ID.
|
|
1506
|
+
*/
|
|
1507
|
+
public get bastion() {
|
|
1508
|
+
return this.bastionInstance.apply((v) => {
|
|
1509
|
+
if (!v) {
|
|
1510
|
+
throw new VisibleError(
|
|
1511
|
+
`VPC bastion is not enabled. Enable it with "bastion: true" or "bastion: { instanceProfile: \"name\" }".`,
|
|
1512
|
+
);
|
|
1513
|
+
}
|
|
1514
|
+
return v.id;
|
|
1515
|
+
});
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
/**
|
|
1519
|
+
* The underlying [resources](/docs/components/#nodes) this component creates.
|
|
1520
|
+
*/
|
|
1521
|
+
public get nodes() {
|
|
1522
|
+
return {
|
|
1523
|
+
/**
|
|
1524
|
+
* The Amazon EC2 VPC.
|
|
1525
|
+
*/
|
|
1526
|
+
vpc: this.vpc,
|
|
1527
|
+
/**
|
|
1528
|
+
* The Amazon EC2 Internet Gateway.
|
|
1529
|
+
*/
|
|
1530
|
+
internetGateway: this.internetGateway,
|
|
1531
|
+
/**
|
|
1532
|
+
* The Amazon EC2 Security Group.
|
|
1533
|
+
*/
|
|
1534
|
+
securityGroup: this.securityGroup,
|
|
1535
|
+
/**
|
|
1536
|
+
* The Amazon EC2 NAT Gateway.
|
|
1537
|
+
*/
|
|
1538
|
+
natGateways: this.natGateways,
|
|
1539
|
+
/**
|
|
1540
|
+
* The Amazon EC2 NAT instances.
|
|
1541
|
+
*/
|
|
1542
|
+
natInstances: this.natInstances,
|
|
1543
|
+
/**
|
|
1544
|
+
* The Amazon EC2 Security Group for the NAT instances.
|
|
1545
|
+
*/
|
|
1546
|
+
natSecurityGroup: this.natSecurityGroup,
|
|
1547
|
+
/**
|
|
1548
|
+
* The Amazon EC2 Elastic IP.
|
|
1549
|
+
*/
|
|
1550
|
+
elasticIps: this.elasticIps,
|
|
1551
|
+
/**
|
|
1552
|
+
* The Amazon EC2 public subnet.
|
|
1553
|
+
*/
|
|
1554
|
+
publicSubnets: this._publicSubnets,
|
|
1555
|
+
/**
|
|
1556
|
+
* The Amazon EC2 private subnet.
|
|
1557
|
+
*/
|
|
1558
|
+
privateSubnets: this._privateSubnets,
|
|
1559
|
+
/**
|
|
1560
|
+
* The Amazon EC2 route table for the public subnet.
|
|
1561
|
+
*/
|
|
1562
|
+
publicRouteTables: this.publicRouteTables,
|
|
1563
|
+
/**
|
|
1564
|
+
* The Amazon EC2 route table for the private subnet.
|
|
1565
|
+
*/
|
|
1566
|
+
privateRouteTables: this.privateRouteTables,
|
|
1567
|
+
/**
|
|
1568
|
+
* The Amazon EC2 bastion instance.
|
|
1569
|
+
*/
|
|
1570
|
+
bastionInstance: this.bastionInstance,
|
|
1571
|
+
/**
|
|
1572
|
+
* The Amazon EC2 Security Group for the bastion instance.
|
|
1573
|
+
*/
|
|
1574
|
+
bastionSecurityGroup: this.bastionSecurityGroup,
|
|
1575
|
+
/**
|
|
1576
|
+
* The AWS Cloudmap namespace.
|
|
1577
|
+
*/
|
|
1578
|
+
cloudmapNamespace: this.cloudmapNamespace,
|
|
1579
|
+
};
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
/**
|
|
1583
|
+
* Reference an existing VPC with the given ID. This is useful when you
|
|
1584
|
+
* create a VPC in one stage and want to share it in another stage. It avoids having to
|
|
1585
|
+
* create a new VPC in the other stage.
|
|
1586
|
+
*
|
|
1587
|
+
* :::tip
|
|
1588
|
+
* You can use the `static get` method to share VPCs across stages.
|
|
1589
|
+
* :::
|
|
1590
|
+
*
|
|
1591
|
+
* @param name The name of the component.
|
|
1592
|
+
* @param vpcId The ID of the existing VPC.
|
|
1593
|
+
* @param opts Resource options.
|
|
1594
|
+
*
|
|
1595
|
+
* @example
|
|
1596
|
+
* Imagine you create a VPC in the `dev` stage. And in your personal stage `frank`,
|
|
1597
|
+
* instead of creating a new VPC, you want to share the VPC from `dev`.
|
|
1598
|
+
*
|
|
1599
|
+
* ```ts title="sst.config.ts"
|
|
1600
|
+
* const vpc = $app.stage === "frank"
|
|
1601
|
+
* ? sst.aws.Vpc.get("MyVPC", "vpc-0be8fa4de860618bb")
|
|
1602
|
+
* : new sst.aws.Vpc("MyVPC");
|
|
1603
|
+
* ```
|
|
1604
|
+
*
|
|
1605
|
+
* Here `vpc-0be8fa4de860618bb` is the ID of the VPC created in the `dev` stage.
|
|
1606
|
+
* You can find this by outputting the VPC ID in the `dev` stage.
|
|
1607
|
+
*
|
|
1608
|
+
* ```ts title="sst.config.ts"
|
|
1609
|
+
* return {
|
|
1610
|
+
* vpc: vpc.id
|
|
1611
|
+
* };
|
|
1612
|
+
* ```
|
|
1613
|
+
*/
|
|
1614
|
+
public static get(
|
|
1615
|
+
name: string,
|
|
1616
|
+
vpcId: Input<string>,
|
|
1617
|
+
opts?: ComponentResourceOptions,
|
|
1618
|
+
) {
|
|
1619
|
+
return new Vpc(
|
|
1620
|
+
name,
|
|
1621
|
+
{
|
|
1622
|
+
ref: true,
|
|
1623
|
+
vpcId,
|
|
1624
|
+
} satisfies VpcRef as VpcArgs,
|
|
1625
|
+
opts,
|
|
1626
|
+
);
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
/** @internal */
|
|
1630
|
+
public getSSTLink() {
|
|
1631
|
+
return {
|
|
1632
|
+
properties: {
|
|
1633
|
+
bastion: this.bastionInstance.apply((v) => v?.id),
|
|
1634
|
+
},
|
|
1635
|
+
};
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
const __pulumiType = "sst:aws:Vpc";
|
|
1640
|
+
// @ts-expect-error
|
|
1641
|
+
Vpc.__pulumiType = __pulumiType;
|