@monorise/sst 1.0.0-dev.2 → 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,678 +0,0 @@
|
|
|
1
|
-
import { all, interpolate, jsonStringify, output, } from "@pulumi/pulumi";
|
|
2
|
-
import { Component, transform } from "../component.js";
|
|
3
|
-
import { iam, rds, secretsmanager } from "@pulumi/aws";
|
|
4
|
-
import { VisibleError } from "../error.js";
|
|
5
|
-
import { Vpc } from "./vpc.js";
|
|
6
|
-
import { RandomPassword } from "@pulumi/random";
|
|
7
|
-
import { DevCommand } from "../experimental/dev-command.js";
|
|
8
|
-
import { RdsRoleLookup } from "./providers/rds-role-lookup.js";
|
|
9
|
-
import { toSeconds } from "../duration.js";
|
|
10
|
-
import { permission } from "./permission.js";
|
|
11
|
-
function parseACU(acu) {
|
|
12
|
-
const result = parseFloat(acu.split(" ")[0]);
|
|
13
|
-
return result;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* The `Aurora` component lets you add a Aurora Postgres or MySQL cluster to your app
|
|
17
|
-
* using [Amazon Aurora Serverless v2](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.html).
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
*
|
|
21
|
-
* #### Create an Aurora Postgres cluster
|
|
22
|
-
*
|
|
23
|
-
* ```js title="sst.config.ts"
|
|
24
|
-
* const vpc = new sst.aws.Vpc("MyVpc");
|
|
25
|
-
* const database = new sst.aws.Aurora("MyDatabase", {
|
|
26
|
-
* engine: "postgres",
|
|
27
|
-
* vpc
|
|
28
|
-
* });
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* #### Create an Aurora MySQL cluster
|
|
32
|
-
*
|
|
33
|
-
* ```js title="sst.config.ts"
|
|
34
|
-
* const vpc = new sst.aws.Vpc("MyVpc");
|
|
35
|
-
* const database = new sst.aws.Aurora("MyDatabase", {
|
|
36
|
-
* engine: "mysql",
|
|
37
|
-
* vpc
|
|
38
|
-
* });
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* #### Change the scaling config
|
|
42
|
-
*
|
|
43
|
-
* ```js title="sst.config.ts"
|
|
44
|
-
* new sst.aws.Aurora("MyDatabase", {
|
|
45
|
-
* engine: "postgres",
|
|
46
|
-
* scaling: {
|
|
47
|
-
* min: "2 ACU",
|
|
48
|
-
* max: "128 ACU"
|
|
49
|
-
* },
|
|
50
|
-
* vpc
|
|
51
|
-
* });
|
|
52
|
-
* ```
|
|
53
|
-
*
|
|
54
|
-
* #### Link to a resource
|
|
55
|
-
*
|
|
56
|
-
* You can link your database to other resources, like a function or your Next.js app.
|
|
57
|
-
*
|
|
58
|
-
* ```ts title="sst.config.ts"
|
|
59
|
-
* new sst.aws.Nextjs("MyWeb", {
|
|
60
|
-
* link: [database],
|
|
61
|
-
* vpc
|
|
62
|
-
* });
|
|
63
|
-
* ```
|
|
64
|
-
*
|
|
65
|
-
* Once linked, you can connect to it from your function code.
|
|
66
|
-
*
|
|
67
|
-
* ```ts title="app/page.tsx" {1,5-9}
|
|
68
|
-
* import { Resource } from "sst";
|
|
69
|
-
* import postgres from "postgres";
|
|
70
|
-
*
|
|
71
|
-
* const sql = postgres({
|
|
72
|
-
* username: Resource.MyDatabase.username,
|
|
73
|
-
* password: Resource.MyDatabase.password,
|
|
74
|
-
* database: Resource.MyDatabase.database,
|
|
75
|
-
* host: Resource.MyDatabase.host,
|
|
76
|
-
* port: Resource.MyDatabase.port
|
|
77
|
-
* });
|
|
78
|
-
* ```
|
|
79
|
-
*
|
|
80
|
-
* #### Enable the RDS Data API
|
|
81
|
-
*
|
|
82
|
-
* ```ts title="sst.config.ts"
|
|
83
|
-
* new sst.aws.Aurora("MyDatabase", {
|
|
84
|
-
* engine: "postgres",
|
|
85
|
-
* dataApi: true,
|
|
86
|
-
* vpc
|
|
87
|
-
* });
|
|
88
|
-
* ```
|
|
89
|
-
*
|
|
90
|
-
* When using the Data API, connecting to the database does not require a persistent
|
|
91
|
-
* connection, and works over HTTP. You also don't need the `sst tunnel` or a VPN to connect
|
|
92
|
-
* to it from your local machine.
|
|
93
|
-
*
|
|
94
|
-
* ```ts title="app/page.tsx" {1,6,7,8}
|
|
95
|
-
* import { Resource } from "sst";
|
|
96
|
-
* import { drizzle } from "drizzle-orm/aws-data-api/pg";
|
|
97
|
-
* import { RDSDataClient } from "@aws-sdk/client-rds-data";
|
|
98
|
-
*
|
|
99
|
-
* drizzle(new RDSDataClient({}), {
|
|
100
|
-
* database: Resource.MyDatabase.database,
|
|
101
|
-
* secretArn: Resource.MyDatabase.secretArn,
|
|
102
|
-
* resourceArn: Resource.MyDatabase.clusterArn
|
|
103
|
-
* });
|
|
104
|
-
* ```
|
|
105
|
-
*
|
|
106
|
-
* #### Running locally
|
|
107
|
-
*
|
|
108
|
-
* By default, your Aurora database is deployed in `sst dev`. But let's say you are running
|
|
109
|
-
* Postgres locally.
|
|
110
|
-
*
|
|
111
|
-
* ```bash
|
|
112
|
-
* docker run \
|
|
113
|
-
* --rm \
|
|
114
|
-
* -p 5432:5432 \
|
|
115
|
-
* -v $(pwd)/.sst/storage/postgres:/var/lib/postgresql/data \
|
|
116
|
-
* -e POSTGRES_USER=postgres \
|
|
117
|
-
* -e POSTGRES_PASSWORD=password \
|
|
118
|
-
* -e POSTGRES_DB=local \
|
|
119
|
-
* postgres:16.4
|
|
120
|
-
* ```
|
|
121
|
-
*
|
|
122
|
-
* You can connect to it in `sst dev` by configuring the `dev` prop.
|
|
123
|
-
*
|
|
124
|
-
* ```ts title="sst.config.ts" {4-9}
|
|
125
|
-
* new sst.aws.Aurora("MyDatabase", {
|
|
126
|
-
* engine: "postgres",
|
|
127
|
-
* vpc,
|
|
128
|
-
* dev: {
|
|
129
|
-
* username: "postgres",
|
|
130
|
-
* password: "password",
|
|
131
|
-
* database: "local",
|
|
132
|
-
* port: 5432
|
|
133
|
-
* }
|
|
134
|
-
* });
|
|
135
|
-
* ```
|
|
136
|
-
*
|
|
137
|
-
* This will skip deploying the database and link to the locally running Postgres database
|
|
138
|
-
* instead. [Check out the full example](/docs/examples/#aws-aurora-local).
|
|
139
|
-
*
|
|
140
|
-
* ---
|
|
141
|
-
*
|
|
142
|
-
* ### Cost
|
|
143
|
-
*
|
|
144
|
-
* This component has one DB instance that is used for both writes and reads. The
|
|
145
|
-
* instance can scale from the minimum number of ACUs to the maximum number of ACUs. By default,
|
|
146
|
-
* this uses a `min` of 0 ACUs and a `max` of 4 ACUs.
|
|
147
|
-
*
|
|
148
|
-
* When the database is paused, you are not charged for the ACUs.
|
|
149
|
-
*
|
|
150
|
-
* Each ACU costs $0.12 per hour for both `postgres` and `mysql` engine. The storage costs
|
|
151
|
-
* $0.01 per GB per month for standard storage.
|
|
152
|
-
*
|
|
153
|
-
* So if your database is constantly using 1GB of memory or 0.5 ACUs, then you are charged
|
|
154
|
-
* $0.12 x 0.5 x 24 x 30 or **$43 per month**. And add the storage costs to this as well.
|
|
155
|
-
*
|
|
156
|
-
* The above are rough estimates for _us-east-1_, check out the
|
|
157
|
-
* [Amazon Aurora pricing](https://aws.amazon.com/rds/aurora/pricing) for more details.
|
|
158
|
-
*
|
|
159
|
-
* #### RDS Proxy
|
|
160
|
-
*
|
|
161
|
-
* If you enable the `proxy`, it uses _Aurora Capacity Units_ with a minumum of 8 ACUs at
|
|
162
|
-
* $0.015 per ACU hour.
|
|
163
|
-
*
|
|
164
|
-
* That works out to an **additional** $0.015 x 8 x 24 x 30 or **$86 per month**. Adjust
|
|
165
|
-
* this if you end up using more than 8 ACUs.
|
|
166
|
-
*
|
|
167
|
-
* The above are rough estimates for _us-east-1_, check out the
|
|
168
|
-
* [RDS Proxy pricing](https://aws.amazon.com/rds/proxy/pricing/) for more details.
|
|
169
|
-
*
|
|
170
|
-
* #### RDS Data API
|
|
171
|
-
*
|
|
172
|
-
* If you enable `dataApi`, you get charged an **additional** $0.35 per million requests for
|
|
173
|
-
* the first billion requests. After that, it's $0.20 per million requests.
|
|
174
|
-
*
|
|
175
|
-
* Check out the [RDS Data API pricing](https://aws.amazon.com/rds/aurora/pricing/#Data_API_costs)
|
|
176
|
-
* for more details.
|
|
177
|
-
*/
|
|
178
|
-
export class Aurora extends Component {
|
|
179
|
-
constructor(name, args, opts) {
|
|
180
|
-
super(__pulumiType, name, args, opts);
|
|
181
|
-
const self = this;
|
|
182
|
-
if (args && "ref" in args) {
|
|
183
|
-
const ref = reference();
|
|
184
|
-
this.cluster = ref.cluster;
|
|
185
|
-
this.instance = ref.instance;
|
|
186
|
-
this._password = ref.password;
|
|
187
|
-
this.proxy = output(ref.proxy);
|
|
188
|
-
this.secret = ref.secret;
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
const engine = output(args.engine);
|
|
192
|
-
const version = all([args.version, engine]).apply(([version, engine]) => version !== null && version !== void 0 ? version : { postgres: "16.4", mysql: "3.08.0" }[engine]);
|
|
193
|
-
const username = all([args.username, engine]).apply(([username, engine]) => username !== null && username !== void 0 ? username : { postgres: "postgres", mysql: "root" }[engine]);
|
|
194
|
-
const dbName = output(args.database).apply((name) => name !== null && name !== void 0 ? name : $app.name.replaceAll("-", "_"));
|
|
195
|
-
const dataApi = output(args.dataApi).apply((v) => v !== null && v !== void 0 ? v : false);
|
|
196
|
-
const scaling = normalizeScaling();
|
|
197
|
-
const replicas = normalizeReplicas();
|
|
198
|
-
const vpc = normalizeVpc();
|
|
199
|
-
const dev = registerDev();
|
|
200
|
-
if (dev === null || dev === void 0 ? void 0 : dev.enabled) {
|
|
201
|
-
this.dev = dev;
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
const password = createPassword();
|
|
205
|
-
const secret = createSecret();
|
|
206
|
-
const subnetGroup = createSubnetGroup();
|
|
207
|
-
const instanceParameterGroup = createInstanceParameterGroup();
|
|
208
|
-
const clusterParameterGroup = createClusterParameterGroup();
|
|
209
|
-
const proxy = createProxy();
|
|
210
|
-
const cluster = createCluster();
|
|
211
|
-
const instance = createInstances();
|
|
212
|
-
createProxyTarget();
|
|
213
|
-
this.cluster = cluster;
|
|
214
|
-
this.instance = instance;
|
|
215
|
-
this.secret = secret;
|
|
216
|
-
this._password = password;
|
|
217
|
-
this.proxy = proxy;
|
|
218
|
-
function reference() {
|
|
219
|
-
const ref = args;
|
|
220
|
-
const cluster = rds.Cluster.get(`${name}Cluster`, ref.id, undefined, {
|
|
221
|
-
parent: self,
|
|
222
|
-
});
|
|
223
|
-
const instance = rds.ClusterInstance.get(`${name}Instance`, rds
|
|
224
|
-
.getInstancesOutput({
|
|
225
|
-
filters: [
|
|
226
|
-
{
|
|
227
|
-
name: "db-cluster-id",
|
|
228
|
-
values: [cluster.id],
|
|
229
|
-
},
|
|
230
|
-
],
|
|
231
|
-
}, { parent: self })
|
|
232
|
-
.instanceIdentifiers.apply((ids) => {
|
|
233
|
-
if (!ids.length) {
|
|
234
|
-
throw new VisibleError(`Database instance not found in cluster ${cluster.id}`);
|
|
235
|
-
}
|
|
236
|
-
return ids[0];
|
|
237
|
-
}), undefined, { parent: self });
|
|
238
|
-
const secretId = cluster.tags
|
|
239
|
-
.apply((tags) => tags === null || tags === void 0 ? void 0 : tags["sst:ref:password"])
|
|
240
|
-
.apply((passwordTag) => {
|
|
241
|
-
if (!passwordTag)
|
|
242
|
-
throw new VisibleError(`Failed to get password for Postgres ${name}.`);
|
|
243
|
-
return passwordTag;
|
|
244
|
-
});
|
|
245
|
-
const secret = secretsmanager.Secret.get(`${name}ProxySecret`, secretId, undefined, { parent: self });
|
|
246
|
-
const secretVersion = secretsmanager.getSecretVersionOutput({ secretId }, { parent: self });
|
|
247
|
-
const password = $jsonParse(secretVersion.secretString).apply((v) => v.password);
|
|
248
|
-
const proxy = cluster.tags
|
|
249
|
-
.apply((tags) => tags === null || tags === void 0 ? void 0 : tags["sst:ref:proxy"])
|
|
250
|
-
.apply((proxyTag) => proxyTag
|
|
251
|
-
? rds.Proxy.get(`${name}Proxy`, proxyTag, undefined, {
|
|
252
|
-
parent: self,
|
|
253
|
-
})
|
|
254
|
-
: undefined);
|
|
255
|
-
return { cluster, instance, proxy, password, secret };
|
|
256
|
-
}
|
|
257
|
-
function normalizeScaling() {
|
|
258
|
-
return output(args.scaling).apply((scaling) => {
|
|
259
|
-
var _a, _b, _c;
|
|
260
|
-
const max = (_a = scaling === null || scaling === void 0 ? void 0 : scaling.max) !== null && _a !== void 0 ? _a : "4 ACU";
|
|
261
|
-
const min = (_b = scaling === null || scaling === void 0 ? void 0 : scaling.min) !== null && _b !== void 0 ? _b : "0 ACU";
|
|
262
|
-
const isAutoPauseEnabled = parseACU(min) === 0;
|
|
263
|
-
if ((scaling === null || scaling === void 0 ? void 0 : scaling.pauseAfter) && !isAutoPauseEnabled) {
|
|
264
|
-
throw new VisibleError(`Cannot configure "pauseAfter" when the minimum ACU is not 0 for the "${name}" Aurora database.`);
|
|
265
|
-
}
|
|
266
|
-
return {
|
|
267
|
-
max,
|
|
268
|
-
min,
|
|
269
|
-
pauseAfter: isAutoPauseEnabled
|
|
270
|
-
? (_c = scaling === null || scaling === void 0 ? void 0 : scaling.pauseAfter) !== null && _c !== void 0 ? _c : "5 minutes"
|
|
271
|
-
: undefined,
|
|
272
|
-
};
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
function normalizeReplicas() {
|
|
276
|
-
var _a;
|
|
277
|
-
return output((_a = args.replicas) !== null && _a !== void 0 ? _a : 0).apply((replicas) => {
|
|
278
|
-
if (replicas > 15) {
|
|
279
|
-
throw new VisibleError(`Cannot create more than 15 read-only replicas for the "${name}" Aurora database.`);
|
|
280
|
-
}
|
|
281
|
-
return replicas;
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
function normalizeVpc() {
|
|
285
|
-
// "vpc" is a Vpc component
|
|
286
|
-
if (args.vpc instanceof Vpc) {
|
|
287
|
-
return {
|
|
288
|
-
subnets: args.vpc.privateSubnets,
|
|
289
|
-
securityGroups: args.vpc.securityGroups,
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
// "vpc" is object
|
|
293
|
-
return output(args.vpc);
|
|
294
|
-
}
|
|
295
|
-
function registerDev() {
|
|
296
|
-
var _a, _b, _c;
|
|
297
|
-
if (!args.dev)
|
|
298
|
-
return undefined;
|
|
299
|
-
if ($dev &&
|
|
300
|
-
args.dev.password === undefined &&
|
|
301
|
-
args.password === undefined) {
|
|
302
|
-
throw new VisibleError(`You must provide the password to connect to your locally running database either by setting the "dev.password" or by setting the top-level "password" property.`);
|
|
303
|
-
}
|
|
304
|
-
const dev = {
|
|
305
|
-
enabled: $dev,
|
|
306
|
-
host: output((_a = args.dev.host) !== null && _a !== void 0 ? _a : "localhost"),
|
|
307
|
-
port: all([args.dev.port, engine]).apply(([port, engine]) => port !== null && port !== void 0 ? port : { postgres: 5432, mysql: 3306 }[engine]),
|
|
308
|
-
username: args.dev.username ? output(args.dev.username) : username,
|
|
309
|
-
password: output((_c = (_b = args.dev.password) !== null && _b !== void 0 ? _b : args.password) !== null && _c !== void 0 ? _c : ""),
|
|
310
|
-
database: args.dev.database ? output(args.dev.database) : dbName,
|
|
311
|
-
};
|
|
312
|
-
new DevCommand(`${name}Dev`, {
|
|
313
|
-
dev: {
|
|
314
|
-
title: name,
|
|
315
|
-
autostart: true,
|
|
316
|
-
command: `sst print-and-not-quit`,
|
|
317
|
-
},
|
|
318
|
-
environment: {
|
|
319
|
-
SST_DEV_COMMAND_MESSAGE: interpolate `Make sure your local database is using:
|
|
320
|
-
|
|
321
|
-
username: "${dev.username}"
|
|
322
|
-
password: "${dev.password}"
|
|
323
|
-
database: "${dev.database}"
|
|
324
|
-
|
|
325
|
-
Listening on "${dev.host}:${dev.port}"...`,
|
|
326
|
-
},
|
|
327
|
-
});
|
|
328
|
-
return dev;
|
|
329
|
-
}
|
|
330
|
-
function createPassword() {
|
|
331
|
-
return args.password
|
|
332
|
-
? output(args.password)
|
|
333
|
-
: new RandomPassword(`${name}Password`, {
|
|
334
|
-
length: 32,
|
|
335
|
-
special: false,
|
|
336
|
-
}, { parent: self }).result;
|
|
337
|
-
}
|
|
338
|
-
function createSecret() {
|
|
339
|
-
const secret = new secretsmanager.Secret(`${name}ProxySecret`, {
|
|
340
|
-
recoveryWindowInDays: 0,
|
|
341
|
-
}, { parent: self });
|
|
342
|
-
new secretsmanager.SecretVersion(`${name}ProxySecretVersion`, {
|
|
343
|
-
secretId: secret.id,
|
|
344
|
-
secretString: jsonStringify({ username, password }),
|
|
345
|
-
}, { parent: self });
|
|
346
|
-
return secret;
|
|
347
|
-
}
|
|
348
|
-
function createSubnetGroup() {
|
|
349
|
-
var _a;
|
|
350
|
-
return new rds.SubnetGroup(...transform((_a = args.transform) === null || _a === void 0 ? void 0 : _a.subnetGroup, `${name}SubnetGroup`, {
|
|
351
|
-
subnetIds: vpc.subnets,
|
|
352
|
-
}, { parent: self }));
|
|
353
|
-
}
|
|
354
|
-
function createInstanceParameterGroup() {
|
|
355
|
-
var _a;
|
|
356
|
-
return new rds.ParameterGroup(...transform((_a = args.transform) === null || _a === void 0 ? void 0 : _a.instanceParameterGroup, `${name}ParameterGroup`, {
|
|
357
|
-
family: all([engine, version]).apply(([engine, version]) => {
|
|
358
|
-
if (engine === "postgres")
|
|
359
|
-
return `aurora-postgresql${version.split(".")[0]}`;
|
|
360
|
-
return version.startsWith("2")
|
|
361
|
-
? `aurora-mysql5.7`
|
|
362
|
-
: `aurora-mysql8.0`;
|
|
363
|
-
}),
|
|
364
|
-
parameters: [],
|
|
365
|
-
}, { parent: self }));
|
|
366
|
-
}
|
|
367
|
-
function createClusterParameterGroup() {
|
|
368
|
-
var _a;
|
|
369
|
-
return new rds.ClusterParameterGroup(...transform((_a = args.transform) === null || _a === void 0 ? void 0 : _a.clusterParameterGroup, `${name}ClusterParameterGroup`, {
|
|
370
|
-
family: all([engine, version]).apply(([engine, version]) => {
|
|
371
|
-
if (engine === "postgres")
|
|
372
|
-
return `aurora-postgresql${version.split(".")[0]}`;
|
|
373
|
-
return version.startsWith("2")
|
|
374
|
-
? `aurora-mysql5.7`
|
|
375
|
-
: `aurora-mysql8.0`;
|
|
376
|
-
}),
|
|
377
|
-
parameters: [],
|
|
378
|
-
}, { parent: self }));
|
|
379
|
-
}
|
|
380
|
-
function createCluster() {
|
|
381
|
-
var _a;
|
|
382
|
-
return new rds.Cluster(...transform((_a = args.transform) === null || _a === void 0 ? void 0 : _a.cluster, `${name}Cluster`, {
|
|
383
|
-
engine: engine.apply((engine) => engine === "postgres"
|
|
384
|
-
? rds.EngineType.AuroraPostgresql
|
|
385
|
-
: rds.EngineType.AuroraMysql),
|
|
386
|
-
engineMode: "provisioned",
|
|
387
|
-
engineVersion: all([engine, version]).apply(([engine, version]) => {
|
|
388
|
-
if (engine === "postgres")
|
|
389
|
-
return version;
|
|
390
|
-
return version.startsWith("2")
|
|
391
|
-
? `5.7.mysql_aurora.${version}`
|
|
392
|
-
: `8.0.mysql_aurora.${version}`;
|
|
393
|
-
}),
|
|
394
|
-
databaseName: dbName,
|
|
395
|
-
masterUsername: username,
|
|
396
|
-
masterPassword: password,
|
|
397
|
-
dbClusterParameterGroupName: clusterParameterGroup.name,
|
|
398
|
-
dbInstanceParameterGroupName: instanceParameterGroup.name,
|
|
399
|
-
serverlessv2ScalingConfiguration: scaling.apply((scaling) => ({
|
|
400
|
-
maxCapacity: parseACU(scaling.max),
|
|
401
|
-
minCapacity: parseACU(scaling.min),
|
|
402
|
-
secondsUntilAutoPause: scaling.pauseAfter
|
|
403
|
-
? toSeconds(scaling.pauseAfter)
|
|
404
|
-
: undefined,
|
|
405
|
-
})),
|
|
406
|
-
skipFinalSnapshot: true,
|
|
407
|
-
storageEncrypted: true,
|
|
408
|
-
enableHttpEndpoint: dataApi,
|
|
409
|
-
dbSubnetGroupName: subnetGroup === null || subnetGroup === void 0 ? void 0 : subnetGroup.name,
|
|
410
|
-
vpcSecurityGroupIds: vpc.securityGroups,
|
|
411
|
-
tags: proxy.apply((proxy) => (Object.assign({ "sst:ref:password": secret.id }, (proxy ? { "sst:ref:proxy": proxy.id } : {})))),
|
|
412
|
-
}, { parent: self }));
|
|
413
|
-
}
|
|
414
|
-
function createInstances() {
|
|
415
|
-
var _a;
|
|
416
|
-
const props = {
|
|
417
|
-
clusterIdentifier: cluster.id,
|
|
418
|
-
instanceClass: "db.serverless",
|
|
419
|
-
engine: cluster.engine.apply((v) => v),
|
|
420
|
-
engineVersion: cluster.engineVersion,
|
|
421
|
-
dbSubnetGroupName: cluster.dbSubnetGroupName,
|
|
422
|
-
dbParameterGroupName: instanceParameterGroup.name,
|
|
423
|
-
};
|
|
424
|
-
// Create primary instance
|
|
425
|
-
const instance = new rds.ClusterInstance(...transform((_a = args.transform) === null || _a === void 0 ? void 0 : _a.instance, `${name}Instance`, props, {
|
|
426
|
-
parent: self,
|
|
427
|
-
}));
|
|
428
|
-
// Create replicas
|
|
429
|
-
replicas.apply((replicas) => {
|
|
430
|
-
var _a;
|
|
431
|
-
for (let i = 0; i < replicas; i++) {
|
|
432
|
-
new rds.ClusterInstance(...transform((_a = args.transform) === null || _a === void 0 ? void 0 : _a.instance, `${name}Replica${i}`, Object.assign(Object.assign({}, props), { promotionTier: 15 }), { parent: self }));
|
|
433
|
-
}
|
|
434
|
-
});
|
|
435
|
-
return instance;
|
|
436
|
-
}
|
|
437
|
-
function createProxy() {
|
|
438
|
-
return all([args.proxy]).apply(([proxy]) => {
|
|
439
|
-
var _a, _b;
|
|
440
|
-
if (!proxy)
|
|
441
|
-
return;
|
|
442
|
-
const credentials = proxy === true ? [] : (_a = proxy.credentials) !== null && _a !== void 0 ? _a : [];
|
|
443
|
-
// Create secrets
|
|
444
|
-
const secrets = credentials.map((credential) => {
|
|
445
|
-
const secret = new secretsmanager.Secret(`${name}ProxySecret${credential.username}`, {
|
|
446
|
-
recoveryWindowInDays: 0,
|
|
447
|
-
}, { parent: self });
|
|
448
|
-
new secretsmanager.SecretVersion(`${name}ProxySecretVersion${credential.username}`, {
|
|
449
|
-
secretId: secret.id,
|
|
450
|
-
secretString: jsonStringify({
|
|
451
|
-
username: credential.username,
|
|
452
|
-
password: credential.password,
|
|
453
|
-
}),
|
|
454
|
-
}, { parent: self });
|
|
455
|
-
return secret;
|
|
456
|
-
});
|
|
457
|
-
const role = new iam.Role(`${name}ProxyRole`, {
|
|
458
|
-
assumeRolePolicy: iam.assumeRolePolicyForPrincipal({
|
|
459
|
-
Service: "rds.amazonaws.com",
|
|
460
|
-
}),
|
|
461
|
-
inlinePolicies: [
|
|
462
|
-
{
|
|
463
|
-
name: "inline",
|
|
464
|
-
policy: iam.getPolicyDocumentOutput({
|
|
465
|
-
statements: [
|
|
466
|
-
{
|
|
467
|
-
actions: ["secretsmanager:GetSecretValue"],
|
|
468
|
-
resources: [secret.arn, ...secrets.map((s) => s.arn)],
|
|
469
|
-
},
|
|
470
|
-
],
|
|
471
|
-
}).json,
|
|
472
|
-
},
|
|
473
|
-
],
|
|
474
|
-
}, { parent: self });
|
|
475
|
-
const lookup = new RdsRoleLookup(`${name}ProxyRoleLookup`, { name: "AWSServiceRoleForRDS" }, { parent: self });
|
|
476
|
-
return new rds.Proxy(...transform((_b = args.transform) === null || _b === void 0 ? void 0 : _b.proxy, `${name}Proxy`, {
|
|
477
|
-
engineFamily: engine.apply((engine) => engine === "postgres" ? "POSTGRESQL" : "MYSQL"),
|
|
478
|
-
auths: [
|
|
479
|
-
{
|
|
480
|
-
authScheme: "SECRETS",
|
|
481
|
-
iamAuth: "DISABLED",
|
|
482
|
-
secretArn: secret.arn,
|
|
483
|
-
},
|
|
484
|
-
...secrets.map((s) => ({
|
|
485
|
-
authScheme: "SECRETS",
|
|
486
|
-
iamAuth: "DISABLED",
|
|
487
|
-
secretArn: s.arn,
|
|
488
|
-
})),
|
|
489
|
-
],
|
|
490
|
-
roleArn: role.arn,
|
|
491
|
-
vpcSubnetIds: vpc.subnets,
|
|
492
|
-
}, { parent: self, dependsOn: [lookup] }));
|
|
493
|
-
});
|
|
494
|
-
}
|
|
495
|
-
function createProxyTarget() {
|
|
496
|
-
proxy.apply((proxy) => {
|
|
497
|
-
if (!proxy)
|
|
498
|
-
return;
|
|
499
|
-
const targetGroup = new rds.ProxyDefaultTargetGroup(`${name}ProxyTargetGroup`, {
|
|
500
|
-
dbProxyName: proxy.name,
|
|
501
|
-
}, { parent: self });
|
|
502
|
-
new rds.ProxyTarget(`${name}ProxyTarget`, {
|
|
503
|
-
dbProxyName: proxy.name,
|
|
504
|
-
targetGroupName: targetGroup.name,
|
|
505
|
-
dbClusterIdentifier: cluster.clusterIdentifier,
|
|
506
|
-
}, { parent: self });
|
|
507
|
-
});
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
/**
|
|
511
|
-
* The ID of the RDS Cluster.
|
|
512
|
-
*/
|
|
513
|
-
get id() {
|
|
514
|
-
var _a;
|
|
515
|
-
if ((_a = this.dev) === null || _a === void 0 ? void 0 : _a.enabled)
|
|
516
|
-
return output("placeholder");
|
|
517
|
-
return this.cluster.id;
|
|
518
|
-
}
|
|
519
|
-
/**
|
|
520
|
-
* The ARN of the RDS Cluster.
|
|
521
|
-
*/
|
|
522
|
-
get clusterArn() {
|
|
523
|
-
var _a;
|
|
524
|
-
if ((_a = this.dev) === null || _a === void 0 ? void 0 : _a.enabled)
|
|
525
|
-
return output("placeholder");
|
|
526
|
-
return this.cluster.arn;
|
|
527
|
-
}
|
|
528
|
-
/**
|
|
529
|
-
* The ARN of the master user secret.
|
|
530
|
-
*/
|
|
531
|
-
get secretArn() {
|
|
532
|
-
var _a;
|
|
533
|
-
if ((_a = this.dev) === null || _a === void 0 ? void 0 : _a.enabled)
|
|
534
|
-
return output("placeholder");
|
|
535
|
-
return this.secret.arn;
|
|
536
|
-
}
|
|
537
|
-
/** The username of the master user. */
|
|
538
|
-
get username() {
|
|
539
|
-
var _a;
|
|
540
|
-
if ((_a = this.dev) === null || _a === void 0 ? void 0 : _a.enabled)
|
|
541
|
-
return this.dev.username;
|
|
542
|
-
return this.cluster.masterUsername;
|
|
543
|
-
}
|
|
544
|
-
/** The password of the master user. */
|
|
545
|
-
get password() {
|
|
546
|
-
var _a;
|
|
547
|
-
if ((_a = this.dev) === null || _a === void 0 ? void 0 : _a.enabled)
|
|
548
|
-
return this.dev.password;
|
|
549
|
-
return this._password;
|
|
550
|
-
}
|
|
551
|
-
/**
|
|
552
|
-
* The name of the database.
|
|
553
|
-
*/
|
|
554
|
-
get database() {
|
|
555
|
-
var _a;
|
|
556
|
-
if ((_a = this.dev) === null || _a === void 0 ? void 0 : _a.enabled)
|
|
557
|
-
return this.dev.database;
|
|
558
|
-
return this.cluster.databaseName;
|
|
559
|
-
}
|
|
560
|
-
/**
|
|
561
|
-
* The port of the database.
|
|
562
|
-
*/
|
|
563
|
-
get port() {
|
|
564
|
-
var _a;
|
|
565
|
-
if ((_a = this.dev) === null || _a === void 0 ? void 0 : _a.enabled)
|
|
566
|
-
return this.dev.port;
|
|
567
|
-
return this.instance.port;
|
|
568
|
-
}
|
|
569
|
-
/**
|
|
570
|
-
* The host of the database.
|
|
571
|
-
*/
|
|
572
|
-
get host() {
|
|
573
|
-
var _a;
|
|
574
|
-
if ((_a = this.dev) === null || _a === void 0 ? void 0 : _a.enabled)
|
|
575
|
-
return this.dev.host;
|
|
576
|
-
return all([this.cluster.endpoint, this.proxy]).apply(([endpoint, proxy]) => { var _a; return (_a = proxy === null || proxy === void 0 ? void 0 : proxy.endpoint) !== null && _a !== void 0 ? _a : output(endpoint.split(":")[0]); });
|
|
577
|
-
}
|
|
578
|
-
/**
|
|
579
|
-
* The reader endpoint of the database.
|
|
580
|
-
*/
|
|
581
|
-
get reader() {
|
|
582
|
-
var _a;
|
|
583
|
-
if ((_a = this.dev) === null || _a === void 0 ? void 0 : _a.enabled)
|
|
584
|
-
return this.dev.host;
|
|
585
|
-
return all([this.cluster.readerEndpoint, this.proxy]).apply(([endpoint, proxy]) => {
|
|
586
|
-
if (proxy) {
|
|
587
|
-
throw new VisibleError("Reader endpoint is not currently supported for RDS Proxy. Please contact us on Discord or open a GitHub issue.");
|
|
588
|
-
}
|
|
589
|
-
return output(endpoint.split(":")[0]);
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
get nodes() {
|
|
593
|
-
return {
|
|
594
|
-
cluster: this.cluster,
|
|
595
|
-
instance: this.instance,
|
|
596
|
-
};
|
|
597
|
-
}
|
|
598
|
-
/** @internal */
|
|
599
|
-
getSSTLink() {
|
|
600
|
-
var _a, _b;
|
|
601
|
-
return {
|
|
602
|
-
properties: {
|
|
603
|
-
clusterArn: this.clusterArn,
|
|
604
|
-
secretArn: this.secretArn,
|
|
605
|
-
database: this.database,
|
|
606
|
-
username: this.username,
|
|
607
|
-
password: this.password,
|
|
608
|
-
port: this.port,
|
|
609
|
-
host: this.host,
|
|
610
|
-
reader: ((_a = this.dev) === null || _a === void 0 ? void 0 : _a.enabled)
|
|
611
|
-
? this.dev.host
|
|
612
|
-
: all([this.cluster.readerEndpoint, this.proxy]).apply(([endpoint, proxy]) => {
|
|
613
|
-
if (proxy)
|
|
614
|
-
return output(undefined);
|
|
615
|
-
return output(endpoint.split(":")[0]);
|
|
616
|
-
}),
|
|
617
|
-
},
|
|
618
|
-
include: ((_b = this.dev) === null || _b === void 0 ? void 0 : _b.enabled)
|
|
619
|
-
? []
|
|
620
|
-
: [
|
|
621
|
-
permission({
|
|
622
|
-
actions: ["secretsmanager:GetSecretValue"],
|
|
623
|
-
resources: [this.secretArn],
|
|
624
|
-
}),
|
|
625
|
-
permission({
|
|
626
|
-
actions: [
|
|
627
|
-
"rds-data:BatchExecuteStatement",
|
|
628
|
-
"rds-data:BeginTransaction",
|
|
629
|
-
"rds-data:CommitTransaction",
|
|
630
|
-
"rds-data:ExecuteStatement",
|
|
631
|
-
"rds-data:RollbackTransaction",
|
|
632
|
-
],
|
|
633
|
-
resources: [this.clusterArn],
|
|
634
|
-
}),
|
|
635
|
-
],
|
|
636
|
-
};
|
|
637
|
-
}
|
|
638
|
-
/**
|
|
639
|
-
* Reference an existing Aurora cluster with its RDS cluster ID. This is useful when you
|
|
640
|
-
* create a Aurora cluster in one stage and want to share it in another. It avoids having to
|
|
641
|
-
* create a new Aurora cluster in the other stage.
|
|
642
|
-
*
|
|
643
|
-
* :::tip
|
|
644
|
-
* You can use the `static get` method to share Aurora clusters across stages.
|
|
645
|
-
* :::
|
|
646
|
-
*
|
|
647
|
-
* @param name The name of the component.
|
|
648
|
-
* @param id The ID of the existing Aurora cluster.
|
|
649
|
-
* @param opts? Resource options.
|
|
650
|
-
*
|
|
651
|
-
* @example
|
|
652
|
-
* Imagine you create a cluster in the `dev` stage. And in your personal stage `frank`,
|
|
653
|
-
* instead of creating a new cluster, you want to share the same cluster from `dev`.
|
|
654
|
-
*
|
|
655
|
-
* ```ts title="sst.config.ts"
|
|
656
|
-
* const database = $app.stage === "frank"
|
|
657
|
-
* ? sst.aws.Aurora.get("MyDatabase", "app-dev-mydatabase")
|
|
658
|
-
* : new sst.aws.Aurora("MyDatabase");
|
|
659
|
-
* ```
|
|
660
|
-
*
|
|
661
|
-
* Here `app-dev-mydatabase` is the ID of the cluster created in the `dev` stage.
|
|
662
|
-
* You can find this by outputting the cluster ID in the `dev` stage.
|
|
663
|
-
*
|
|
664
|
-
* ```ts title="sst.config.ts"
|
|
665
|
-
* return database.id;
|
|
666
|
-
* ```
|
|
667
|
-
*/
|
|
668
|
-
static get(name, id, opts) {
|
|
669
|
-
return new Aurora(name, {
|
|
670
|
-
ref: true,
|
|
671
|
-
id,
|
|
672
|
-
}, opts);
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
const __pulumiType = "sst:aws:Aurora";
|
|
676
|
-
// @ts-expect-error
|
|
677
|
-
Aurora.__pulumiType = __pulumiType;
|
|
678
|
-
//# sourceMappingURL=aurora.js.map
|