@monorise/sst 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.sst/platform/src/components/aws/apigatewayv2.d.ts +1 -3
- package/dist/.sst/platform/src/components/aws/apigatewayv2.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/aurora.d.ts +4 -4
- package/dist/.sst/platform/src/components/aws/aurora.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/auth.d.ts +38 -3
- package/dist/.sst/platform/src/components/aws/auth.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/bucket.d.ts +102 -1
- package/dist/.sst/platform/src/components/aws/bucket.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/cluster.d.ts +1 -3
- package/dist/.sst/platform/src/components/aws/cluster.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/cognito-user-pool-client.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/cognito-user-pool.d.ts +4 -0
- package/dist/.sst/platform/src/components/aws/cognito-user-pool.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/dynamo.d.ts +0 -1
- package/dist/.sst/platform/src/components/aws/dynamo.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/email.d.ts +1 -1
- package/dist/.sst/platform/src/components/aws/fargate.d.ts +34 -0
- package/dist/.sst/platform/src/components/aws/fargate.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/function.d.ts +1 -3
- package/dist/.sst/platform/src/components/aws/function.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/helpers/arn.d.ts +5 -0
- package/dist/.sst/platform/src/components/aws/helpers/arn.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/open-search.d.ts +4 -4
- package/dist/.sst/platform/src/components/aws/open-search.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/opencontrol.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/permission.d.ts +13 -0
- package/dist/.sst/platform/src/components/aws/permission.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/postgres.d.ts +3 -3
- package/dist/.sst/platform/src/components/aws/postgres.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/realtime.d.ts +6 -0
- package/dist/.sst/platform/src/components/aws/realtime.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/redis.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/remix.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/router.d.ts +20 -14
- package/dist/.sst/platform/src/components/aws/router.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/service.d.ts +26 -0
- package/dist/.sst/platform/src/components/aws/service.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/solid-start.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/ssr-site.d.ts +197 -6
- package/dist/.sst/platform/src/components/aws/ssr-site.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/static-site.d.ts +5 -5
- package/dist/.sst/platform/src/components/aws/static-site.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/step-functions/state.d.ts +34 -0
- package/dist/.sst/platform/src/components/aws/step-functions/state.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/step-functions.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/svelte-kit.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/tan-stack-start.d.ts +1 -1
- package/dist/.sst/platform/src/components/aws/task.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/aws/vpc.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/base/base-ssr-site.d.ts +1 -99
- package/dist/.sst/platform/src/components/base/base-ssr-site.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/base/base-static-site.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/binding.d.ts +1 -1
- package/dist/.sst/platform/src/components/cloudflare/binding.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/bucket.d.ts +4 -2
- package/dist/.sst/platform/src/components/cloudflare/bucket.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/cron.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/d1.d.ts +1 -1
- package/dist/.sst/platform/src/components/cloudflare/experimental/astro.d.ts +186 -0
- package/dist/.sst/platform/src/components/cloudflare/experimental/astro.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/experimental/index.d.ts +4 -0
- package/dist/.sst/platform/src/components/cloudflare/experimental/index.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/experimental/solid-start.d.ts +171 -0
- package/dist/.sst/platform/src/components/cloudflare/experimental/solid-start.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/experimental/static-site.d.ts +222 -0
- package/dist/.sst/platform/src/components/cloudflare/experimental/static-site.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/helpers/fetch.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/helpers/worker-builder.d.ts +1 -1
- package/dist/.sst/platform/src/components/cloudflare/helpers/worker-builder.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/index.d.ts +4 -1
- package/dist/.sst/platform/src/components/cloudflare/index.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/kv.d.ts +8 -2
- package/dist/.sst/platform/src/components/cloudflare/kv.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/providers/kv-data.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/providers/worker-assets.d.ts +18 -0
- package/dist/.sst/platform/src/components/cloudflare/providers/worker-assets.d.ts.map +1 -0
- package/dist/.sst/platform/src/components/cloudflare/queue.d.ts +1 -1
- package/dist/.sst/platform/src/components/cloudflare/ssr-site.d.ts +34 -42
- package/dist/.sst/platform/src/components/cloudflare/ssr-site.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/cloudflare/worker.d.ts +28 -6
- package/dist/.sst/platform/src/components/cloudflare/worker.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/component.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/duration.d.ts +2 -1
- package/dist/.sst/platform/src/components/duration.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/rpc/rpc.d.ts +1 -0
- package/dist/.sst/platform/src/components/rpc/rpc.d.ts.map +1 -1
- package/dist/.sst/platform/src/components/secret.d.ts +1 -1
- package/dist/.sst/platform/src/config.d.ts +15 -0
- package/dist/.sst/platform/src/config.d.ts.map +1 -1
- package/dist/.sst/platform/src/util/fs.d.ts +5 -0
- package/dist/.sst/platform/src/util/fs.d.ts.map +1 -0
- package/dist/components/dashboard.d.ts +2 -0
- package/dist/components/dashboard.d.ts.map +1 -0
- package/dist/components/monorise-core.d.ts.map +1 -1
- package/dist/components/q-function.d.ts +1 -1
- package/dist/components/q-function.d.ts.map +1 -1
- package/dist/components/single-table.d.ts +2 -1
- package/dist/components/single-table.d.ts.map +1 -1
- package/dist/index.js +605 -7
- package/dist/index.js.map +1 -1
- package/dist/tsup.config.d.ts +3 -0
- package/dist/tsup.config.d.ts.map +1 -0
- package/package.json +3 -3
- package/dist/.sst/platform/src/components/aws/analog.js +0 -118
- package/dist/.sst/platform/src/components/aws/analog.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigateway-websocket-route.js +0 -110
- package/dist/.sst/platform/src/components/aws/apigateway-websocket-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigateway-websocket.js +0 -409
- package/dist/.sst/platform/src/components/aws/apigateway-websocket.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv1-api-key.js +0 -55
- package/dist/.sst/platform/src/components/aws/apigatewayv1-api-key.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv1-authorizer.js +0 -110
- package/dist/.sst/platform/src/components/aws/apigatewayv1-authorizer.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv1-base-route.js +0 -34
- package/dist/.sst/platform/src/components/aws/apigatewayv1-base-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv1-integration-route.js +0 -49
- package/dist/.sst/platform/src/components/aws/apigatewayv1-integration-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv1-lambda-route.js +0 -85
- package/dist/.sst/platform/src/components/aws/apigatewayv1-lambda-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv1-usage-plan.js +0 -66
- package/dist/.sst/platform/src/components/aws/apigatewayv1-usage-plan.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv1.js +0 -749
- package/dist/.sst/platform/src/components/aws/apigatewayv1.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv2-authorizer.js +0 -98
- package/dist/.sst/platform/src/components/aws/apigatewayv2-authorizer.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv2-base-route.js +0 -28
- package/dist/.sst/platform/src/components/aws/apigatewayv2-base-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv2-lambda-route.js +0 -84
- package/dist/.sst/platform/src/components/aws/apigatewayv2-lambda-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv2-private-route.js +0 -55
- package/dist/.sst/platform/src/components/aws/apigatewayv2-private-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv2-url-route.js +0 -53
- package/dist/.sst/platform/src/components/aws/apigatewayv2-url-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/apigatewayv2.js +0 -648
- package/dist/.sst/platform/src/components/aws/apigatewayv2.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/app-sync-data-source.js +0 -208
- package/dist/.sst/platform/src/components/aws/app-sync-data-source.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/app-sync-function.js +0 -52
- package/dist/.sst/platform/src/components/aws/app-sync-function.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/app-sync-resolver.js +0 -70
- package/dist/.sst/platform/src/components/aws/app-sync-resolver.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/app-sync.js +0 -330
- package/dist/.sst/platform/src/components/aws/app-sync.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/astro.js +0 -156
- package/dist/.sst/platform/src/components/aws/astro.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/aurora.js +0 -678
- package/dist/.sst/platform/src/components/aws/aurora.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/auth-v1.js +0 -36
- package/dist/.sst/platform/src/components/aws/auth-v1.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/auth.js +0 -209
- package/dist/.sst/platform/src/components/aws/auth.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/bucket-lambda-subscriber.js +0 -99
- package/dist/.sst/platform/src/components/aws/bucket-lambda-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/bucket-notification.js +0 -170
- package/dist/.sst/platform/src/components/aws/bucket-notification.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/bucket-queue-subscriber.js +0 -77
- package/dist/.sst/platform/src/components/aws/bucket-queue-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/bucket-topic-subscriber.js +0 -99
- package/dist/.sst/platform/src/components/aws/bucket-topic-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/bucket.js +0 -754
- package/dist/.sst/platform/src/components/aws/bucket.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/bus-base-subscriber.js +0 -19
- package/dist/.sst/platform/src/components/aws/bus-base-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/bus-lambda-subscriber.js +0 -81
- package/dist/.sst/platform/src/components/aws/bus-lambda-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/bus-queue-subscriber.js +0 -63
- package/dist/.sst/platform/src/components/aws/bus-queue-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/bus.js +0 -350
- package/dist/.sst/platform/src/components/aws/bus.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/cdn.js +0 -234
- package/dist/.sst/platform/src/components/aws/cdn.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/cluster-v1.js +0 -245
- package/dist/.sst/platform/src/components/aws/cluster-v1.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/cluster.js +0 -321
- package/dist/.sst/platform/src/components/aws/cluster.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/cognito-identity-pool.js +0 -263
- package/dist/.sst/platform/src/components/aws/cognito-identity-pool.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/cognito-identity-provider.js +0 -67
- package/dist/.sst/platform/src/components/aws/cognito-identity-provider.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/cognito-user-pool-client.js +0 -81
- package/dist/.sst/platform/src/components/aws/cognito-user-pool-client.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/cognito-user-pool.js +0 -368
- package/dist/.sst/platform/src/components/aws/cognito-user-pool.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/cron.js +0 -200
- package/dist/.sst/platform/src/components/aws/cron.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/dns-validated-certificate.js +0 -55
- package/dist/.sst/platform/src/components/aws/dns-validated-certificate.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/dns.js +0 -121
- package/dist/.sst/platform/src/components/aws/dns.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/dynamo-lambda-subscriber.js +0 -79
- package/dist/.sst/platform/src/components/aws/dynamo-lambda-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/dynamo.js +0 -291
- package/dist/.sst/platform/src/components/aws/dynamo.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/efs.js +0 -241
- package/dist/.sst/platform/src/components/aws/efs.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/email.js +0 -276
- package/dist/.sst/platform/src/components/aws/email.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/fargate.js +0 -434
- package/dist/.sst/platform/src/components/aws/fargate.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/function.js +0 -1041
- package/dist/.sst/platform/src/components/aws/function.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/apigateway-account.js +0 -31
- package/dist/.sst/platform/src/components/aws/helpers/apigateway-account.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/apigatewayv2-domain.js +0 -2
- package/dist/.sst/platform/src/components/aws/helpers/apigatewayv2-domain.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/arn.js +0 -86
- package/dist/.sst/platform/src/components/aws/helpers/arn.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/bootstrap.js +0 -7
- package/dist/.sst/platform/src/components/aws/helpers/bootstrap.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/container-builder.js +0 -27
- package/dist/.sst/platform/src/components/aws/helpers/container-builder.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/function-builder.js +0 -51
- package/dist/.sst/platform/src/components/aws/helpers/function-builder.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/provider.js +0 -34
- package/dist/.sst/platform/src/components/aws/helpers/provider.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/quota.js +0 -20
- package/dist/.sst/platform/src/components/aws/helpers/quota.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/site-builder.js +0 -36
- package/dist/.sst/platform/src/components/aws/helpers/site-builder.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/helpers/subscriber.js +0 -13
- package/dist/.sst/platform/src/components/aws/helpers/subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/https-redirect.js +0 -124
- package/dist/.sst/platform/src/components/aws/https-redirect.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/iam-edit.js +0 -40
- package/dist/.sst/platform/src/components/aws/iam-edit.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/index.js +0 -49
- package/dist/.sst/platform/src/components/aws/index.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/kinesis-stream-lambda-subscriber.js +0 -82
- package/dist/.sst/platform/src/components/aws/kinesis-stream-lambda-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/kinesis-stream.js +0 -134
- package/dist/.sst/platform/src/components/aws/kinesis-stream.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/linkable.js +0 -25
- package/dist/.sst/platform/src/components/aws/linkable.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/logging.js +0 -26
- package/dist/.sst/platform/src/components/aws/logging.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/mysql.js +0 -514
- package/dist/.sst/platform/src/components/aws/mysql.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/nextjs.js +0 -444
- package/dist/.sst/platform/src/components/aws/nextjs.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/nuxt.js +0 -113
- package/dist/.sst/platform/src/components/aws/nuxt.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/open-search.js +0 -365
- package/dist/.sst/platform/src/components/aws/open-search.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/opencontrol.js +0 -164
- package/dist/.sst/platform/src/components/aws/opencontrol.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/permission.js +0 -19
- package/dist/.sst/platform/src/components/aws/permission.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/postgres-v1.js +0 -304
- package/dist/.sst/platform/src/components/aws/postgres-v1.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/postgres.js +0 -532
- package/dist/.sst/platform/src/components/aws/postgres.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/bucket-files.js +0 -8
- package/dist/.sst/platform/src/components/aws/providers/bucket-files.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/distribution-deployment-waiter.js +0 -8
- package/dist/.sst/platform/src/components/aws/providers/distribution-deployment-waiter.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/distribution-invalidation.js +0 -8
- package/dist/.sst/platform/src/components/aws/providers/distribution-invalidation.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/function-environment-update.js +0 -18
- package/dist/.sst/platform/src/components/aws/providers/function-environment-update.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/hosted-zone-lookup.js +0 -8
- package/dist/.sst/platform/src/components/aws/providers/hosted-zone-lookup.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/kv-keys.js +0 -8
- package/dist/.sst/platform/src/components/aws/providers/kv-keys.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/kv-routes-update.js +0 -8
- package/dist/.sst/platform/src/components/aws/providers/kv-routes-update.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/origin-access-control.js +0 -8
- package/dist/.sst/platform/src/components/aws/providers/origin-access-control.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/rds-role-lookup.js +0 -8
- package/dist/.sst/platform/src/components/aws/providers/rds-role-lookup.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/providers/vector-table.js +0 -8
- package/dist/.sst/platform/src/components/aws/providers/vector-table.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/queue-lambda-subscriber.js +0 -81
- package/dist/.sst/platform/src/components/aws/queue-lambda-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/queue.js +0 -322
- package/dist/.sst/platform/src/components/aws/queue.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/react.js +0 -157
- package/dist/.sst/platform/src/components/aws/react.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/realtime-lambda-subscriber.js +0 -78
- package/dist/.sst/platform/src/components/aws/realtime-lambda-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/realtime.js +0 -221
- package/dist/.sst/platform/src/components/aws/realtime.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/redis-v1.js +0 -335
- package/dist/.sst/platform/src/components/aws/redis-v1.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/redis.js +0 -382
- package/dist/.sst/platform/src/components/aws/redis.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/remix.js +0 -212
- package/dist/.sst/platform/src/components/aws/remix.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/router-base-route.js +0 -40
- package/dist/.sst/platform/src/components/aws/router-base-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/router-bucket-route.js +0 -40
- package/dist/.sst/platform/src/components/aws/router-bucket-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/router-url-route.js +0 -51
- package/dist/.sst/platform/src/components/aws/router-url-route.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/router.js +0 -1156
- package/dist/.sst/platform/src/components/aws/router.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/service-v1.js +0 -606
- package/dist/.sst/platform/src/components/aws/service-v1.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/service.js +0 -924
- package/dist/.sst/platform/src/components/aws/service.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/sns-topic-lambda-subscriber.js +0 -75
- package/dist/.sst/platform/src/components/aws/sns-topic-lambda-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/sns-topic-queue-subscriber.js +0 -59
- package/dist/.sst/platform/src/components/aws/sns-topic-queue-subscriber.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/sns-topic.js +0 -233
- package/dist/.sst/platform/src/components/aws/sns-topic.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/solid-start.js +0 -120
- package/dist/.sst/platform/src/components/aws/solid-start.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/ssr-site.js +0 -792
- package/dist/.sst/platform/src/components/aws/ssr-site.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/static-site.js +0 -583
- package/dist/.sst/platform/src/components/aws/static-site.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions/choice.js +0 -98
- package/dist/.sst/platform/src/components/aws/step-functions/choice.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions/fail.js +0 -25
- package/dist/.sst/platform/src/components/aws/step-functions/fail.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions/map.js +0 -108
- package/dist/.sst/platform/src/components/aws/step-functions/map.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions/parallel.js +0 -129
- package/dist/.sst/platform/src/components/aws/step-functions/parallel.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions/pass.js +0 -41
- package/dist/.sst/platform/src/components/aws/step-functions/pass.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions/state.js +0 -134
- package/dist/.sst/platform/src/components/aws/step-functions/state.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions/succeed.js +0 -25
- package/dist/.sst/platform/src/components/aws/step-functions/succeed.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions/task.js +0 -116
- package/dist/.sst/platform/src/components/aws/step-functions/task.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions/wait.js +0 -46
- package/dist/.sst/platform/src/components/aws/step-functions/wait.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/step-functions.js +0 -576
- package/dist/.sst/platform/src/components/aws/step-functions.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/svelte-kit.js +0 -144
- package/dist/.sst/platform/src/components/aws/svelte-kit.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/tan-stack-start.js +0 -143
- package/dist/.sst/platform/src/components/aws/tan-stack-start.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/task.js +0 -311
- package/dist/.sst/platform/src/components/aws/task.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/vector.js +0 -224
- package/dist/.sst/platform/src/components/aws/vector.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/vpc-v1.js +0 -355
- package/dist/.sst/platform/src/components/aws/vpc-v1.js.map +0 -1
- package/dist/.sst/platform/src/components/aws/vpc.js +0 -834
- package/dist/.sst/platform/src/components/aws/vpc.js.map +0 -1
- package/dist/.sst/platform/src/components/base/base-site.js +0 -47
- package/dist/.sst/platform/src/components/base/base-site.js.map +0 -1
- package/dist/.sst/platform/src/components/base/base-ssr-site.js +0 -72
- package/dist/.sst/platform/src/components/base/base-ssr-site.js.map +0 -1
- package/dist/.sst/platform/src/components/base/base-static-site.js +0 -87
- package/dist/.sst/platform/src/components/base/base-static-site.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/account-id.js +0 -2
- package/dist/.sst/platform/src/components/cloudflare/account-id.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/auth.js +0 -37
- package/dist/.sst/platform/src/components/cloudflare/auth.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/binding.js +0 -25
- package/dist/.sst/platform/src/components/cloudflare/binding.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/bucket.js +0 -98
- package/dist/.sst/platform/src/components/cloudflare/bucket.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/cron.js +0 -86
- package/dist/.sst/platform/src/components/cloudflare/cron.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/d1.js +0 -104
- package/dist/.sst/platform/src/components/cloudflare/d1.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/dns.js +0 -138
- package/dist/.sst/platform/src/components/cloudflare/dns.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/helpers/fetch.js +0 -39
- package/dist/.sst/platform/src/components/cloudflare/helpers/fetch.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/helpers/worker-builder.js +0 -25
- package/dist/.sst/platform/src/components/cloudflare/helpers/worker-builder.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/index.js +0 -13
- package/dist/.sst/platform/src/components/cloudflare/index.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/kv.js +0 -98
- package/dist/.sst/platform/src/components/cloudflare/kv.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/providers/dns-record.js +0 -11
- package/dist/.sst/platform/src/components/cloudflare/providers/dns-record.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/providers/kv-data.js +0 -63
- package/dist/.sst/platform/src/components/cloudflare/providers/kv-data.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/providers/worker-url.js +0 -83
- package/dist/.sst/platform/src/components/cloudflare/providers/worker-url.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/providers/zone-lookup.js +0 -54
- package/dist/.sst/platform/src/components/cloudflare/providers/zone-lookup.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/queue.js +0 -57
- package/dist/.sst/platform/src/components/cloudflare/queue.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/remix.d.ts +0 -223
- package/dist/.sst/platform/src/components/cloudflare/remix.d.ts.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/remix.js +0 -291
- package/dist/.sst/platform/src/components/cloudflare/remix.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/ssr-site.js +0 -177
- package/dist/.sst/platform/src/components/cloudflare/ssr-site.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/static-site.js +0 -315
- package/dist/.sst/platform/src/components/cloudflare/static-site.js.map +0 -1
- package/dist/.sst/platform/src/components/cloudflare/worker.js +0 -326
- package/dist/.sst/platform/src/components/cloudflare/worker.js.map +0 -1
- package/dist/.sst/platform/src/components/component.js +0 -395
- package/dist/.sst/platform/src/components/component.js.map +0 -1
- package/dist/.sst/platform/src/components/cpu.js +0 -9
- package/dist/.sst/platform/src/components/cpu.js.map +0 -1
- package/dist/.sst/platform/src/components/dns.js +0 -7
- package/dist/.sst/platform/src/components/dns.js.map +0 -1
- package/dist/.sst/platform/src/components/duration.js +0 -19
- package/dist/.sst/platform/src/components/duration.js.map +0 -1
- package/dist/.sst/platform/src/components/error.js +0 -6
- package/dist/.sst/platform/src/components/error.js.map +0 -1
- package/dist/.sst/platform/src/components/experimental/dev-command.js +0 -59
- package/dist/.sst/platform/src/components/experimental/dev-command.js.map +0 -1
- package/dist/.sst/platform/src/components/experimental/index.js +0 -2
- package/dist/.sst/platform/src/components/experimental/index.js.map +0 -1
- package/dist/.sst/platform/src/components/hint.d.ts +0 -7
- package/dist/.sst/platform/src/components/hint.d.ts.map +0 -1
- package/dist/.sst/platform/src/components/hint.js +0 -20
- package/dist/.sst/platform/src/components/hint.js.map +0 -1
- package/dist/.sst/platform/src/components/index.js +0 -16
- package/dist/.sst/platform/src/components/index.js.map +0 -1
- package/dist/.sst/platform/src/components/input.js +0 -2
- package/dist/.sst/platform/src/components/input.js.map +0 -1
- package/dist/.sst/platform/src/components/link.js +0 -138
- package/dist/.sst/platform/src/components/link.js.map +0 -1
- package/dist/.sst/platform/src/components/linkable.js +0 -244
- package/dist/.sst/platform/src/components/linkable.js.map +0 -1
- package/dist/.sst/platform/src/components/naming.js +0 -58
- package/dist/.sst/platform/src/components/naming.js.map +0 -1
- package/dist/.sst/platform/src/components/path.js +0 -5
- package/dist/.sst/platform/src/components/path.js.map +0 -1
- package/dist/.sst/platform/src/components/rpc/rpc.js +0 -120
- package/dist/.sst/platform/src/components/rpc/rpc.js.map +0 -1
- package/dist/.sst/platform/src/components/secret.js +0 -143
- package/dist/.sst/platform/src/components/secret.js.map +0 -1
- package/dist/.sst/platform/src/components/size.js +0 -29
- package/dist/.sst/platform/src/components/size.js.map +0 -1
- package/dist/.sst/platform/src/components/vercel/account-id.js +0 -2
- package/dist/.sst/platform/src/components/vercel/account-id.js.map +0 -1
- package/dist/.sst/platform/src/components/vercel/dns.js +0 -104
- package/dist/.sst/platform/src/components/vercel/dns.js.map +0 -1
- package/dist/.sst/platform/src/components/vercel/index.js +0 -3
- package/dist/.sst/platform/src/components/vercel/index.js.map +0 -1
- package/dist/.sst/platform/src/components/vercel/providers/dns-record.js +0 -8
- package/dist/.sst/platform/src/components/vercel/providers/dns-record.js.map +0 -1
- package/dist/.sst/platform/src/config.js +0 -5
- package/dist/.sst/platform/src/config.js.map +0 -1
- package/dist/.sst/platform/src/util/compare-semver.js +0 -24
- package/dist/.sst/platform/src/util/compare-semver.js.map +0 -1
- package/dist/.sst/platform/src/util/lazy.js +0 -12
- package/dist/.sst/platform/src/util/lazy.js.map +0 -1
- package/dist/.sst/platform/src/util/path-to-regex.d.ts +0 -128
- package/dist/.sst/platform/src/util/path-to-regex.d.ts.map +0 -1
- package/dist/.sst/platform/src/util/path-to-regex.js +0 -392
- package/dist/.sst/platform/src/util/path-to-regex.js.map +0 -1
- package/dist/.sst/platform/src/util/semaphore.js +0 -36
- package/dist/.sst/platform/src/util/semaphore.js.map +0 -1
- package/dist/.sst/platform/src/util/warn.js +0 -8
- package/dist/.sst/platform/src/util/warn.js.map +0 -1
- package/dist/components/monorise-core.js +0 -147
- package/dist/components/monorise-core.js.map +0 -1
- package/dist/components/q-function.js +0 -53
- package/dist/components/q-function.js.map +0 -1
- package/dist/components/single-table.js +0 -73
- package/dist/components/single-table.js.map +0 -1
- package/dist/constants/event.js +0 -74
- package/dist/constants/event.js.map +0 -1
- package/dist/constants/table.js +0 -3
- package/dist/constants/table.js.map +0 -1
- package/dist/sst.config.js +0 -24
- package/dist/sst.config.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1,924 +0,0 @@
|
|
|
1
|
-
import { all, interpolate, output, } from "@pulumi/pulumi";
|
|
2
|
-
import { Component, transform } from "../component.js";
|
|
3
|
-
import { dns as awsDns } from "./dns.js";
|
|
4
|
-
import { VisibleError } from "../error.js";
|
|
5
|
-
import { DnsValidatedCertificate } from "./dns-validated-certificate.js";
|
|
6
|
-
import { URL_UNAVAILABLE } from "./linkable.js";
|
|
7
|
-
import { appautoscaling, ec2, ecs, getRegionOutput, lb, servicediscovery, } from "@pulumi/aws";
|
|
8
|
-
import { Vpc } from "./vpc.js";
|
|
9
|
-
import { DevCommand } from "../experimental/dev-command.js";
|
|
10
|
-
import { toSeconds } from "../duration.js";
|
|
11
|
-
import { createExecutionRole, createTaskDefinition, createTaskRole, normalizeArchitecture, normalizeContainers, normalizeCpu, normalizeMemory, normalizeStorage, } from "./fargate.js";
|
|
12
|
-
import { hashStringToPrettyString } from "../naming.js";
|
|
13
|
-
/**
|
|
14
|
-
* The `Service` component lets you create containers that are always running, like web or
|
|
15
|
-
* application servers. It uses [Amazon ECS](https://aws.amazon.com/ecs/) on [AWS Fargate](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html).
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
*
|
|
19
|
-
* #### Create a Service
|
|
20
|
-
*
|
|
21
|
-
* Services are run inside an ECS Cluster. If you haven't already, create one.
|
|
22
|
-
*
|
|
23
|
-
* ```ts title="sst.config.ts"
|
|
24
|
-
* const vpc = new sst.aws.Vpc("MyVpc");
|
|
25
|
-
* const cluster = new sst.aws.Cluster("MyCluster", { vpc });
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* Add the service to it.
|
|
29
|
-
*
|
|
30
|
-
* ```ts title="sst.config.ts"
|
|
31
|
-
* const service = new sst.aws.Service("MyService", { cluster });
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* #### Configure the container image
|
|
35
|
-
*
|
|
36
|
-
* By default, the service will look for a Dockerfile in the root directory. Optionally
|
|
37
|
-
* configure the image context and dockerfile.
|
|
38
|
-
*
|
|
39
|
-
* ```ts title="sst.config.ts"
|
|
40
|
-
* new sst.aws.Service("MyService", {
|
|
41
|
-
* cluster,
|
|
42
|
-
* image: {
|
|
43
|
-
* context: "./app",
|
|
44
|
-
* dockerfile: "Dockerfile"
|
|
45
|
-
* }
|
|
46
|
-
* });
|
|
47
|
-
* ```
|
|
48
|
-
*
|
|
49
|
-
* To add multiple containers in the service, pass in an array of containers args.
|
|
50
|
-
*
|
|
51
|
-
* ```ts title="sst.config.ts"
|
|
52
|
-
* new sst.aws.Service("MyService", {
|
|
53
|
-
* cluster,
|
|
54
|
-
* containers: [
|
|
55
|
-
* {
|
|
56
|
-
* name: "app",
|
|
57
|
-
* image: "nginxdemos/hello:plain-text"
|
|
58
|
-
* },
|
|
59
|
-
* {
|
|
60
|
-
* name: "admin",
|
|
61
|
-
* image: {
|
|
62
|
-
* context: "./admin",
|
|
63
|
-
* dockerfile: "Dockerfile"
|
|
64
|
-
* }
|
|
65
|
-
* }
|
|
66
|
-
* ]
|
|
67
|
-
* });
|
|
68
|
-
* ```
|
|
69
|
-
*
|
|
70
|
-
* This is useful for running sidecar containers.
|
|
71
|
-
*
|
|
72
|
-
* #### Enable auto-scaling
|
|
73
|
-
*
|
|
74
|
-
* ```ts title="sst.config.ts"
|
|
75
|
-
* new sst.aws.Service("MyService", {
|
|
76
|
-
* cluster,
|
|
77
|
-
* scaling: {
|
|
78
|
-
* min: 4,
|
|
79
|
-
* max: 16,
|
|
80
|
-
* cpuUtilization: 50,
|
|
81
|
-
* memoryUtilization: 50
|
|
82
|
-
* }
|
|
83
|
-
* });
|
|
84
|
-
* ```
|
|
85
|
-
*
|
|
86
|
-
* #### Expose through API Gateway
|
|
87
|
-
*
|
|
88
|
-
* You can give your service a public URL by exposing it through API Gateway HTTP API. You can
|
|
89
|
-
* also optionally give it a custom domain.
|
|
90
|
-
*
|
|
91
|
-
* ```ts title="sst.config.ts"
|
|
92
|
-
* const service = new sst.aws.Service("MyService", {
|
|
93
|
-
* cluster,
|
|
94
|
-
* serviceRegistry: {
|
|
95
|
-
* port: 80
|
|
96
|
-
* }
|
|
97
|
-
* });
|
|
98
|
-
*
|
|
99
|
-
* const api = new sst.aws.ApiGatewayV2("MyApi", {
|
|
100
|
-
* vpc,
|
|
101
|
-
* domain: "example.com"
|
|
102
|
-
* });
|
|
103
|
-
* api.routePrivate("$default", service.nodes.cloudmapService.arn);
|
|
104
|
-
* ```
|
|
105
|
-
*
|
|
106
|
-
* #### Add a load balancer
|
|
107
|
-
*
|
|
108
|
-
* You can also expose your service by adding a load balancer to it and optionally
|
|
109
|
-
* adding a custom domain.
|
|
110
|
-
*
|
|
111
|
-
* ```ts title="sst.config.ts"
|
|
112
|
-
* new sst.aws.Service("MyService", {
|
|
113
|
-
* cluster,
|
|
114
|
-
* loadBalancer: {
|
|
115
|
-
* domain: "example.com",
|
|
116
|
-
* rules: [
|
|
117
|
-
* { listen: "80/http" },
|
|
118
|
-
* { listen: "443/https", forward: "80/http" }
|
|
119
|
-
* ]
|
|
120
|
-
* }
|
|
121
|
-
* });
|
|
122
|
-
* ```
|
|
123
|
-
*
|
|
124
|
-
* #### Link resources
|
|
125
|
-
*
|
|
126
|
-
* [Link resources](/docs/linking/) to your service. This will grant permissions
|
|
127
|
-
* to the resources and allow you to access it in your app.
|
|
128
|
-
*
|
|
129
|
-
* ```ts {5} title="sst.config.ts"
|
|
130
|
-
* const bucket = new sst.aws.Bucket("MyBucket");
|
|
131
|
-
*
|
|
132
|
-
* new sst.aws.Service("MyService", {
|
|
133
|
-
* cluster,
|
|
134
|
-
* link: [bucket]
|
|
135
|
-
* });
|
|
136
|
-
* ```
|
|
137
|
-
*
|
|
138
|
-
* You can use the [SDK](/docs/reference/sdk/) to access the linked resources in your service.
|
|
139
|
-
*
|
|
140
|
-
* ```ts title="app.ts"
|
|
141
|
-
* import { Resource } from "sst";
|
|
142
|
-
*
|
|
143
|
-
* console.log(Resource.MyBucket.name);
|
|
144
|
-
* ```
|
|
145
|
-
*
|
|
146
|
-
* #### Service discovery
|
|
147
|
-
*
|
|
148
|
-
* This component automatically creates a Cloud Map service host name for the
|
|
149
|
-
* service. So anything in the same VPC can access it using the service's host name.
|
|
150
|
-
*
|
|
151
|
-
* For example, if you link the service to a Lambda function that's in the same VPC.
|
|
152
|
-
*
|
|
153
|
-
* ```ts title="sst.config.ts" {2,4}
|
|
154
|
-
* new sst.aws.Function("MyFunction", {
|
|
155
|
-
* vpc,
|
|
156
|
-
* url: true,
|
|
157
|
-
* link: [service],
|
|
158
|
-
* handler: "lambda.handler"
|
|
159
|
-
* });
|
|
160
|
-
* ```
|
|
161
|
-
*
|
|
162
|
-
* You can access the service by its host name using the [SDK](/docs/reference/sdk/).
|
|
163
|
-
*
|
|
164
|
-
* ```ts title="lambda.ts"
|
|
165
|
-
* import { Resource } from "sst";
|
|
166
|
-
*
|
|
167
|
-
* await fetch(`http://${Resource.MyService.service}`);
|
|
168
|
-
* ```
|
|
169
|
-
*
|
|
170
|
-
* [Check out an example](/docs/examples/#aws-cluster-service-discovery).
|
|
171
|
-
*
|
|
172
|
-
* ---
|
|
173
|
-
*
|
|
174
|
-
* ### Cost
|
|
175
|
-
*
|
|
176
|
-
* By default, this uses a _Linux/X86_ _Fargate_ container with 0.25 vCPUs at $0.04048 per
|
|
177
|
-
* vCPU per hour and 0.5 GB of memory at $0.004445 per GB per hour. It includes 20GB of
|
|
178
|
-
* _Ephemeral Storage_ for free with additional storage at $0.000111 per GB per hour. Each
|
|
179
|
-
* container also gets a public IPv4 address at $0.005 per hour.
|
|
180
|
-
*
|
|
181
|
-
* It works out to $0.04048 x 0.25 x 24 x 30 + $0.004445 x 0.5 x 24 x 30 + $0.005
|
|
182
|
-
* x 24 x 30 or **$12 per month**.
|
|
183
|
-
*
|
|
184
|
-
* If you are using all Fargate Spot instances with `capacity: "spot"`, it's $0.01218784 x 0.25
|
|
185
|
-
* x 24 x 30 + $0.00133831 x 0.5 x 24 x 30 + $0.005 x 24 x 30 or **$6 per month**
|
|
186
|
-
*
|
|
187
|
-
* Adjust this for the `cpu`, `memory` and `storage` you are using. And
|
|
188
|
-
* check the prices for _Linux/ARM_ if you are using `arm64` as your `architecture`.
|
|
189
|
-
*
|
|
190
|
-
* The above are rough estimates for _us-east-1_, check out the
|
|
191
|
-
* [Fargate pricing](https://aws.amazon.com/fargate/pricing/) and the
|
|
192
|
-
* [Public IPv4 Address pricing](https://aws.amazon.com/vpc/pricing/) for more details.
|
|
193
|
-
*
|
|
194
|
-
* #### Scaling
|
|
195
|
-
*
|
|
196
|
-
* By default, `scaling` is disabled. If enabled, adjust the above for the number of containers.
|
|
197
|
-
*
|
|
198
|
-
* #### API Gateway
|
|
199
|
-
*
|
|
200
|
-
* If you expose your service through API Gateway, you'll need to add the cost of
|
|
201
|
-
* [API Gateway HTTP API](https://aws.amazon.com/api-gateway/pricing/#HTTP_APIs) as well.
|
|
202
|
-
* For services that don't get a lot of traffic, this ends up being a lot cheaper since API
|
|
203
|
-
* Gateway is pay per request.
|
|
204
|
-
*
|
|
205
|
-
* Learn more about using
|
|
206
|
-
* [Cluster with API Gateway](/docs/examples/#aws-cluster-with-api-gateway).
|
|
207
|
-
*
|
|
208
|
-
* #### Application Load Balancer
|
|
209
|
-
*
|
|
210
|
-
* If you add `loadBalancer` _HTTP_ or _HTTPS_ `rules`, an ALB is created at $0.0225 per hour,
|
|
211
|
-
* $0.008 per LCU-hour, and $0.005 per hour if HTTPS with a custom domain is used. Where LCU
|
|
212
|
-
* is a measure of how much traffic is processed.
|
|
213
|
-
*
|
|
214
|
-
* That works out to $0.0225 x 24 x 30 or **$16 per month**. Add $0.005 x 24 x 30 or **$4 per
|
|
215
|
-
* month** for HTTPS. Also add the LCU-hour used.
|
|
216
|
-
*
|
|
217
|
-
* The above are rough estimates for _us-east-1_, check out the
|
|
218
|
-
* [Application Load Balancer pricing](https://aws.amazon.com/elasticloadbalancing/pricing/)
|
|
219
|
-
* for more details.
|
|
220
|
-
*
|
|
221
|
-
* #### Network Load Balancer
|
|
222
|
-
*
|
|
223
|
-
* If you add `loadBalancer` _TCP_, _UDP_, or _TLS_ `rules`, an NLB is created at $0.0225 per hour and
|
|
224
|
-
* $0.006 per NLCU-hour. Where NCLU is a measure of how much traffic is processed.
|
|
225
|
-
*
|
|
226
|
-
* That works out to $0.0225 x 24 x 30 or **$16 per month**. Also add the NLCU-hour used.
|
|
227
|
-
*
|
|
228
|
-
* The above are rough estimates for _us-east-1_, check out the
|
|
229
|
-
* [Network Load Balancer pricing](https://aws.amazon.com/elasticloadbalancing/pricing/)
|
|
230
|
-
* for more details.
|
|
231
|
-
*/
|
|
232
|
-
export class Service extends Component {
|
|
233
|
-
constructor(name, args, opts = {}) {
|
|
234
|
-
var _a, _b;
|
|
235
|
-
super(__pulumiType, name, args, opts);
|
|
236
|
-
this._name = name;
|
|
237
|
-
const self = this;
|
|
238
|
-
const clusterArn = args.cluster.nodes.cluster.arn;
|
|
239
|
-
const clusterName = args.cluster.nodes.cluster.name;
|
|
240
|
-
const region = getRegionOutput({}, opts).name;
|
|
241
|
-
const dev = normalizeDev();
|
|
242
|
-
const wait = output((_a = args.wait) !== null && _a !== void 0 ? _a : false);
|
|
243
|
-
const architecture = normalizeArchitecture(args);
|
|
244
|
-
const cpu = normalizeCpu(args);
|
|
245
|
-
const memory = normalizeMemory(cpu, args);
|
|
246
|
-
const storage = normalizeStorage(args);
|
|
247
|
-
const containers = normalizeContainers("service", args, name, architecture);
|
|
248
|
-
const lbArgs = normalizeLoadBalancer();
|
|
249
|
-
const scaling = normalizeScaling();
|
|
250
|
-
const capacity = normalizeCapacity();
|
|
251
|
-
const vpc = normalizeVpc();
|
|
252
|
-
const taskRole = createTaskRole(name, args, opts, self, !!dev);
|
|
253
|
-
this.dev = !!dev;
|
|
254
|
-
this.cloudmapNamespace = vpc.cloudmapNamespaceName;
|
|
255
|
-
this.taskRole = taskRole;
|
|
256
|
-
if (dev) {
|
|
257
|
-
this.devUrl = !lbArgs ? undefined : dev.url;
|
|
258
|
-
registerReceiver();
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
const executionRole = createExecutionRole(name, args, opts, self);
|
|
262
|
-
const taskDefinition = createTaskDefinition(name, args, opts, self, containers, architecture, cpu, memory, storage, taskRole, executionRole);
|
|
263
|
-
const certificateArn = createSsl();
|
|
264
|
-
const loadBalancer = createLoadBalancer();
|
|
265
|
-
const targetGroups = createTargets();
|
|
266
|
-
createListeners();
|
|
267
|
-
const cloudmapService = createCloudmapService();
|
|
268
|
-
const service = createService();
|
|
269
|
-
const autoScalingTarget = createAutoScaling();
|
|
270
|
-
createDnsRecords();
|
|
271
|
-
this._service = service;
|
|
272
|
-
this.cloudmapService = cloudmapService;
|
|
273
|
-
this.executionRole = executionRole;
|
|
274
|
-
this.taskDefinition = taskDefinition;
|
|
275
|
-
this.loadBalancer = loadBalancer;
|
|
276
|
-
this.autoScalingTarget = autoScalingTarget;
|
|
277
|
-
this.domain = (lbArgs === null || lbArgs === void 0 ? void 0 : lbArgs.domain)
|
|
278
|
-
? lbArgs.domain.apply((domain) => domain === null || domain === void 0 ? void 0 : domain.name)
|
|
279
|
-
: output(undefined);
|
|
280
|
-
this._url = !self.loadBalancer
|
|
281
|
-
? undefined
|
|
282
|
-
: all([self.domain, (_b = self.loadBalancer) === null || _b === void 0 ? void 0 : _b.dnsName]).apply(([domain, loadBalancer]) => domain ? `https://${domain}/` : `http://${loadBalancer}`);
|
|
283
|
-
this.registerOutputs({ _hint: this._url });
|
|
284
|
-
registerReceiver();
|
|
285
|
-
function normalizeDev() {
|
|
286
|
-
var _a, _b;
|
|
287
|
-
if (!$dev)
|
|
288
|
-
return undefined;
|
|
289
|
-
if (args.dev === false)
|
|
290
|
-
return undefined;
|
|
291
|
-
return {
|
|
292
|
-
url: output((_b = (_a = args.dev) === null || _a === void 0 ? void 0 : _a.url) !== null && _b !== void 0 ? _b : URL_UNAVAILABLE),
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
function normalizeVpc() {
|
|
296
|
-
// "vpc" is a Vpc component
|
|
297
|
-
if (args.cluster.vpc instanceof Vpc) {
|
|
298
|
-
const vpc = args.cluster.vpc;
|
|
299
|
-
return {
|
|
300
|
-
isSstVpc: true,
|
|
301
|
-
id: vpc.id,
|
|
302
|
-
loadBalancerSubnets: lbArgs === null || lbArgs === void 0 ? void 0 : lbArgs.pub.apply((v) => v ? vpc.publicSubnets : vpc.privateSubnets),
|
|
303
|
-
containerSubnets: vpc.publicSubnets,
|
|
304
|
-
securityGroups: vpc.securityGroups,
|
|
305
|
-
cloudmapNamespaceId: vpc.nodes.cloudmapNamespace.id,
|
|
306
|
-
cloudmapNamespaceName: vpc.nodes.cloudmapNamespace.name,
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
|
-
// "vpc" is object
|
|
310
|
-
return output(args.cluster.vpc).apply((vpc) => (Object.assign({ isSstVpc: false }, vpc)));
|
|
311
|
-
}
|
|
312
|
-
function normalizeScaling() {
|
|
313
|
-
return all([lbArgs === null || lbArgs === void 0 ? void 0 : lbArgs.type, args.scaling]).apply(([type, v]) => {
|
|
314
|
-
var _a, _b, _c, _d, _e;
|
|
315
|
-
if (type !== "application" && (v === null || v === void 0 ? void 0 : v.requestCount))
|
|
316
|
-
throw new VisibleError(`Request count scaling is only supported for http/https protocols.`);
|
|
317
|
-
return {
|
|
318
|
-
min: (_a = v === null || v === void 0 ? void 0 : v.min) !== null && _a !== void 0 ? _a : 1,
|
|
319
|
-
max: (_b = v === null || v === void 0 ? void 0 : v.max) !== null && _b !== void 0 ? _b : 1,
|
|
320
|
-
cpuUtilization: (_c = v === null || v === void 0 ? void 0 : v.cpuUtilization) !== null && _c !== void 0 ? _c : 70,
|
|
321
|
-
memoryUtilization: (_d = v === null || v === void 0 ? void 0 : v.memoryUtilization) !== null && _d !== void 0 ? _d : 70,
|
|
322
|
-
requestCount: (_e = v === null || v === void 0 ? void 0 : v.requestCount) !== null && _e !== void 0 ? _e : false,
|
|
323
|
-
};
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
function normalizeCapacity() {
|
|
327
|
-
if (!args.capacity)
|
|
328
|
-
return;
|
|
329
|
-
return output(args.capacity).apply((v) => {
|
|
330
|
-
if (v === "spot")
|
|
331
|
-
return { spot: { weight: 1 }, fargate: { weight: 0 } };
|
|
332
|
-
return v;
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
function normalizeLoadBalancer() {
|
|
336
|
-
var _a;
|
|
337
|
-
const loadBalancer = ((_a = args.loadBalancer) !== null && _a !== void 0 ? _a : args.public);
|
|
338
|
-
if (!loadBalancer)
|
|
339
|
-
return;
|
|
340
|
-
// normalize rules
|
|
341
|
-
const rules = all([loadBalancer, containers]).apply(([lb, containers]) => {
|
|
342
|
-
var _a;
|
|
343
|
-
// validate rules
|
|
344
|
-
const lbRules = (_a = lb.rules) !== null && _a !== void 0 ? _a : lb.ports;
|
|
345
|
-
if (!lbRules || lbRules.length === 0)
|
|
346
|
-
throw new VisibleError(`You must provide the ports to expose via "loadBalancer.rules".`);
|
|
347
|
-
// validate container defined when multiple containers exists
|
|
348
|
-
if (containers.length > 1) {
|
|
349
|
-
lbRules.forEach((v) => {
|
|
350
|
-
if (!v.container)
|
|
351
|
-
throw new VisibleError(`You must provide a container name in "loadBalancer.rules" when there is more than one container.`);
|
|
352
|
-
});
|
|
353
|
-
}
|
|
354
|
-
// parse protocols and ports
|
|
355
|
-
const rules = lbRules.map((v) => {
|
|
356
|
-
var _a, _b, _c, _d, _e, _f;
|
|
357
|
-
const listenParts = v.listen.split("/");
|
|
358
|
-
const listenPort = parseInt(listenParts[0]);
|
|
359
|
-
const listenProtocol = listenParts[1];
|
|
360
|
-
const listenConditions = v.conditions || v.path
|
|
361
|
-
? {
|
|
362
|
-
path: (_b = (_a = v.conditions) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : v.path,
|
|
363
|
-
query: (_c = v.conditions) === null || _c === void 0 ? void 0 : _c.query,
|
|
364
|
-
header: (_d = v.conditions) === null || _d === void 0 ? void 0 : _d.header,
|
|
365
|
-
}
|
|
366
|
-
: undefined;
|
|
367
|
-
if (protocolType(listenProtocol) === "network" && listenConditions)
|
|
368
|
-
throw new VisibleError(`Invalid rule conditions for listen protocol "${v.listen}". Only "http" protocols support conditions.`);
|
|
369
|
-
const redirectParts = (_e = v.redirect) === null || _e === void 0 ? void 0 : _e.split("/");
|
|
370
|
-
const redirectPort = redirectParts && parseInt(redirectParts[0]);
|
|
371
|
-
const redirectProtocol = redirectParts && redirectParts[1];
|
|
372
|
-
if (redirectPort && redirectProtocol) {
|
|
373
|
-
if (protocolType(listenProtocol) !== protocolType(redirectProtocol))
|
|
374
|
-
throw new VisibleError(`The listen protocol "${v.listen}" must match the redirect protocol "${v.redirect}".`);
|
|
375
|
-
return {
|
|
376
|
-
type: "redirect",
|
|
377
|
-
listenPort,
|
|
378
|
-
listenProtocol,
|
|
379
|
-
listenConditions,
|
|
380
|
-
redirectPort,
|
|
381
|
-
redirectProtocol,
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
const forwardParts = v.forward ? v.forward.split("/") : listenParts;
|
|
385
|
-
const forwardPort = forwardParts && parseInt(forwardParts[0]);
|
|
386
|
-
const forwardProtocol = forwardParts && forwardParts[1];
|
|
387
|
-
if (protocolType(listenProtocol) !== protocolType(forwardProtocol))
|
|
388
|
-
throw new VisibleError(`The listen protocol "${v.listen}" must match the forward protocol "${v.forward}".`);
|
|
389
|
-
return {
|
|
390
|
-
type: "forward",
|
|
391
|
-
listenPort,
|
|
392
|
-
listenProtocol,
|
|
393
|
-
listenConditions,
|
|
394
|
-
forwardPort,
|
|
395
|
-
forwardProtocol,
|
|
396
|
-
container: (_f = v.container) !== null && _f !== void 0 ? _f : containers[0].name,
|
|
397
|
-
};
|
|
398
|
-
});
|
|
399
|
-
// validate protocols are consistent
|
|
400
|
-
const appProtocols = rules.filter((rule) => protocolType(rule.listenProtocol) === "application");
|
|
401
|
-
if (appProtocols.length > 0 && appProtocols.length < rules.length)
|
|
402
|
-
throw new VisibleError(`Protocols must be either all http/https, or all tcp/udp/tcp_udp/tls.`);
|
|
403
|
-
// validate certificate exists for https/tls protocol
|
|
404
|
-
rules.forEach((rule) => {
|
|
405
|
-
if (["https", "tls"].includes(rule.listenProtocol) && !lb.domain) {
|
|
406
|
-
throw new VisibleError(`You must provide a custom domain for ${rule.listenProtocol.toUpperCase()} protocol.`);
|
|
407
|
-
}
|
|
408
|
-
});
|
|
409
|
-
return rules;
|
|
410
|
-
});
|
|
411
|
-
// normalize domain
|
|
412
|
-
const domain = output(loadBalancer).apply((lb) => {
|
|
413
|
-
var _a, _b;
|
|
414
|
-
if (!lb.domain)
|
|
415
|
-
return undefined;
|
|
416
|
-
// normalize domain
|
|
417
|
-
const domain = typeof lb.domain === "string" ? { name: lb.domain } : lb.domain;
|
|
418
|
-
return {
|
|
419
|
-
name: domain.name,
|
|
420
|
-
aliases: (_a = domain.aliases) !== null && _a !== void 0 ? _a : [],
|
|
421
|
-
dns: domain.dns === false ? undefined : (_b = domain.dns) !== null && _b !== void 0 ? _b : awsDns(),
|
|
422
|
-
cert: domain.cert,
|
|
423
|
-
};
|
|
424
|
-
});
|
|
425
|
-
// normalize type
|
|
426
|
-
const type = output(rules).apply((rules) => rules[0].listenProtocol.startsWith("http") ? "application" : "network");
|
|
427
|
-
// normalize public/private
|
|
428
|
-
const pub = output(loadBalancer).apply((lb) => { var _a; return (_a = lb === null || lb === void 0 ? void 0 : lb.public) !== null && _a !== void 0 ? _a : true; });
|
|
429
|
-
// normalize health check
|
|
430
|
-
const health = all([type, rules, loadBalancer]).apply(([type, rules, lb]) => {
|
|
431
|
-
var _a;
|
|
432
|
-
return Object.fromEntries(Object.entries((_a = lb === null || lb === void 0 ? void 0 : lb.health) !== null && _a !== void 0 ? _a : {}).map(([k, v]) => {
|
|
433
|
-
var _a, _b, _c, _d;
|
|
434
|
-
if (!rules.find((r) => `${r.forwardPort}/${r.forwardProtocol}` === k))
|
|
435
|
-
throw new VisibleError(`Cannot configure health check for "${k}". Make sure it is defined in "loadBalancer.ports".`);
|
|
436
|
-
return [
|
|
437
|
-
k,
|
|
438
|
-
{
|
|
439
|
-
path: (_a = v.path) !== null && _a !== void 0 ? _a : "/",
|
|
440
|
-
interval: v.interval ? toSeconds(v.interval) : 30,
|
|
441
|
-
timeout: v.timeout
|
|
442
|
-
? toSeconds(v.timeout)
|
|
443
|
-
: type === "application"
|
|
444
|
-
? 5
|
|
445
|
-
: 6,
|
|
446
|
-
healthyThreshold: (_b = v.healthyThreshold) !== null && _b !== void 0 ? _b : 5,
|
|
447
|
-
unhealthyThreshold: (_c = v.unhealthyThreshold) !== null && _c !== void 0 ? _c : 2,
|
|
448
|
-
matcher: (_d = v.successCodes) !== null && _d !== void 0 ? _d : "200",
|
|
449
|
-
},
|
|
450
|
-
];
|
|
451
|
-
}));
|
|
452
|
-
});
|
|
453
|
-
return { type, rules, domain, pub, health };
|
|
454
|
-
}
|
|
455
|
-
function createLoadBalancer() {
|
|
456
|
-
var _a, _b;
|
|
457
|
-
if (!lbArgs)
|
|
458
|
-
return;
|
|
459
|
-
const securityGroup = new ec2.SecurityGroup(...transform((_a = args === null || args === void 0 ? void 0 : args.transform) === null || _a === void 0 ? void 0 : _a.loadBalancerSecurityGroup, `${name}LoadBalancerSecurityGroup`, {
|
|
460
|
-
description: "Managed by SST",
|
|
461
|
-
vpcId: vpc.id,
|
|
462
|
-
egress: [
|
|
463
|
-
{
|
|
464
|
-
fromPort: 0,
|
|
465
|
-
toPort: 0,
|
|
466
|
-
protocol: "-1",
|
|
467
|
-
cidrBlocks: ["0.0.0.0/0"],
|
|
468
|
-
},
|
|
469
|
-
],
|
|
470
|
-
ingress: [
|
|
471
|
-
{
|
|
472
|
-
fromPort: 0,
|
|
473
|
-
toPort: 0,
|
|
474
|
-
protocol: "-1",
|
|
475
|
-
cidrBlocks: ["0.0.0.0/0"],
|
|
476
|
-
},
|
|
477
|
-
],
|
|
478
|
-
}, { parent: self }));
|
|
479
|
-
return new lb.LoadBalancer(...transform((_b = args.transform) === null || _b === void 0 ? void 0 : _b.loadBalancer, `${name}LoadBalancer`, {
|
|
480
|
-
internal: lbArgs.pub.apply((v) => !v),
|
|
481
|
-
loadBalancerType: lbArgs.type,
|
|
482
|
-
subnets: vpc.loadBalancerSubnets,
|
|
483
|
-
securityGroups: [securityGroup.id],
|
|
484
|
-
enableCrossZoneLoadBalancing: true,
|
|
485
|
-
}, { parent: self }));
|
|
486
|
-
}
|
|
487
|
-
function createTargets() {
|
|
488
|
-
if (!loadBalancer || !lbArgs)
|
|
489
|
-
return;
|
|
490
|
-
return all([lbArgs.rules, lbArgs.health]).apply(([rules, health]) => {
|
|
491
|
-
const targets = {};
|
|
492
|
-
rules.forEach((r) => {
|
|
493
|
-
var _a, _b;
|
|
494
|
-
if (r.type !== "forward")
|
|
495
|
-
return;
|
|
496
|
-
const container = r.container;
|
|
497
|
-
const forwardProtocol = r.forwardProtocol.toUpperCase();
|
|
498
|
-
const forwardPort = r.forwardPort;
|
|
499
|
-
const targetId = `${container}${forwardProtocol}${forwardPort}`;
|
|
500
|
-
const target = (_a = targets[targetId]) !== null && _a !== void 0 ? _a : new lb.TargetGroup(...transform((_b = args.transform) === null || _b === void 0 ? void 0 : _b.target, `${name}Target${targetId}`, {
|
|
501
|
-
// TargetGroup names allow for 32 chars, but an 8 letter suffix
|
|
502
|
-
// ie. "-1234567" is automatically added.
|
|
503
|
-
// - If we don't specify "name" or "namePrefix", we need to ensure
|
|
504
|
-
// the component name is less than 24 chars. Hard to guarantee.
|
|
505
|
-
// - If we specify "name", we need to ensure the $app-$stage-$name
|
|
506
|
-
// if less than 32 chars. Hard to guarantee.
|
|
507
|
-
// - Hence we will use "namePrefix".
|
|
508
|
-
namePrefix: forwardProtocol,
|
|
509
|
-
port: forwardPort,
|
|
510
|
-
protocol: forwardProtocol,
|
|
511
|
-
targetType: "ip",
|
|
512
|
-
vpcId: vpc.id,
|
|
513
|
-
healthCheck: health[`${r.forwardPort}/${r.forwardProtocol}`],
|
|
514
|
-
}, { parent: self }));
|
|
515
|
-
targets[targetId] = target;
|
|
516
|
-
});
|
|
517
|
-
return targets;
|
|
518
|
-
});
|
|
519
|
-
}
|
|
520
|
-
function createListeners() {
|
|
521
|
-
if (!lbArgs || !loadBalancer || !targetGroups)
|
|
522
|
-
return;
|
|
523
|
-
return all([lbArgs.rules, targetGroups, certificateArn]).apply(([rules, targets, cert]) => {
|
|
524
|
-
// Group listeners by protocol and port
|
|
525
|
-
// Because listeners with the same protocol and port but different path
|
|
526
|
-
// are just rules of the same listener.
|
|
527
|
-
const listenersById = {};
|
|
528
|
-
rules.forEach((r) => {
|
|
529
|
-
var _a;
|
|
530
|
-
const listenProtocol = r.listenProtocol.toUpperCase();
|
|
531
|
-
const listenPort = r.listenPort;
|
|
532
|
-
const listenerId = `${listenProtocol}${listenPort}`;
|
|
533
|
-
listenersById[listenerId] = (_a = listenersById[listenerId]) !== null && _a !== void 0 ? _a : [];
|
|
534
|
-
listenersById[listenerId].push(r);
|
|
535
|
-
});
|
|
536
|
-
// Create listeners
|
|
537
|
-
return Object.entries(listenersById).map(([listenerId, rules]) => {
|
|
538
|
-
var _a;
|
|
539
|
-
const listenProtocol = rules[0].listenProtocol.toUpperCase();
|
|
540
|
-
const listenPort = rules[0].listenPort;
|
|
541
|
-
const defaultRule = rules.find((r) => !r.listenConditions);
|
|
542
|
-
const customRules = rules.filter((r) => r.listenConditions);
|
|
543
|
-
const buildActions = (r) => [
|
|
544
|
-
...(!r
|
|
545
|
-
? [
|
|
546
|
-
{
|
|
547
|
-
type: "fixed-response",
|
|
548
|
-
fixedResponse: {
|
|
549
|
-
statusCode: "403",
|
|
550
|
-
contentType: "text/plain",
|
|
551
|
-
messageBody: "Forbidden",
|
|
552
|
-
},
|
|
553
|
-
},
|
|
554
|
-
]
|
|
555
|
-
: []),
|
|
556
|
-
...((r === null || r === void 0 ? void 0 : r.type) === "forward"
|
|
557
|
-
? [
|
|
558
|
-
{
|
|
559
|
-
type: "forward",
|
|
560
|
-
targetGroupArn: targets[`${r.container}${r.forwardProtocol.toUpperCase()}${r.forwardPort}`].arn,
|
|
561
|
-
},
|
|
562
|
-
]
|
|
563
|
-
: []),
|
|
564
|
-
...((r === null || r === void 0 ? void 0 : r.type) === "redirect"
|
|
565
|
-
? [
|
|
566
|
-
{
|
|
567
|
-
type: "redirect",
|
|
568
|
-
redirect: {
|
|
569
|
-
port: r.redirectPort.toString(),
|
|
570
|
-
protocol: r.redirectProtocol.toUpperCase(),
|
|
571
|
-
statusCode: "HTTP_301",
|
|
572
|
-
},
|
|
573
|
-
},
|
|
574
|
-
]
|
|
575
|
-
: []),
|
|
576
|
-
];
|
|
577
|
-
const listener = new lb.Listener(...transform((_a = args.transform) === null || _a === void 0 ? void 0 : _a.listener, `${name}Listener${listenerId}`, {
|
|
578
|
-
loadBalancerArn: loadBalancer.arn,
|
|
579
|
-
port: listenPort,
|
|
580
|
-
protocol: listenProtocol,
|
|
581
|
-
certificateArn: ["HTTPS", "TLS"].includes(listenProtocol)
|
|
582
|
-
? cert
|
|
583
|
-
: undefined,
|
|
584
|
-
defaultActions: buildActions(defaultRule),
|
|
585
|
-
}, { parent: self }));
|
|
586
|
-
customRules.forEach((r) => new lb.ListenerRule(`${name}Listener${listenerId}Rule${hashStringToPrettyString(JSON.stringify(r.listenConditions), 4)}`, {
|
|
587
|
-
listenerArn: listener.arn,
|
|
588
|
-
actions: buildActions(r),
|
|
589
|
-
conditions: [
|
|
590
|
-
{
|
|
591
|
-
pathPattern: r.listenConditions.path
|
|
592
|
-
? { values: [r.listenConditions.path] }
|
|
593
|
-
: undefined,
|
|
594
|
-
queryStrings: r.listenConditions.query,
|
|
595
|
-
httpHeader: r.listenConditions.header
|
|
596
|
-
? {
|
|
597
|
-
httpHeaderName: r.listenConditions.header.name,
|
|
598
|
-
values: r.listenConditions.header.values,
|
|
599
|
-
}
|
|
600
|
-
: undefined,
|
|
601
|
-
},
|
|
602
|
-
],
|
|
603
|
-
}, { parent: self }));
|
|
604
|
-
return listener;
|
|
605
|
-
});
|
|
606
|
-
});
|
|
607
|
-
}
|
|
608
|
-
function createSsl() {
|
|
609
|
-
if (!lbArgs)
|
|
610
|
-
return output(undefined);
|
|
611
|
-
return lbArgs.domain.apply((domain) => {
|
|
612
|
-
if (!domain)
|
|
613
|
-
return output(undefined);
|
|
614
|
-
if (domain.cert)
|
|
615
|
-
return output(domain.cert);
|
|
616
|
-
return new DnsValidatedCertificate(`${name}Ssl`, {
|
|
617
|
-
domainName: domain.name,
|
|
618
|
-
alternativeNames: domain.aliases,
|
|
619
|
-
dns: domain.dns,
|
|
620
|
-
}, { parent: self }).arn;
|
|
621
|
-
});
|
|
622
|
-
}
|
|
623
|
-
function createCloudmapService() {
|
|
624
|
-
return output(vpc.cloudmapNamespaceId).apply((cloudmapNamespaceId) => {
|
|
625
|
-
if (!cloudmapNamespaceId)
|
|
626
|
-
return;
|
|
627
|
-
return new servicediscovery.Service(`${name}CloudmapService`, {
|
|
628
|
-
name: `${name}.${$app.stage}.${$app.name}`,
|
|
629
|
-
namespaceId: output(vpc.cloudmapNamespaceId).apply((id) => id),
|
|
630
|
-
forceDestroy: true,
|
|
631
|
-
dnsConfig: {
|
|
632
|
-
namespaceId: output(vpc.cloudmapNamespaceId).apply((id) => id),
|
|
633
|
-
dnsRecords: [
|
|
634
|
-
...(args.serviceRegistry ? [{ ttl: 60, type: "SRV" }] : []),
|
|
635
|
-
{ ttl: 60, type: "A" },
|
|
636
|
-
],
|
|
637
|
-
},
|
|
638
|
-
}, { parent: self });
|
|
639
|
-
});
|
|
640
|
-
}
|
|
641
|
-
function createService() {
|
|
642
|
-
return cloudmapService.apply((cloudmapService) => {
|
|
643
|
-
var _a;
|
|
644
|
-
return new ecs.Service(...transform((_a = args.transform) === null || _a === void 0 ? void 0 : _a.service, `${name}Service`, Object.assign(Object.assign({ name, cluster: clusterArn, taskDefinition: taskDefinition.arn, desiredCount: scaling.min }, (capacity
|
|
645
|
-
? {
|
|
646
|
-
// setting `forceNewDeployment` ensures that the service is not recreated
|
|
647
|
-
// when the capacity provider config changes.
|
|
648
|
-
forceNewDeployment: true,
|
|
649
|
-
capacityProviderStrategies: capacity.apply((v) => {
|
|
650
|
-
var _a, _b, _c, _d;
|
|
651
|
-
return [
|
|
652
|
-
...(v.fargate
|
|
653
|
-
? [
|
|
654
|
-
{
|
|
655
|
-
capacityProvider: "FARGATE",
|
|
656
|
-
base: (_a = v.fargate) === null || _a === void 0 ? void 0 : _a.base,
|
|
657
|
-
weight: (_b = v.fargate) === null || _b === void 0 ? void 0 : _b.weight,
|
|
658
|
-
},
|
|
659
|
-
]
|
|
660
|
-
: []),
|
|
661
|
-
...(v.spot
|
|
662
|
-
? [
|
|
663
|
-
{
|
|
664
|
-
capacityProvider: "FARGATE_SPOT",
|
|
665
|
-
base: (_c = v.spot) === null || _c === void 0 ? void 0 : _c.base,
|
|
666
|
-
weight: (_d = v.spot) === null || _d === void 0 ? void 0 : _d.weight,
|
|
667
|
-
},
|
|
668
|
-
]
|
|
669
|
-
: []),
|
|
670
|
-
];
|
|
671
|
-
}),
|
|
672
|
-
}
|
|
673
|
-
: // @deprecated do not use `launchType`, set `capacityProviderStrategies`
|
|
674
|
-
// to `[{ capacityProvider: "FARGATE", weight: 1 }]` instead
|
|
675
|
-
{
|
|
676
|
-
launchType: "FARGATE",
|
|
677
|
-
})), { networkConfiguration: {
|
|
678
|
-
// If the vpc is an SST vpc, services are automatically deployed to the public
|
|
679
|
-
// subnets. So we need to assign a public IP for the service to be accessible.
|
|
680
|
-
assignPublicIp: vpc.isSstVpc,
|
|
681
|
-
subnets: vpc.containerSubnets,
|
|
682
|
-
securityGroups: vpc.securityGroups,
|
|
683
|
-
}, deploymentCircuitBreaker: {
|
|
684
|
-
enable: true,
|
|
685
|
-
rollback: true,
|
|
686
|
-
}, loadBalancers: lbArgs &&
|
|
687
|
-
all([lbArgs.rules, targetGroups]).apply(([rules, targets]) => Object.values(targets).map((target) => ({
|
|
688
|
-
targetGroupArn: target.arn,
|
|
689
|
-
containerName: target.port.apply((port) => rules.find((r) => r.forwardPort === port).container),
|
|
690
|
-
containerPort: target.port.apply((port) => port),
|
|
691
|
-
}))), enableExecuteCommand: true, serviceRegistries: cloudmapService && {
|
|
692
|
-
registryArn: cloudmapService.arn,
|
|
693
|
-
port: args.serviceRegistry
|
|
694
|
-
? output(args.serviceRegistry).port
|
|
695
|
-
: undefined,
|
|
696
|
-
}, waitForSteadyState: wait }), { parent: self }));
|
|
697
|
-
});
|
|
698
|
-
}
|
|
699
|
-
function createAutoScaling() {
|
|
700
|
-
var _a;
|
|
701
|
-
const target = new appautoscaling.Target(...transform((_a = args.transform) === null || _a === void 0 ? void 0 : _a.autoScalingTarget, `${name}AutoScalingTarget`, {
|
|
702
|
-
serviceNamespace: "ecs",
|
|
703
|
-
scalableDimension: "ecs:service:DesiredCount",
|
|
704
|
-
resourceId: interpolate `service/${clusterName}/${service.name}`,
|
|
705
|
-
maxCapacity: scaling.max,
|
|
706
|
-
minCapacity: scaling.min,
|
|
707
|
-
}, { parent: self }));
|
|
708
|
-
output(scaling.cpuUtilization).apply((cpuUtilization) => {
|
|
709
|
-
if (cpuUtilization === false)
|
|
710
|
-
return;
|
|
711
|
-
new appautoscaling.Policy(`${name}AutoScalingCpuPolicy`, {
|
|
712
|
-
serviceNamespace: target.serviceNamespace,
|
|
713
|
-
scalableDimension: target.scalableDimension,
|
|
714
|
-
resourceId: target.resourceId,
|
|
715
|
-
policyType: "TargetTrackingScaling",
|
|
716
|
-
targetTrackingScalingPolicyConfiguration: {
|
|
717
|
-
predefinedMetricSpecification: {
|
|
718
|
-
predefinedMetricType: "ECSServiceAverageCPUUtilization",
|
|
719
|
-
},
|
|
720
|
-
targetValue: cpuUtilization,
|
|
721
|
-
},
|
|
722
|
-
}, { parent: self });
|
|
723
|
-
});
|
|
724
|
-
output(scaling.memoryUtilization).apply((memoryUtilization) => {
|
|
725
|
-
if (memoryUtilization === false)
|
|
726
|
-
return;
|
|
727
|
-
new appautoscaling.Policy(`${name}AutoScalingMemoryPolicy`, {
|
|
728
|
-
serviceNamespace: target.serviceNamespace,
|
|
729
|
-
scalableDimension: target.scalableDimension,
|
|
730
|
-
resourceId: target.resourceId,
|
|
731
|
-
policyType: "TargetTrackingScaling",
|
|
732
|
-
targetTrackingScalingPolicyConfiguration: {
|
|
733
|
-
predefinedMetricSpecification: {
|
|
734
|
-
predefinedMetricType: "ECSServiceAverageMemoryUtilization",
|
|
735
|
-
},
|
|
736
|
-
targetValue: memoryUtilization,
|
|
737
|
-
},
|
|
738
|
-
}, { parent: self });
|
|
739
|
-
});
|
|
740
|
-
all([scaling.requestCount, targetGroups]).apply(([requestCount, targetGroups]) => {
|
|
741
|
-
if (requestCount === false)
|
|
742
|
-
return;
|
|
743
|
-
if (!targetGroups)
|
|
744
|
-
return;
|
|
745
|
-
const targetGroup = Object.values(targetGroups)[0];
|
|
746
|
-
new appautoscaling.Policy(`${name}AutoScalingRequestCountPolicy`, {
|
|
747
|
-
serviceNamespace: target.serviceNamespace,
|
|
748
|
-
scalableDimension: target.scalableDimension,
|
|
749
|
-
resourceId: target.resourceId,
|
|
750
|
-
policyType: "TargetTrackingScaling",
|
|
751
|
-
targetTrackingScalingPolicyConfiguration: {
|
|
752
|
-
predefinedMetricSpecification: {
|
|
753
|
-
predefinedMetricType: "ALBRequestCountPerTarget",
|
|
754
|
-
resourceLabel: all([
|
|
755
|
-
loadBalancer === null || loadBalancer === void 0 ? void 0 : loadBalancer.arn,
|
|
756
|
-
targetGroup.arn,
|
|
757
|
-
]).apply(([loadBalancerArn, targetGroupArn]) => {
|
|
758
|
-
var _a;
|
|
759
|
-
// arn:...:loadbalancer/app/frank-MyServiceLoadBalan/005af2ad12da1e52
|
|
760
|
-
// => app/frank-MyServiceLoadBalan/005af2ad12da1e52
|
|
761
|
-
const lbPart = (_a = loadBalancerArn === null || loadBalancerArn === void 0 ? void 0 : loadBalancerArn.split(":").pop()) === null || _a === void 0 ? void 0 : _a.split("/").slice(1).join("/");
|
|
762
|
-
// arn:...:targetgroup/HTTP20250103004618450100000001/e0811b8cf3a60762
|
|
763
|
-
// => targetgroup/HTTP20250103004618450100000001
|
|
764
|
-
const tgPart = targetGroupArn === null || targetGroupArn === void 0 ? void 0 : targetGroupArn.split(":").pop();
|
|
765
|
-
return `${lbPart}/${tgPart}`;
|
|
766
|
-
}),
|
|
767
|
-
},
|
|
768
|
-
targetValue: requestCount,
|
|
769
|
-
},
|
|
770
|
-
}, { parent: self });
|
|
771
|
-
});
|
|
772
|
-
return target;
|
|
773
|
-
}
|
|
774
|
-
function createDnsRecords() {
|
|
775
|
-
if (!lbArgs)
|
|
776
|
-
return;
|
|
777
|
-
lbArgs.domain.apply((domain) => {
|
|
778
|
-
if (!(domain === null || domain === void 0 ? void 0 : domain.dns))
|
|
779
|
-
return;
|
|
780
|
-
for (const recordName of [domain.name, ...domain.aliases]) {
|
|
781
|
-
const namePrefix = recordName === domain.name ? name : `${name}${recordName}`;
|
|
782
|
-
domain.dns.createAlias(namePrefix, {
|
|
783
|
-
name: recordName,
|
|
784
|
-
aliasName: loadBalancer.dnsName,
|
|
785
|
-
aliasZone: loadBalancer.zoneId,
|
|
786
|
-
}, { parent: self });
|
|
787
|
-
}
|
|
788
|
-
});
|
|
789
|
-
}
|
|
790
|
-
function registerReceiver() {
|
|
791
|
-
all([containers]).apply(([val]) => {
|
|
792
|
-
for (const container of val) {
|
|
793
|
-
const title = val.length == 1 ? name : `${name}${container.name}`;
|
|
794
|
-
new DevCommand(`${title}Dev`, {
|
|
795
|
-
link: args.link,
|
|
796
|
-
dev: Object.assign({ title, autostart: true, directory: (() => {
|
|
797
|
-
if (!container.image)
|
|
798
|
-
return "";
|
|
799
|
-
if (typeof container.image === "string")
|
|
800
|
-
return "";
|
|
801
|
-
if (container.image.context)
|
|
802
|
-
return container.image.context;
|
|
803
|
-
return "";
|
|
804
|
-
})() }, container.dev),
|
|
805
|
-
environment: Object.assign(Object.assign({}, container.environment), { AWS_REGION: region }),
|
|
806
|
-
aws: {
|
|
807
|
-
role: taskRole.arn,
|
|
808
|
-
},
|
|
809
|
-
});
|
|
810
|
-
}
|
|
811
|
-
});
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
/**
|
|
815
|
-
* The URL of the service.
|
|
816
|
-
*
|
|
817
|
-
* If `public.domain` is set, this is the URL with the custom domain.
|
|
818
|
-
* Otherwise, it's the auto-generated load balancer URL.
|
|
819
|
-
*/
|
|
820
|
-
get url() {
|
|
821
|
-
const errorMessage = "Cannot access the URL because no public ports are exposed.";
|
|
822
|
-
if (this.dev) {
|
|
823
|
-
if (!this.devUrl)
|
|
824
|
-
throw new VisibleError(errorMessage);
|
|
825
|
-
return this.devUrl;
|
|
826
|
-
}
|
|
827
|
-
if (!this._url)
|
|
828
|
-
throw new VisibleError(errorMessage);
|
|
829
|
-
return this._url;
|
|
830
|
-
}
|
|
831
|
-
/**
|
|
832
|
-
* The name of the Cloud Map service. This is useful for service discovery.
|
|
833
|
-
*/
|
|
834
|
-
get service() {
|
|
835
|
-
return all([this.cloudmapNamespace, this.cloudmapService]).apply(([namespace, service]) => {
|
|
836
|
-
if (!namespace)
|
|
837
|
-
throw new VisibleError(`Cannot access the AWS Cloud Map service name for the "${this._name}" Service. Cloud Map is not configured for the cluster.`);
|
|
838
|
-
return this.dev
|
|
839
|
-
? interpolate `dev.${namespace}`
|
|
840
|
-
: interpolate `${service.name}.${namespace}`;
|
|
841
|
-
});
|
|
842
|
-
}
|
|
843
|
-
/**
|
|
844
|
-
* The underlying [resources](/docs/components/#nodes) this component creates.
|
|
845
|
-
*/
|
|
846
|
-
get nodes() {
|
|
847
|
-
const self = this;
|
|
848
|
-
return {
|
|
849
|
-
/**
|
|
850
|
-
* The Amazon ECS Service.
|
|
851
|
-
*/
|
|
852
|
-
get service() {
|
|
853
|
-
if (self.dev)
|
|
854
|
-
throw new VisibleError("Cannot access `nodes.service` in dev mode.");
|
|
855
|
-
return self._service;
|
|
856
|
-
},
|
|
857
|
-
/**
|
|
858
|
-
* The Amazon ECS Execution Role.
|
|
859
|
-
*/
|
|
860
|
-
executionRole: this.executionRole,
|
|
861
|
-
/**
|
|
862
|
-
* The Amazon ECS Task Role.
|
|
863
|
-
*/
|
|
864
|
-
taskRole: this.taskRole,
|
|
865
|
-
/**
|
|
866
|
-
* The Amazon ECS Task Definition.
|
|
867
|
-
*/
|
|
868
|
-
get taskDefinition() {
|
|
869
|
-
if (self.dev)
|
|
870
|
-
throw new VisibleError("Cannot access `nodes.taskDefinition` in dev mode.");
|
|
871
|
-
return self.taskDefinition;
|
|
872
|
-
},
|
|
873
|
-
/**
|
|
874
|
-
* The Amazon Elastic Load Balancer.
|
|
875
|
-
*/
|
|
876
|
-
get loadBalancer() {
|
|
877
|
-
if (self.dev)
|
|
878
|
-
throw new VisibleError("Cannot access `nodes.loadBalancer` in dev mode.");
|
|
879
|
-
if (!self.loadBalancer)
|
|
880
|
-
throw new VisibleError("Cannot access `nodes.loadBalancer` when no public ports are exposed.");
|
|
881
|
-
return self.loadBalancer;
|
|
882
|
-
},
|
|
883
|
-
/**
|
|
884
|
-
* The Amazon Application Auto Scaling target.
|
|
885
|
-
*/
|
|
886
|
-
get autoScalingTarget() {
|
|
887
|
-
if (self.dev)
|
|
888
|
-
throw new VisibleError("Cannot access `nodes.autoScalingTarget` in dev mode.");
|
|
889
|
-
return self.autoScalingTarget;
|
|
890
|
-
},
|
|
891
|
-
/**
|
|
892
|
-
* The Amazon Cloud Map service.
|
|
893
|
-
*/
|
|
894
|
-
get cloudmapService() {
|
|
895
|
-
console.log("NODES GETTER");
|
|
896
|
-
if (self.dev)
|
|
897
|
-
throw new VisibleError("Cannot access `nodes.cloudmapService` in dev mode.");
|
|
898
|
-
return output(self.cloudmapService).apply((service) => {
|
|
899
|
-
if (!service)
|
|
900
|
-
throw new VisibleError(`Cannot access "nodes.cloudmapService" for the "${self._name}" Service. Cloud Map is not configured for the cluster.`);
|
|
901
|
-
return service;
|
|
902
|
-
});
|
|
903
|
-
},
|
|
904
|
-
};
|
|
905
|
-
}
|
|
906
|
-
/** @internal */
|
|
907
|
-
getSSTLink() {
|
|
908
|
-
return {
|
|
909
|
-
properties: {
|
|
910
|
-
url: this.dev ? this.devUrl : this._url,
|
|
911
|
-
service: output(this.cloudmapNamespace).apply((namespace) => namespace ? this.service : undefined),
|
|
912
|
-
},
|
|
913
|
-
};
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
function protocolType(protocol) {
|
|
917
|
-
return ["http", "https"].includes(protocol)
|
|
918
|
-
? "application"
|
|
919
|
-
: "network";
|
|
920
|
-
}
|
|
921
|
-
const __pulumiType = "sst:aws:Service";
|
|
922
|
-
// @ts-expect-error
|
|
923
|
-
Service.__pulumiType = __pulumiType;
|
|
924
|
-
//# sourceMappingURL=service.js.map
|