@takumi-stack/core 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dist/common/coordinator.d.ts +18 -0
- package/.dist/common/index.d.ts +6 -0
- package/.dist/common/modifier.d.ts +4 -0
- package/.dist/common/naming/get-deploy-config.d.ts +5 -0
- package/.dist/common/naming/get-domain.d.ts +8 -0
- package/.dist/common/naming/get-function-entry.d.ts +3 -0
- package/.dist/common/naming/get-logical-name.d.ts +2 -0
- package/.dist/common/naming/get-resource-name.d.ts +26 -0
- package/.dist/common/naming/get-service-name.d.ts +9 -0
- package/.dist/common/naming/index.d.ts +8 -0
- package/.dist/common/naming/string-parser.d.ts +4 -0
- package/.dist/common/service.d.ts +21 -0
- package/.dist/common/synth/account-mapping.d.ts +2 -0
- package/.dist/common/synth/assume-role.d.ts +17 -0
- package/.dist/common/synth/get-global-props.d.ts +4 -0
- package/.dist/common/synth/get-service-props.d.ts +3 -0
- package/.dist/common/synth/index.d.ts +8 -0
- package/.dist/common/synth/pre-script.d.ts +21 -0
- package/.dist/common/synth/props-types.d.ts +41 -0
- package/.dist/common/synth/synth-error.d.ts +7 -0
- package/.dist/index.d.ts +4 -0
- package/.dist/package.json +43 -0
- package/.dist/prefab/analytics/events/handlers/ingestion-transform/handler.d.ts +3 -0
- package/.dist/prefab/analytics/events/index.d.ts +28 -0
- package/.dist/prefab/analytics/events/index.d.ts.map +1 -0
- package/.dist/prefab/analytics/events/index.js +163 -0
- package/.dist/prefab/analytics/events/index.js.map +1 -0
- package/.dist/prefab/analytics/index.d.ts +2 -0
- package/.dist/prefab/auth/cognito-pool/index.d.ts +57 -0
- package/.dist/prefab/auth/cognito-pool/index.d.ts.map +1 -0
- package/.dist/prefab/auth/cognito-pool/index.js.map +1 -0
- package/.dist/prefab/auth/index.d.ts +2 -0
- package/.dist/prefab/cdn/cdn-api/index.d.ts +34 -0
- package/.dist/prefab/cdn/cdn-api/index.d.ts.map +1 -0
- package/.dist/prefab/cdn/cdn-api/index.js +153 -0
- package/.dist/prefab/cdn/cdn-api/index.js.map +1 -0
- package/.dist/prefab/cdn/cdn-asset/index.d.ts +24 -0
- package/.dist/prefab/cdn/cdn-asset/index.d.ts.map +1 -0
- package/.dist/prefab/cdn/cdn-asset/index.js +96 -0
- package/.dist/prefab/cdn/cdn-asset/index.js.map +1 -0
- package/.dist/prefab/cdn/cdn-spa/index.d.ts +24 -0
- package/.dist/prefab/cdn/cdn-spa/index.d.ts.map +1 -0
- package/.dist/prefab/cdn/cdn-spa/index.js +138 -0
- package/.dist/prefab/cdn/cdn-spa/index.js.map +1 -0
- package/.dist/prefab/cdn/cdn-ssr/index.d.ts +33 -0
- package/.dist/prefab/cdn/cdn-ssr/index.d.ts.map +1 -0
- package/.dist/prefab/cdn/cdn-ssr/index.js +271 -0
- package/.dist/prefab/cdn/cdn-ssr/index.js.map +1 -0
- package/.dist/prefab/cdn/index.d.ts +5 -0
- package/.dist/prefab/compute/fargate/cluster.d.ts +13 -0
- package/.dist/prefab/compute/fargate/cluster.d.ts.map +1 -0
- package/.dist/prefab/compute/fargate/cluster.js.map +1 -0
- package/.dist/prefab/compute/fargate/index.d.ts +3 -0
- package/.dist/prefab/compute/fargate/service.d.ts +45 -0
- package/.dist/prefab/compute/fargate/service.d.ts.map +1 -0
- package/.dist/prefab/compute/fargate/service.js.map +1 -0
- package/.dist/prefab/compute/function/api-function/api-aggregate.d.ts +31 -0
- package/.dist/prefab/compute/function/api-function/api-aggregate.d.ts.map +1 -0
- package/.dist/prefab/compute/function/api-function/api-aggregate.js +53 -0
- package/.dist/prefab/compute/function/api-function/api-aggregate.js.map +1 -0
- package/.dist/prefab/compute/function/api-function/api-function.d.ts +22 -0
- package/.dist/prefab/compute/function/api-function/api-function.d.ts.map +1 -0
- package/.dist/prefab/compute/function/api-function/api-function.js +44 -0
- package/.dist/prefab/compute/function/api-function/api-function.js.map +1 -0
- package/.dist/prefab/compute/function/api-function/index.d.ts +3 -0
- package/.dist/prefab/compute/function/base-function/index.d.ts +33 -0
- package/.dist/prefab/compute/function/base-function/index.d.ts.map +1 -0
- package/.dist/prefab/compute/function/base-function/index.js +70 -0
- package/.dist/prefab/compute/function/base-function/index.js.map +1 -0
- package/.dist/prefab/compute/function/cognito-function/cognito-aggregate.d.ts +15 -0
- package/.dist/prefab/compute/function/cognito-function/cognito-aggregate.d.ts.map +1 -0
- package/.dist/prefab/compute/function/cognito-function/cognito-aggregate.js.map +1 -0
- package/.dist/prefab/compute/function/cognito-function/cognito-function.d.ts +17 -0
- package/.dist/prefab/compute/function/cognito-function/cognito-function.d.ts.map +1 -0
- package/.dist/prefab/compute/function/cognito-function/cognito-function.js.map +1 -0
- package/.dist/prefab/compute/function/cognito-function/index.d.ts +3 -0
- package/.dist/prefab/compute/function/cron-function/cron-aggregate.d.ts +14 -0
- package/.dist/prefab/compute/function/cron-function/cron-aggregate.d.ts.map +1 -0
- package/.dist/prefab/compute/function/cron-function/cron-aggregate.js.map +1 -0
- package/.dist/prefab/compute/function/cron-function/cron-function.d.ts +15 -0
- package/.dist/prefab/compute/function/cron-function/cron-function.d.ts.map +1 -0
- package/.dist/prefab/compute/function/cron-function/cron-function.js +24 -0
- package/.dist/prefab/compute/function/cron-function/cron-function.js.map +1 -0
- package/.dist/prefab/compute/function/cron-function/index.d.ts +3 -0
- package/.dist/prefab/compute/function/event-function/EventAggregateParams.d.ts +9 -0
- package/.dist/prefab/compute/function/event-function/EventAggregateParams.d.ts.map +1 -0
- package/.dist/prefab/compute/function/event-function/EventAggregateParams.js +3 -0
- package/.dist/prefab/compute/function/event-function/EventAggregateParams.js.map +1 -0
- package/.dist/prefab/compute/function/event-function/event-aggregate.d.ts +16 -0
- package/.dist/prefab/compute/function/event-function/event-aggregate.d.ts.map +1 -0
- package/.dist/prefab/compute/function/event-function/event-aggregate.js.map +1 -0
- package/.dist/prefab/compute/function/event-function/event-function.d.ts +14 -0
- package/.dist/prefab/compute/function/event-function/event-function.d.ts.map +1 -0
- package/.dist/prefab/compute/function/event-function/event-function.js.map +1 -0
- package/.dist/prefab/compute/function/event-function/index.d.ts +3 -0
- package/.dist/prefab/compute/function/index.d.ts +8 -0
- package/.dist/prefab/compute/function/queue-function/index.d.ts +22 -0
- package/.dist/prefab/compute/function/queue-function/index.d.ts.map +1 -0
- package/.dist/prefab/compute/function/queue-function/index.js +46 -0
- package/.dist/prefab/compute/function/queue-function/index.js.map +1 -0
- package/.dist/prefab/compute/function/topic-function/index.d.ts +20 -0
- package/.dist/prefab/compute/function/topic-function/index.d.ts.map +1 -0
- package/.dist/prefab/compute/function/topic-function/index.js +23 -0
- package/.dist/prefab/compute/function/topic-function/index.js.map +1 -0
- package/.dist/prefab/compute/index.d.ts +3 -0
- package/.dist/prefab/database/dynamo/index.d.ts +13 -0
- package/.dist/prefab/database/dynamo/index.d.ts.map +1 -0
- package/.dist/prefab/database/dynamo/index.js.map +1 -0
- package/.dist/prefab/database/index.d.ts +4 -0
- package/.dist/prefab/database/rds/handlers/start-cluster/handler.d.ts +2 -0
- package/.dist/prefab/database/rds/handlers/stop-cluster/handler.d.ts +2 -0
- package/.dist/prefab/database/rds/index.d.ts +51 -0
- package/.dist/prefab/database/rds/index.d.ts.map +1 -0
- package/.dist/prefab/database/rds/index.js +223 -0
- package/.dist/prefab/database/rds/index.js.map +1 -0
- package/.dist/prefab/database/timestream/index.d.ts +3 -0
- package/.dist/prefab/database/timestream/timestream-database.d.ts +11 -0
- package/.dist/prefab/database/timestream/timestream-database.d.ts.map +1 -0
- package/.dist/prefab/database/timestream/timestream-database.js.map +1 -0
- package/.dist/prefab/database/timestream/timestream-table.d.ts +21 -0
- package/.dist/prefab/database/timestream/timestream-table.d.ts.map +1 -0
- package/.dist/prefab/database/timestream/timestream-table.js.map +1 -0
- package/.dist/prefab/gateway/alb-public/index.d.ts +41 -0
- package/.dist/prefab/gateway/alb-public/index.d.ts.map +1 -0
- package/.dist/prefab/gateway/alb-public/index.js.map +1 -0
- package/.dist/prefab/gateway/api-gateway/api-http.d.ts +27 -0
- package/.dist/prefab/gateway/api-gateway/api-http.d.ts.map +1 -0
- package/.dist/prefab/gateway/api-gateway/api-http.js.map +1 -0
- package/.dist/prefab/gateway/api-gateway/api-rest.d.ts +23 -0
- package/.dist/prefab/gateway/api-gateway/api-rest.d.ts.map +1 -0
- package/.dist/prefab/gateway/api-gateway/api-rest.js.map +1 -0
- package/.dist/prefab/gateway/api-gateway/index.d.ts +3 -0
- package/.dist/prefab/gateway/app-sync/index.d.ts +31 -0
- package/.dist/prefab/gateway/app-sync/index.d.ts.map +1 -0
- package/.dist/prefab/gateway/app-sync/index.js.map +1 -0
- package/.dist/prefab/gateway/app-sync/resolver-aggregate.d.ts +33 -0
- package/.dist/prefab/gateway/app-sync/resolver-aggregate.d.ts.map +1 -0
- package/.dist/prefab/gateway/app-sync/resolver-aggregate.js.map +1 -0
- package/.dist/prefab/gateway/app-sync/types.d.ts +29 -0
- package/.dist/prefab/gateway/app-sync/types.d.ts.map +1 -0
- package/.dist/prefab/gateway/index.d.ts +4 -0
- package/.dist/prefab/index.d.ts +11 -0
- package/.dist/prefab/integration/event-bus/index.d.ts +18 -0
- package/.dist/prefab/integration/event-bus/index.d.ts.map +1 -0
- package/.dist/prefab/integration/event-bus/index.js.map +1 -0
- package/.dist/prefab/integration/index.d.ts +4 -0
- package/.dist/prefab/integration/queue/index.d.ts +29 -0
- package/.dist/prefab/integration/queue/index.d.ts.map +1 -0
- package/.dist/prefab/integration/queue/index.js.map +1 -0
- package/.dist/prefab/integration/topic/index.d.ts +19 -0
- package/.dist/prefab/integration/topic/index.d.ts.map +1 -0
- package/.dist/prefab/integration/topic/index.js.map +1 -0
- package/.dist/prefab/networking/dns-domain-ref/index.d.ts +14 -0
- package/.dist/prefab/networking/dns-domain-ref/index.d.ts.map +1 -0
- package/.dist/prefab/networking/dns-domain-ref/index.js.map +1 -0
- package/.dist/prefab/networking/dns-subdomain-certificate/index.d.ts +11 -0
- package/.dist/prefab/networking/dns-subdomain-certificate/index.d.ts.map +1 -0
- package/.dist/prefab/networking/dns-subdomain-certificate/index.js.map +1 -0
- package/.dist/prefab/networking/dns-subdomain-hosted-zone/index.d.ts +10 -0
- package/.dist/prefab/networking/dns-subdomain-hosted-zone/index.d.ts.map +1 -0
- package/.dist/prefab/networking/dns-subdomain-hosted-zone/index.js.map +1 -0
- package/.dist/prefab/networking/index.d.ts +6 -0
- package/.dist/prefab/networking/vpc/index.d.ts +18 -0
- package/.dist/prefab/networking/vpc/index.d.ts.map +1 -0
- package/.dist/prefab/networking/vpc/index.js.map +1 -0
- package/.dist/prefab/networking/waf/index.d.ts +12 -0
- package/.dist/prefab/networking/waf/index.d.ts.map +1 -0
- package/.dist/prefab/networking/waf/index.js.map +1 -0
- package/.dist/prefab/storage/bucket/asset-bucket.d.ts +10 -0
- package/.dist/prefab/storage/bucket/asset-bucket.d.ts.map +1 -0
- package/.dist/prefab/storage/bucket/index.d.ts +3 -0
- package/.dist/prefab/storage/bucket/private-bucket.d.ts +32 -0
- package/.dist/prefab/storage/bucket/private-bucket.d.ts.map +1 -0
- package/.dist/prefab/storage/bucket/private-bucket.js.map +1 -0
- package/.dist/prefab/storage/index.d.ts +2 -0
- package/.dist/prefab/utils/config/frontend-env-builder.d.ts +12 -0
- package/.dist/prefab/utils/config/frontend-env-builder.d.ts.map +1 -0
- package/.dist/prefab/utils/config/frontend-env-builder.js.map +1 -0
- package/.dist/prefab/utils/config/index.d.ts +4 -0
- package/.dist/prefab/utils/config/parameter-secret.d.ts +19 -0
- package/.dist/prefab/utils/config/parameter-secret.d.ts.map +1 -0
- package/.dist/prefab/utils/config/parameter-secret.js.map +1 -0
- package/.dist/prefab/utils/config/runtime-secret.d.ts.map +1 -0
- package/.dist/prefab/utils/config/runtime-secret.js.map +1 -0
- package/.dist/prefab/utils/deploy-pipeline/catalog/integrations/index.d.ts +2 -0
- package/.dist/prefab/utils/deploy-pipeline/entities/index.d.ts +29 -0
- package/.dist/prefab/utils/deploy-pipeline/index.d.ts +13 -0
- package/.dist/prefab/utils/deploy-pipeline/index.d.ts.map +1 -0
- package/.dist/prefab/utils/deploy-pipeline/index.js.map +1 -0
- package/.dist/prefab/utils/deploy-pipeline/platform/get-pipeline-detail.d.ts +6 -0
- package/.dist/prefab/utils/deploy-pipeline/platform/get-slack-payload.d.ts +3 -0
- package/.dist/prefab/utils/duration.d.ts +2 -0
- package/.dist/prefab/utils/index.d.ts +5 -0
- package/.dist/prefab/utils/ses/index.d.ts +20 -0
- package/.dist/prefab/utils/ses/index.d.ts.map +1 -0
- package/.dist/prefab/utils/ses/index.js.map +1 -0
- package/.dist/script/config-command/bootstrap.d.ts +3 -0
- package/.dist/script/config-command/bootstrap.js +65 -0
- package/.dist/script/config-command/bootstrap.js.map +1 -0
- package/.dist/script/config-command/deploy-spa.d.ts +3 -0
- package/.dist/script/config-command/deploy-spa.d.ts.map +1 -0
- package/.dist/script/config-command/deploy-spa.js +82 -0
- package/.dist/script/config-command/deploy-spa.js.map +1 -0
- package/.dist/script/config-command/deploy.d.ts +3 -0
- package/.dist/script/config-command/deploy.js +26 -0
- package/.dist/script/config-command/deploy.js.map +1 -0
- package/.dist/script/config-command/destroy.d.ts +3 -0
- package/.dist/script/config-command/destroy.js +26 -0
- package/.dist/script/config-command/destroy.js.map +1 -0
- package/.dist/script/config-command/env-ssr.d.ts +3 -0
- package/.dist/script/config-command/env-ssr.js +49 -0
- package/.dist/script/config-command/env-ssr.js.map +1 -0
- package/.dist/script/config-command/invalidation-ssr.d.ts +3 -0
- package/.dist/script/config-command/invalidation-ssr.js +53 -0
- package/.dist/script/config-command/invalidation-ssr.js.map +1 -0
- package/.dist/script/config-command/rds-migration.d.ts +5 -0
- package/.dist/script/config-command/rds-migration.js.map +1 -0
- package/.dist/script/config-command/rds-sync.d.ts +3 -0
- package/.dist/script/config-command/rds-sync.js.map +1 -0
- package/.dist/script/config-command/ssm-connect.d.ts +3 -0
- package/.dist/script/config-command/ssm-connect.js.map +1 -0
- package/.dist/script/config-command/start-spa.d.ts +3 -0
- package/.dist/script/config-command/start-spa.js +53 -0
- package/.dist/script/config-command/start-spa.js.map +1 -0
- package/.dist/script/config-command/start-ssr.d.ts +3 -0
- package/.dist/script/config-command/start-ssr.js +53 -0
- package/.dist/script/config-command/start-ssr.js.map +1 -0
- package/.dist/script/config-command/synth.d.ts +3 -0
- package/.dist/script/config-command/synth.js +26 -0
- package/.dist/script/config-command/synth.js.map +1 -0
- package/.dist/script/index.d.ts +7 -0
- package/.dist/script/index.d.ts.map +1 -0
- package/.dist/script/output-command/create-user.d.ts +9 -0
- package/.dist/script/output-command/create-user.d.ts.map +1 -0
- package/.dist/script/output-command/create-user.js.map +1 -0
- package/.dist/script/output-command/gen-postman-env.d.ts +9 -0
- package/.dist/script/output-command/gen-postman-env.d.ts.map +1 -0
- package/.dist/script/output-command/gen-postman-env.js +55 -0
- package/.dist/script/output-command/gen-postman-env.js.map +1 -0
- package/.dist/tsconfig.tsbuildinfo +1 -0
- package/.prettierignore +10 -0
- package/.prettierrc.json +12 -0
- package/.turbo/turbo-build.log +5 -0
- package/.turbo/turbo-release.log +7 -0
- package/CHANGELOG.md +8 -0
- package/common/coordinator.ts +103 -0
- package/common/index.ts +5 -0
- package/common/modifier.ts +11 -0
- package/common/naming/get-deploy-config.ts +5 -0
- package/common/naming/get-domain.ts +14 -0
- package/common/naming/get-function-entry.ts +11 -0
- package/common/naming/get-logical-name.ts +3 -0
- package/common/naming/get-resource-name.ts +77 -0
- package/common/naming/get-service-name.ts +13 -0
- package/common/naming/index.ts +7 -0
- package/common/naming/string-parser.ts +17 -0
- package/common/service.ts +48 -0
- package/common/synth/account-mapping.ts +16 -0
- package/common/synth/assume-role.ts +39 -0
- package/common/synth/get-global-props.ts +46 -0
- package/common/synth/get-service-props.ts +16 -0
- package/common/synth/index.ts +7 -0
- package/common/synth/pre-script.ts +103 -0
- package/common/synth/props-types.ts +79 -0
- package/common/synth/synth-error.ts +13 -0
- package/index.ts +3 -0
- package/package.json +4 -5
- package/prefab/analytics/events/handlers/ingestion-transform/handler.ts +35 -0
- package/prefab/analytics/events/index.ts +192 -0
- package/prefab/analytics/index.ts +1 -0
- package/prefab/auth/cognito-pool/index.ts +263 -0
- package/prefab/auth/index.ts +1 -0
- package/prefab/cdn/cdn-api/index.ts +169 -0
- package/prefab/cdn/cdn-asset/index.ts +89 -0
- package/prefab/cdn/cdn-spa/index.ts +136 -0
- package/prefab/cdn/cdn-ssr/index.ts +288 -0
- package/prefab/cdn/index.ts +4 -0
- package/prefab/compute/fargate/cluster.ts +24 -0
- package/prefab/compute/fargate/index.ts +2 -0
- package/prefab/compute/fargate/service.ts +130 -0
- package/prefab/compute/function/api-function/api-aggregate.ts +73 -0
- package/prefab/compute/function/api-function/api-function.ts +63 -0
- package/prefab/compute/function/api-function/index.ts +2 -0
- package/prefab/compute/function/base-function/index.ts +102 -0
- package/prefab/compute/function/cognito-function/cognito-aggregate.ts +29 -0
- package/prefab/compute/function/cognito-function/cognito-function.ts +36 -0
- package/prefab/compute/function/cognito-function/index.ts +2 -0
- package/prefab/compute/function/cron-function/cron-aggregate.ts +28 -0
- package/prefab/compute/function/cron-function/cron-function.ts +32 -0
- package/prefab/compute/function/cron-function/index.ts +2 -0
- package/prefab/compute/function/event-function/EventAggregateParams.ts +9 -0
- package/prefab/compute/function/event-function/event-aggregate.ts +33 -0
- package/prefab/compute/function/event-function/event-function.ts +42 -0
- package/prefab/compute/function/event-function/index.ts +2 -0
- package/prefab/compute/function/index.ts +7 -0
- package/prefab/compute/function/queue-function/index.ts +67 -0
- package/prefab/compute/function/topic-function/index.ts +36 -0
- package/prefab/compute/index.ts +2 -0
- package/prefab/database/dynamo/index.ts +113 -0
- package/prefab/database/index.ts +3 -0
- package/prefab/database/rds/handlers/start-cluster/handler.ts +7 -0
- package/prefab/database/rds/handlers/stop-cluster/handler.ts +7 -0
- package/prefab/database/rds/index.ts +248 -0
- package/prefab/database/timestream/index.ts +2 -0
- package/prefab/database/timestream/timestream-database.ts +24 -0
- package/prefab/database/timestream/timestream-table.ts +76 -0
- package/prefab/gateway/alb-public/index.ts +124 -0
- package/prefab/gateway/api-gateway/api-http.ts +71 -0
- package/prefab/gateway/api-gateway/api-rest.ts +93 -0
- package/prefab/gateway/api-gateway/index.ts +2 -0
- package/prefab/gateway/app-sync/index.ts +117 -0
- package/prefab/gateway/app-sync/resolver-aggregate.ts +138 -0
- package/prefab/gateway/app-sync/types.ts +29 -0
- package/prefab/gateway/index.ts +3 -0
- package/prefab/index.ts +10 -0
- package/prefab/integration/event-bus/index.ts +52 -0
- package/prefab/integration/index.ts +3 -0
- package/prefab/integration/queue/index.ts +94 -0
- package/prefab/integration/topic/index.ts +57 -0
- package/prefab/networking/dns-domain-ref/index.ts +32 -0
- package/prefab/networking/dns-subdomain-certificate/index.ts +30 -0
- package/prefab/networking/dns-subdomain-hosted-zone/index.ts +30 -0
- package/prefab/networking/index.ts +5 -0
- package/prefab/networking/vpc/index.ts +39 -0
- package/prefab/networking/waf/index.ts +49 -0
- package/prefab/storage/bucket/asset-bucket.ts +24 -0
- package/prefab/storage/bucket/index.ts +2 -0
- package/prefab/storage/bucket/private-bucket.ts +74 -0
- package/prefab/storage/index.ts +1 -0
- package/prefab/utils/config/frontend-env-builder.ts +30 -0
- package/prefab/utils/config/index.ts +3 -0
- package/prefab/utils/config/parameter-secret.ts +52 -0
- package/prefab/utils/config/runtime-secret.ts +48 -0
- package/prefab/utils/deploy-pipeline/catalog/integrations/index.ts +1 -0
- package/prefab/utils/deploy-pipeline/catalog/integrations/slack.ts +23 -0
- package/prefab/utils/deploy-pipeline/entities/index.ts +23 -0
- package/prefab/utils/deploy-pipeline/handlers/send-to-slack/handler.ts +32 -0
- package/prefab/utils/deploy-pipeline/index.ts +172 -0
- package/prefab/utils/deploy-pipeline/platform/get-pipeline-detail.ts +31 -0
- package/prefab/utils/deploy-pipeline/platform/get-slack-payload.ts +38 -0
- package/prefab/utils/deploy-pipeline/platform/send-to-slack.ts +16 -0
- package/prefab/utils/duration.ts +1 -0
- package/prefab/utils/index.ts +4 -0
- package/prefab/utils/ses/index.ts +134 -0
- package/readme.md +78 -0
- package/script/config-command/bootstrap.ts +108 -0
- package/script/config-command/deploy-spa.ts +126 -0
- package/script/config-command/deploy.ts +50 -0
- package/script/config-command/destroy.ts +49 -0
- package/script/config-command/env-ssr.ts +85 -0
- package/script/config-command/invalidation-ssr.ts +88 -0
- package/script/config-command/rds-migration.ts +177 -0
- package/script/config-command/rds-sync.ts +108 -0
- package/script/config-command/ssm-connect.ts +129 -0
- package/script/config-command/start-spa.ts +93 -0
- package/script/config-command/start-ssr.ts +91 -0
- package/script/config-command/synth.ts +50 -0
- package/script/index.ts +86 -0
- package/script/output-command/create-user.ts +89 -0
- package/script/output-command/gen-postman-env.ts +75 -0
- package/tsconfig.json +26 -0
- package/common/coordinator.d.ts +0 -28
- package/common/index.d.ts +0 -6
- package/common/modifier.d.ts +0 -5
- package/common/naming/get-deploy-config.d.ts +0 -9
- package/common/naming/get-domain.d.ts +0 -9
- package/common/naming/get-function-entry.d.ts +0 -4
- package/common/naming/get-logical-name.d.ts +0 -2
- package/common/naming/get-resource-name.d.ts +0 -47
- package/common/naming/get-service-name.d.ts +0 -10
- package/common/naming/index.d.ts +0 -8
- package/common/naming/string-parser.d.ts +0 -4
- package/common/service.d.ts +0 -29
- package/common/synth/account-mapping.d.ts +0 -2
- package/common/synth/assume-role.d.ts +0 -18
- package/common/synth/get-global-props.d.ts +0 -16
- package/common/synth/get-service-props.d.ts +0 -11
- package/common/synth/index.d.ts +0 -8
- package/common/synth/pre-script.d.ts +0 -32
- package/common/synth/props-types.d.ts +0 -60
- package/common/synth/synth-error.d.ts +0 -8
- package/index.d.ts +0 -4
- package/prefab/analytics/events/handlers/ingestion-transform/handler.d.ts +0 -4
- package/prefab/analytics/events/index.d.ts +0 -31
- package/prefab/analytics/events/index.d.ts.map +0 -1
- package/prefab/analytics/events/index.js +0 -163
- package/prefab/analytics/events/index.js.map +0 -1
- package/prefab/analytics/index.d.ts +0 -2
- package/prefab/auth/cognito-pool/index.d.ts +0 -65
- package/prefab/auth/cognito-pool/index.d.ts.map +0 -1
- package/prefab/auth/cognito-pool/index.js.map +0 -1
- package/prefab/auth/index.d.ts +0 -2
- package/prefab/cdn/cdn-api/index.d.ts +0 -38
- package/prefab/cdn/cdn-api/index.d.ts.map +0 -1
- package/prefab/cdn/cdn-api/index.js +0 -153
- package/prefab/cdn/cdn-api/index.js.map +0 -1
- package/prefab/cdn/cdn-asset/index.d.ts +0 -27
- package/prefab/cdn/cdn-asset/index.d.ts.map +0 -1
- package/prefab/cdn/cdn-asset/index.js +0 -96
- package/prefab/cdn/cdn-asset/index.js.map +0 -1
- package/prefab/cdn/cdn-spa/index.d.ts +0 -27
- package/prefab/cdn/cdn-spa/index.d.ts.map +0 -1
- package/prefab/cdn/cdn-spa/index.js +0 -138
- package/prefab/cdn/cdn-spa/index.js.map +0 -1
- package/prefab/cdn/cdn-ssr/index.d.ts +0 -36
- package/prefab/cdn/cdn-ssr/index.d.ts.map +0 -1
- package/prefab/cdn/cdn-ssr/index.js +0 -271
- package/prefab/cdn/cdn-ssr/index.js.map +0 -1
- package/prefab/cdn/index.d.ts +0 -5
- package/prefab/compute/fargate/cluster.d.ts +0 -16
- package/prefab/compute/fargate/cluster.d.ts.map +0 -1
- package/prefab/compute/fargate/cluster.js.map +0 -1
- package/prefab/compute/fargate/index.d.ts +0 -3
- package/prefab/compute/fargate/service.d.ts +0 -49
- package/prefab/compute/fargate/service.d.ts.map +0 -1
- package/prefab/compute/fargate/service.js.map +0 -1
- package/prefab/compute/function/api-function/api-aggregate.d.ts +0 -32
- package/prefab/compute/function/api-function/api-aggregate.d.ts.map +0 -1
- package/prefab/compute/function/api-function/api-aggregate.js +0 -54
- package/prefab/compute/function/api-function/api-aggregate.js.map +0 -1
- package/prefab/compute/function/api-function/api-function.d.ts +0 -22
- package/prefab/compute/function/api-function/api-function.d.ts.map +0 -1
- package/prefab/compute/function/api-function/api-function.js +0 -45
- package/prefab/compute/function/api-function/api-function.js.map +0 -1
- package/prefab/compute/function/api-function/index.d.ts +0 -3
- package/prefab/compute/function/base-function/index.d.ts +0 -33
- package/prefab/compute/function/base-function/index.d.ts.map +0 -1
- package/prefab/compute/function/base-function/index.js +0 -70
- package/prefab/compute/function/base-function/index.js.map +0 -1
- package/prefab/compute/function/cognito-function/cognito-aggregate.d.ts +0 -18
- package/prefab/compute/function/cognito-function/cognito-aggregate.d.ts.map +0 -1
- package/prefab/compute/function/cognito-function/cognito-aggregate.js.map +0 -1
- package/prefab/compute/function/cognito-function/cognito-function.d.ts +0 -19
- package/prefab/compute/function/cognito-function/cognito-function.d.ts.map +0 -1
- package/prefab/compute/function/cognito-function/cognito-function.js.map +0 -1
- package/prefab/compute/function/cognito-function/index.d.ts +0 -3
- package/prefab/compute/function/cron-function/cron-aggregate.d.ts +0 -17
- package/prefab/compute/function/cron-function/cron-aggregate.d.ts.map +0 -1
- package/prefab/compute/function/cron-function/cron-aggregate.js.map +0 -1
- package/prefab/compute/function/cron-function/cron-function.d.ts +0 -17
- package/prefab/compute/function/cron-function/cron-function.d.ts.map +0 -1
- package/prefab/compute/function/cron-function/cron-function.js +0 -24
- package/prefab/compute/function/cron-function/cron-function.js.map +0 -1
- package/prefab/compute/function/cron-function/index.d.ts +0 -3
- package/prefab/compute/function/event-function/event-aggregate.d.ts +0 -20
- package/prefab/compute/function/event-function/event-aggregate.d.ts.map +0 -1
- package/prefab/compute/function/event-function/event-aggregate.js.map +0 -1
- package/prefab/compute/function/event-function/event-function.d.ts +0 -14
- package/prefab/compute/function/event-function/event-function.d.ts.map +0 -1
- package/prefab/compute/function/event-function/event-function.js.map +0 -1
- package/prefab/compute/function/event-function/index.d.ts +0 -3
- package/prefab/compute/function/index.d.ts +0 -8
- package/prefab/compute/function/queue-function/index.d.ts +0 -25
- package/prefab/compute/function/queue-function/index.d.ts.map +0 -1
- package/prefab/compute/function/queue-function/index.js +0 -46
- package/prefab/compute/function/queue-function/index.js.map +0 -1
- package/prefab/compute/function/topic-function/index.d.ts +0 -23
- package/prefab/compute/function/topic-function/index.d.ts.map +0 -1
- package/prefab/compute/function/topic-function/index.js +0 -23
- package/prefab/compute/function/topic-function/index.js.map +0 -1
- package/prefab/compute/index.d.ts +0 -3
- package/prefab/database/dynamo/index.d.ts +0 -14
- package/prefab/database/dynamo/index.d.ts.map +0 -1
- package/prefab/database/dynamo/index.js.map +0 -1
- package/prefab/database/index.d.ts +0 -4
- package/prefab/database/rds/handlers/start-cluster/handler.d.ts +0 -2
- package/prefab/database/rds/handlers/stop-cluster/handler.d.ts +0 -2
- package/prefab/database/rds/index.d.ts +0 -54
- package/prefab/database/rds/index.d.ts.map +0 -1
- package/prefab/database/rds/index.js +0 -223
- package/prefab/database/rds/index.js.map +0 -1
- package/prefab/database/timestream/index.d.ts +0 -3
- package/prefab/database/timestream/timestream-database.d.ts +0 -13
- package/prefab/database/timestream/timestream-database.d.ts.map +0 -1
- package/prefab/database/timestream/timestream-database.js.map +0 -1
- package/prefab/database/timestream/timestream-table.d.ts +0 -23
- package/prefab/database/timestream/timestream-table.d.ts.map +0 -1
- package/prefab/database/timestream/timestream-table.js.map +0 -1
- package/prefab/gateway/alb-public/index.d.ts +0 -44
- package/prefab/gateway/alb-public/index.d.ts.map +0 -1
- package/prefab/gateway/alb-public/index.js.map +0 -1
- package/prefab/gateway/api-gateway/api-http.d.ts +0 -27
- package/prefab/gateway/api-gateway/api-http.d.ts.map +0 -1
- package/prefab/gateway/api-gateway/api-http.js.map +0 -1
- package/prefab/gateway/api-gateway/api-rest.d.ts +0 -26
- package/prefab/gateway/api-gateway/api-rest.d.ts.map +0 -1
- package/prefab/gateway/api-gateway/api-rest.js.map +0 -1
- package/prefab/gateway/api-gateway/index.d.ts +0 -3
- package/prefab/gateway/app-sync/index.d.ts +0 -36
- package/prefab/gateway/app-sync/index.d.ts.map +0 -1
- package/prefab/gateway/app-sync/index.js.map +0 -1
- package/prefab/gateway/app-sync/resolver-aggregate.d.ts +0 -33
- package/prefab/gateway/app-sync/resolver-aggregate.d.ts.map +0 -1
- package/prefab/gateway/app-sync/resolver-aggregate.js.map +0 -1
- package/prefab/gateway/app-sync/types.d.ts +0 -29
- package/prefab/gateway/app-sync/types.d.ts.map +0 -1
- package/prefab/gateway/index.d.ts +0 -4
- package/prefab/index.d.ts +0 -11
- package/prefab/integration/event-bus/index.d.ts +0 -20
- package/prefab/integration/event-bus/index.d.ts.map +0 -1
- package/prefab/integration/event-bus/index.js.map +0 -1
- package/prefab/integration/index.d.ts +0 -4
- package/prefab/integration/queue/index.d.ts +0 -29
- package/prefab/integration/queue/index.d.ts.map +0 -1
- package/prefab/integration/queue/index.js.map +0 -1
- package/prefab/integration/topic/index.d.ts +0 -21
- package/prefab/integration/topic/index.d.ts.map +0 -1
- package/prefab/integration/topic/index.js.map +0 -1
- package/prefab/networking/dns-domain-ref/index.d.ts +0 -16
- package/prefab/networking/dns-domain-ref/index.d.ts.map +0 -1
- package/prefab/networking/dns-domain-ref/index.js.map +0 -1
- package/prefab/networking/dns-subdomain-certificate/index.d.ts +0 -13
- package/prefab/networking/dns-subdomain-certificate/index.d.ts.map +0 -1
- package/prefab/networking/dns-subdomain-certificate/index.js.map +0 -1
- package/prefab/networking/dns-subdomain-hosted-zone/index.d.ts +0 -12
- package/prefab/networking/dns-subdomain-hosted-zone/index.d.ts.map +0 -1
- package/prefab/networking/dns-subdomain-hosted-zone/index.js.map +0 -1
- package/prefab/networking/index.d.ts +0 -6
- package/prefab/networking/vpc/index.d.ts +0 -20
- package/prefab/networking/vpc/index.d.ts.map +0 -1
- package/prefab/networking/vpc/index.js.map +0 -1
- package/prefab/networking/waf/index.d.ts +0 -14
- package/prefab/networking/waf/index.d.ts.map +0 -1
- package/prefab/networking/waf/index.js.map +0 -1
- package/prefab/storage/bucket/asset-bucket.d.ts +0 -12
- package/prefab/storage/bucket/asset-bucket.d.ts.map +0 -1
- package/prefab/storage/bucket/index.d.ts +0 -3
- package/prefab/storage/bucket/private-bucket.d.ts +0 -26
- package/prefab/storage/bucket/private-bucket.d.ts.map +0 -1
- package/prefab/storage/bucket/private-bucket.js.map +0 -1
- package/prefab/storage/index.d.ts +0 -2
- package/prefab/utils/config/frontend-env-builder.d.ts +0 -14
- package/prefab/utils/config/frontend-env-builder.d.ts.map +0 -1
- package/prefab/utils/config/frontend-env-builder.js.map +0 -1
- package/prefab/utils/config/index.d.ts +0 -4
- package/prefab/utils/config/parameter-secret.d.ts +0 -21
- package/prefab/utils/config/parameter-secret.d.ts.map +0 -1
- package/prefab/utils/config/parameter-secret.js.map +0 -1
- package/prefab/utils/config/runtime-secret.d.ts.map +0 -1
- package/prefab/utils/config/runtime-secret.js.map +0 -1
- package/prefab/utils/deploy-pipeline/catalog/integrations/index.d.ts +0 -2
- package/prefab/utils/deploy-pipeline/entities/index.d.ts +0 -29
- package/prefab/utils/deploy-pipeline/index.d.ts +0 -15
- package/prefab/utils/deploy-pipeline/index.d.ts.map +0 -1
- package/prefab/utils/deploy-pipeline/index.js.map +0 -1
- package/prefab/utils/deploy-pipeline/platform/get-pipeline-detail.d.ts +0 -6
- package/prefab/utils/deploy-pipeline/platform/get-slack-payload.d.ts +0 -4
- package/prefab/utils/duration.d.ts +0 -2
- package/prefab/utils/index.d.ts +0 -5
- package/prefab/utils/ses/index.d.ts +0 -22
- package/prefab/utils/ses/index.d.ts.map +0 -1
- package/prefab/utils/ses/index.js.map +0 -1
- package/script/config-command/bootstrap.d.ts +0 -4
- package/script/config-command/bootstrap.js +0 -66
- package/script/config-command/bootstrap.js.map +0 -1
- package/script/config-command/deploy-spa.d.ts +0 -4
- package/script/config-command/deploy-spa.d.ts.map +0 -1
- package/script/config-command/deploy-spa.js +0 -84
- package/script/config-command/deploy-spa.js.map +0 -1
- package/script/config-command/deploy.d.ts +0 -4
- package/script/config-command/deploy.js +0 -26
- package/script/config-command/deploy.js.map +0 -1
- package/script/config-command/destroy.d.ts +0 -4
- package/script/config-command/destroy.js +0 -26
- package/script/config-command/destroy.js.map +0 -1
- package/script/config-command/env-ssr.d.ts +0 -4
- package/script/config-command/env-ssr.js +0 -51
- package/script/config-command/env-ssr.js.map +0 -1
- package/script/config-command/invalidation-ssr.d.ts +0 -4
- package/script/config-command/invalidation-ssr.js +0 -55
- package/script/config-command/invalidation-ssr.js.map +0 -1
- package/script/config-command/rds-migration.d.ts +0 -7
- package/script/config-command/rds-migration.js.map +0 -1
- package/script/config-command/rds-sync.d.ts +0 -4
- package/script/config-command/rds-sync.js.map +0 -1
- package/script/config-command/ssm-connect.d.ts +0 -4
- package/script/config-command/ssm-connect.js.map +0 -1
- package/script/config-command/start-spa.d.ts +0 -4
- package/script/config-command/start-spa.js +0 -55
- package/script/config-command/start-spa.js.map +0 -1
- package/script/config-command/start-ssr.d.ts +0 -4
- package/script/config-command/start-ssr.js +0 -55
- package/script/config-command/start-ssr.js.map +0 -1
- package/script/config-command/synth.d.ts +0 -4
- package/script/config-command/synth.js +0 -26
- package/script/config-command/synth.js.map +0 -1
- package/script/index.d.ts +0 -25
- package/script/index.d.ts.map +0 -1
- package/script/output-command/create-user.d.ts +0 -9
- package/script/output-command/create-user.d.ts.map +0 -1
- package/script/output-command/create-user.js.map +0 -1
- package/script/output-command/gen-postman-env.d.ts +0 -28
- package/script/output-command/gen-postman-env.d.ts.map +0 -1
- package/script/output-command/gen-postman-env.js +0 -56
- package/script/output-command/gen-postman-env.js.map +0 -1
- package/tsconfig.tsbuildinfo +0 -1
- /package/{common → .dist/common}/coordinator.d.ts.map +0 -0
- /package/{common → .dist/common}/coordinator.js +0 -0
- /package/{common → .dist/common}/coordinator.js.map +0 -0
- /package/{common → .dist/common}/index.d.ts.map +0 -0
- /package/{common → .dist/common}/index.js +0 -0
- /package/{common → .dist/common}/index.js.map +0 -0
- /package/{common → .dist/common}/modifier.d.ts.map +0 -0
- /package/{common → .dist/common}/modifier.js +0 -0
- /package/{common → .dist/common}/modifier.js.map +0 -0
- /package/{common → .dist/common}/naming/get-deploy-config.d.ts.map +0 -0
- /package/{common → .dist/common}/naming/get-deploy-config.js +0 -0
- /package/{common → .dist/common}/naming/get-deploy-config.js.map +0 -0
- /package/{common → .dist/common}/naming/get-domain.d.ts.map +0 -0
- /package/{common → .dist/common}/naming/get-domain.js +0 -0
- /package/{common → .dist/common}/naming/get-domain.js.map +0 -0
- /package/{common → .dist/common}/naming/get-function-entry.d.ts.map +0 -0
- /package/{common → .dist/common}/naming/get-function-entry.js +0 -0
- /package/{common → .dist/common}/naming/get-function-entry.js.map +0 -0
- /package/{common → .dist/common}/naming/get-logical-name.d.ts.map +0 -0
- /package/{common → .dist/common}/naming/get-logical-name.js +0 -0
- /package/{common → .dist/common}/naming/get-logical-name.js.map +0 -0
- /package/{common → .dist/common}/naming/get-resource-name.d.ts.map +0 -0
- /package/{common → .dist/common}/naming/get-resource-name.js +0 -0
- /package/{common → .dist/common}/naming/get-resource-name.js.map +0 -0
- /package/{common → .dist/common}/naming/get-service-name.d.ts.map +0 -0
- /package/{common → .dist/common}/naming/get-service-name.js +0 -0
- /package/{common → .dist/common}/naming/get-service-name.js.map +0 -0
- /package/{common → .dist/common}/naming/index.d.ts.map +0 -0
- /package/{common → .dist/common}/naming/index.js +0 -0
- /package/{common → .dist/common}/naming/index.js.map +0 -0
- /package/{common → .dist/common}/naming/string-parser.d.ts.map +0 -0
- /package/{common → .dist/common}/naming/string-parser.js +0 -0
- /package/{common → .dist/common}/naming/string-parser.js.map +0 -0
- /package/{common → .dist/common}/service.d.ts.map +0 -0
- /package/{common → .dist/common}/service.js +0 -0
- /package/{common → .dist/common}/service.js.map +0 -0
- /package/{common → .dist/common}/synth/account-mapping.d.ts.map +0 -0
- /package/{common → .dist/common}/synth/account-mapping.js +0 -0
- /package/{common → .dist/common}/synth/account-mapping.js.map +0 -0
- /package/{common → .dist/common}/synth/assume-role.d.ts.map +0 -0
- /package/{common → .dist/common}/synth/assume-role.js +0 -0
- /package/{common → .dist/common}/synth/assume-role.js.map +0 -0
- /package/{common → .dist/common}/synth/get-global-props.d.ts.map +0 -0
- /package/{common → .dist/common}/synth/get-global-props.js +0 -0
- /package/{common → .dist/common}/synth/get-global-props.js.map +0 -0
- /package/{common → .dist/common}/synth/get-service-props.d.ts.map +0 -0
- /package/{common → .dist/common}/synth/get-service-props.js +0 -0
- /package/{common → .dist/common}/synth/get-service-props.js.map +0 -0
- /package/{common → .dist/common}/synth/index.d.ts.map +0 -0
- /package/{common → .dist/common}/synth/index.js +0 -0
- /package/{common → .dist/common}/synth/index.js.map +0 -0
- /package/{common → .dist/common}/synth/pre-script.d.ts.map +0 -0
- /package/{common → .dist/common}/synth/pre-script.js +0 -0
- /package/{common → .dist/common}/synth/pre-script.js.map +0 -0
- /package/{common → .dist/common}/synth/props-types.d.ts.map +0 -0
- /package/{common → .dist/common}/synth/props-types.js +0 -0
- /package/{common → .dist/common}/synth/props-types.js.map +0 -0
- /package/{common → .dist/common}/synth/synth-error.d.ts.map +0 -0
- /package/{common → .dist/common}/synth/synth-error.js +0 -0
- /package/{common → .dist/common}/synth/synth-error.js.map +0 -0
- /package/{index.d.ts.map → .dist/index.d.ts.map} +0 -0
- /package/{index.js → .dist/index.js} +0 -0
- /package/{index.js.map → .dist/index.js.map} +0 -0
- /package/{prefab → .dist/prefab}/analytics/events/handlers/ingestion-transform/handler.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/analytics/events/handlers/ingestion-transform/handler.js +0 -0
- /package/{prefab → .dist/prefab}/analytics/events/handlers/ingestion-transform/handler.js.map +0 -0
- /package/{prefab → .dist/prefab}/analytics/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/analytics/index.js +0 -0
- /package/{prefab → .dist/prefab}/analytics/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/auth/cognito-pool/index.js +0 -0
- /package/{prefab → .dist/prefab}/auth/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/auth/index.js +0 -0
- /package/{prefab → .dist/prefab}/auth/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/cdn/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/cdn/index.js +0 -0
- /package/{prefab → .dist/prefab}/cdn/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/compute/fargate/cluster.js +0 -0
- /package/{prefab → .dist/prefab}/compute/fargate/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/compute/fargate/index.js +0 -0
- /package/{prefab → .dist/prefab}/compute/fargate/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/compute/fargate/service.js +0 -0
- /package/{prefab → .dist/prefab}/compute/function/api-function/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/compute/function/api-function/index.js +0 -0
- /package/{prefab → .dist/prefab}/compute/function/api-function/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/compute/function/cognito-function/cognito-aggregate.js +0 -0
- /package/{prefab → .dist/prefab}/compute/function/cognito-function/cognito-function.js +0 -0
- /package/{prefab → .dist/prefab}/compute/function/cognito-function/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/compute/function/cognito-function/index.js +0 -0
- /package/{prefab → .dist/prefab}/compute/function/cognito-function/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/compute/function/cron-function/cron-aggregate.js +0 -0
- /package/{prefab → .dist/prefab}/compute/function/cron-function/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/compute/function/cron-function/index.js +0 -0
- /package/{prefab → .dist/prefab}/compute/function/cron-function/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/compute/function/event-function/event-aggregate.js +0 -0
- /package/{prefab → .dist/prefab}/compute/function/event-function/event-function.js +0 -0
- /package/{prefab → .dist/prefab}/compute/function/event-function/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/compute/function/event-function/index.js +0 -0
- /package/{prefab → .dist/prefab}/compute/function/event-function/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/compute/function/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/compute/function/index.js +0 -0
- /package/{prefab → .dist/prefab}/compute/function/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/compute/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/compute/index.js +0 -0
- /package/{prefab → .dist/prefab}/compute/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/database/dynamo/index.js +0 -0
- /package/{prefab → .dist/prefab}/database/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/database/index.js +0 -0
- /package/{prefab → .dist/prefab}/database/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/database/rds/handlers/start-cluster/handler.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/database/rds/handlers/start-cluster/handler.js +0 -0
- /package/{prefab → .dist/prefab}/database/rds/handlers/start-cluster/handler.js.map +0 -0
- /package/{prefab → .dist/prefab}/database/rds/handlers/stop-cluster/handler.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/database/rds/handlers/stop-cluster/handler.js +0 -0
- /package/{prefab → .dist/prefab}/database/rds/handlers/stop-cluster/handler.js.map +0 -0
- /package/{prefab → .dist/prefab}/database/timestream/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/database/timestream/index.js +0 -0
- /package/{prefab → .dist/prefab}/database/timestream/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/database/timestream/timestream-database.js +0 -0
- /package/{prefab → .dist/prefab}/database/timestream/timestream-table.js +0 -0
- /package/{prefab → .dist/prefab}/gateway/alb-public/index.js +0 -0
- /package/{prefab → .dist/prefab}/gateway/api-gateway/api-http.js +0 -0
- /package/{prefab → .dist/prefab}/gateway/api-gateway/api-rest.js +0 -0
- /package/{prefab → .dist/prefab}/gateway/api-gateway/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/gateway/api-gateway/index.js +0 -0
- /package/{prefab → .dist/prefab}/gateway/api-gateway/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/gateway/app-sync/index.js +0 -0
- /package/{prefab → .dist/prefab}/gateway/app-sync/resolver-aggregate.js +0 -0
- /package/{prefab → .dist/prefab}/gateway/app-sync/types.js +0 -0
- /package/{prefab → .dist/prefab}/gateway/app-sync/types.js.map +0 -0
- /package/{prefab → .dist/prefab}/gateway/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/gateway/index.js +0 -0
- /package/{prefab → .dist/prefab}/gateway/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/index.js +0 -0
- /package/{prefab → .dist/prefab}/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/integration/event-bus/index.js +0 -0
- /package/{prefab → .dist/prefab}/integration/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/integration/index.js +0 -0
- /package/{prefab → .dist/prefab}/integration/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/integration/queue/index.js +0 -0
- /package/{prefab → .dist/prefab}/integration/topic/index.js +0 -0
- /package/{prefab → .dist/prefab}/networking/dns-domain-ref/index.js +0 -0
- /package/{prefab → .dist/prefab}/networking/dns-subdomain-certificate/index.js +0 -0
- /package/{prefab → .dist/prefab}/networking/dns-subdomain-hosted-zone/index.js +0 -0
- /package/{prefab → .dist/prefab}/networking/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/networking/index.js +0 -0
- /package/{prefab → .dist/prefab}/networking/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/networking/vpc/index.js +0 -0
- /package/{prefab → .dist/prefab}/networking/waf/index.js +0 -0
- /package/{prefab → .dist/prefab}/storage/bucket/asset-bucket.js +0 -0
- /package/{prefab → .dist/prefab}/storage/bucket/asset-bucket.js.map +0 -0
- /package/{prefab → .dist/prefab}/storage/bucket/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/storage/bucket/index.js +0 -0
- /package/{prefab → .dist/prefab}/storage/bucket/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/storage/bucket/private-bucket.js +0 -0
- /package/{prefab → .dist/prefab}/storage/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/storage/index.js +0 -0
- /package/{prefab → .dist/prefab}/storage/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/utils/config/frontend-env-builder.js +0 -0
- /package/{prefab → .dist/prefab}/utils/config/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/utils/config/index.js +0 -0
- /package/{prefab → .dist/prefab}/utils/config/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/utils/config/parameter-secret.js +0 -0
- /package/{prefab → .dist/prefab}/utils/config/runtime-secret.d.ts +0 -0
- /package/{prefab → .dist/prefab}/utils/config/runtime-secret.js +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/catalog/integrations/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/catalog/integrations/index.js +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/catalog/integrations/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/catalog/integrations/slack.d.ts +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/catalog/integrations/slack.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/catalog/integrations/slack.js +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/catalog/integrations/slack.js.map +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/entities/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/entities/index.js +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/entities/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/handlers/send-to-slack/handler.d.ts +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/handlers/send-to-slack/handler.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/handlers/send-to-slack/handler.js +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/handlers/send-to-slack/handler.js.map +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/index.js +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/get-pipeline-detail.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/get-pipeline-detail.js +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/get-pipeline-detail.js.map +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/get-slack-payload.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/get-slack-payload.js +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/get-slack-payload.js.map +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/send-to-slack.d.ts +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/send-to-slack.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/send-to-slack.js +0 -0
- /package/{prefab → .dist/prefab}/utils/deploy-pipeline/platform/send-to-slack.js.map +0 -0
- /package/{prefab → .dist/prefab}/utils/duration.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/utils/duration.js +0 -0
- /package/{prefab → .dist/prefab}/utils/duration.js.map +0 -0
- /package/{prefab → .dist/prefab}/utils/index.d.ts.map +0 -0
- /package/{prefab → .dist/prefab}/utils/index.js +0 -0
- /package/{prefab → .dist/prefab}/utils/index.js.map +0 -0
- /package/{prefab → .dist/prefab}/utils/ses/index.js +0 -0
- /package/{script → .dist/script}/config-command/bootstrap.d.ts.map +0 -0
- /package/{script → .dist/script}/config-command/deploy.d.ts.map +0 -0
- /package/{script → .dist/script}/config-command/destroy.d.ts.map +0 -0
- /package/{script → .dist/script}/config-command/env-ssr.d.ts.map +0 -0
- /package/{script → .dist/script}/config-command/invalidation-ssr.d.ts.map +0 -0
- /package/{script → .dist/script}/config-command/rds-migration.d.ts.map +0 -0
- /package/{script → .dist/script}/config-command/rds-migration.js +0 -0
- /package/{script → .dist/script}/config-command/rds-sync.d.ts.map +0 -0
- /package/{script → .dist/script}/config-command/rds-sync.js +0 -0
- /package/{script → .dist/script}/config-command/ssm-connect.d.ts.map +0 -0
- /package/{script → .dist/script}/config-command/ssm-connect.js +0 -0
- /package/{script → .dist/script}/config-command/start-spa.d.ts.map +0 -0
- /package/{script → .dist/script}/config-command/start-ssr.d.ts.map +0 -0
- /package/{script → .dist/script}/config-command/synth.d.ts.map +0 -0
- /package/{script → .dist/script}/index.js +0 -0
- /package/{script → .dist/script}/index.js.map +0 -0
- /package/{script → .dist/script}/output-command/create-user.js +0 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import * as awsALB from 'aws-cdk-lib/aws-elasticloadbalancingv2';
|
|
2
|
+
import { Tags } from 'aws-cdk-lib';
|
|
3
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
|
|
4
|
+
import { ISecurityGroup, IVpc, Peer, Port, SecurityGroup } from 'aws-cdk-lib/aws-ec2';
|
|
5
|
+
import { FargateService } from 'aws-cdk-lib/aws-ecs';
|
|
6
|
+
import { ApplicationListener, ListenerAction, ListenerCondition } from 'aws-cdk-lib/aws-elasticloadbalancingv2';
|
|
7
|
+
import { Construct } from 'constructs';
|
|
8
|
+
|
|
9
|
+
import { ServiceStack, SynthError, getLogicalName, getResourceName } from '../../../common';
|
|
10
|
+
|
|
11
|
+
import { CdnApiPrefab } from '../../cdn';
|
|
12
|
+
|
|
13
|
+
export type PublicAlbPrefabParams = {
|
|
14
|
+
name: string;
|
|
15
|
+
vpc: IVpc;
|
|
16
|
+
certificate: ICertificate;
|
|
17
|
+
basePath?: string;
|
|
18
|
+
cdnApiPrefab?: CdnApiPrefab;
|
|
19
|
+
existingResource?: {
|
|
20
|
+
albToClusterSG: string;
|
|
21
|
+
securityGroupId: string;
|
|
22
|
+
listenerArn: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export class PublicAlbPrefab extends Construct {
|
|
27
|
+
public readonly alb!: awsALB.ApplicationLoadBalancer;
|
|
28
|
+
private readonly listener: awsALB.IApplicationListener;
|
|
29
|
+
private readonly albToClusterSG: ISecurityGroup;
|
|
30
|
+
private readonly upstreamSG!: ISecurityGroup;
|
|
31
|
+
private readonly vpc: IVpc;
|
|
32
|
+
private priorityIndex: number;
|
|
33
|
+
private service: ServiceStack;
|
|
34
|
+
|
|
35
|
+
constructor(service: ServiceStack, params: PublicAlbPrefabParams) {
|
|
36
|
+
super(service, getLogicalName(PublicAlbPrefab.name));
|
|
37
|
+
|
|
38
|
+
this.service = service;
|
|
39
|
+
this.vpc = params.vpc;
|
|
40
|
+
this.priorityIndex = 1;
|
|
41
|
+
|
|
42
|
+
if (params.existingResource) {
|
|
43
|
+
this.listener = ApplicationListener.fromApplicationListenerAttributes(this, getLogicalName(params.name, 'listener'), {
|
|
44
|
+
listenerArn: params.existingResource.listenerArn,
|
|
45
|
+
securityGroup: SecurityGroup.fromSecurityGroupId(this, 'sg', params.existingResource.securityGroupId),
|
|
46
|
+
});
|
|
47
|
+
this.albToClusterSG = SecurityGroup.fromSecurityGroupId(this, 'escSG', params.existingResource.albToClusterSG);
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// UPSTREAM SECURITY GROUP
|
|
52
|
+
this.upstreamSG = new SecurityGroup(this, getLogicalName(params.name, 'sg'), {
|
|
53
|
+
securityGroupName: getResourceName('upstream', service.props),
|
|
54
|
+
vpc: params.vpc,
|
|
55
|
+
allowAllOutbound: true,
|
|
56
|
+
});
|
|
57
|
+
Tags.of(this.upstreamSG).add('Name', getResourceName('upstream', service.props));
|
|
58
|
+
this.upstreamSG.addIngressRule(Peer.anyIpv4(), Port.tcp(443), 'Allow https traffic');
|
|
59
|
+
|
|
60
|
+
// ALB
|
|
61
|
+
this.alb = new awsALB.ApplicationLoadBalancer(this, getLogicalName(params.name, 'alb'), {
|
|
62
|
+
loadBalancerName: getResourceName('', { ...this.service.props, serviceName: params.name }),
|
|
63
|
+
vpc: params.vpc,
|
|
64
|
+
vpcSubnets: { subnets: params.vpc.publicSubnets },
|
|
65
|
+
internetFacing: true,
|
|
66
|
+
securityGroup: this.upstreamSG,
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// INBOUND
|
|
70
|
+
this.listener = this.alb.addListener(getLogicalName(params.name, 'listener'), {
|
|
71
|
+
open: true,
|
|
72
|
+
protocol: awsALB.ApplicationProtocol.HTTPS,
|
|
73
|
+
port: 443,
|
|
74
|
+
certificates: [params.certificate],
|
|
75
|
+
defaultAction: ListenerAction.fixedResponse(404, { messageBody: 'MissingPath' }),
|
|
76
|
+
});
|
|
77
|
+
// this.alb.addSecurityGroup(this.sg), getResourceName('upstream', service.props);
|
|
78
|
+
|
|
79
|
+
this.albToClusterSG = new SecurityGroup(this, getLogicalName(params.name, 'escSG'), {
|
|
80
|
+
securityGroupName: getResourceName('downstream', service.props),
|
|
81
|
+
vpc: params.vpc,
|
|
82
|
+
allowAllOutbound: true,
|
|
83
|
+
});
|
|
84
|
+
this.albToClusterSG.connections.allowFrom(this.upstreamSG, Port.allTcp(), 'Outbound traffic from ALB to Cluster');
|
|
85
|
+
Tags.of(this.albToClusterSG).add('Name', getResourceName('downstream', service.props));
|
|
86
|
+
|
|
87
|
+
// ADD PATH TO CDN DISTRIBUTION
|
|
88
|
+
if (params.cdnApiPrefab) {
|
|
89
|
+
if (!params.basePath) throw new SynthError('basePath is required when cdnApi is enabled');
|
|
90
|
+
params.cdnApiPrefab.addAlb(params.basePath, this.alb);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
private getNextPriorityIndex(): number {
|
|
94
|
+
return this.priorityIndex++;
|
|
95
|
+
}
|
|
96
|
+
public getAlbToClusterSG(): ISecurityGroup {
|
|
97
|
+
return this.albToClusterSG;
|
|
98
|
+
}
|
|
99
|
+
public appendTargetGroup({ name, basePath, mappingPort, fargateService, healthCheckPath, fixedPriority }: AppendTargetGroup): void {
|
|
100
|
+
const targetGroup = new awsALB.ApplicationTargetGroup(this, getLogicalName(name, 'targetGroup'), {
|
|
101
|
+
targetGroupName: getResourceName('', { ...this.service.props, serviceName: name }),
|
|
102
|
+
port: mappingPort,
|
|
103
|
+
vpc: this.vpc,
|
|
104
|
+
protocol: awsALB.ApplicationProtocol.HTTP,
|
|
105
|
+
healthCheck: { protocol: awsALB.Protocol.HTTP, path: healthCheckPath },
|
|
106
|
+
targets: [fargateService.loadBalancerTarget({ containerName: name, containerPort: mappingPort })],
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
this.listener.addTargetGroups(getLogicalName(name, 'listenerTG'), {
|
|
110
|
+
targetGroups: [targetGroup],
|
|
111
|
+
conditions: [ListenerCondition.pathPatterns([`${basePath}*`])],
|
|
112
|
+
priority: fixedPriority || this.getNextPriorityIndex(),
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export type AppendTargetGroup = {
|
|
118
|
+
name: string;
|
|
119
|
+
basePath: string;
|
|
120
|
+
mappingPort: number;
|
|
121
|
+
fargateService: FargateService;
|
|
122
|
+
healthCheckPath: string;
|
|
123
|
+
fixedPriority?: number;
|
|
124
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { CfnOutput, Duration, Fn } from 'aws-cdk-lib';
|
|
2
|
+
import { CorsHttpMethod, HttpApi, HttpMethod, IHttpRouteAuthorizer } from 'aws-cdk-lib/aws-apigatewayv2';
|
|
3
|
+
import { HttpUserPoolAuthorizer, HttpLambdaAuthorizer, HttpLambdaResponseType } from 'aws-cdk-lib/aws-apigatewayv2-authorizers';
|
|
4
|
+
import { HttpLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
|
|
5
|
+
import { UserPool, UserPoolClient } from 'aws-cdk-lib/aws-cognito';
|
|
6
|
+
import { IFunction } from 'aws-cdk-lib/aws-lambda';
|
|
7
|
+
import { Construct } from 'constructs';
|
|
8
|
+
|
|
9
|
+
import { ApiDefinition, ApiInterface } from '@takumi-stack/sdk';
|
|
10
|
+
|
|
11
|
+
import { ServiceStack, getLogicalName, getResourceName } from '../../../common';
|
|
12
|
+
import { CdnApiPrefab } from '../../cdn';
|
|
13
|
+
|
|
14
|
+
export type ApiHttPrefabParams = {
|
|
15
|
+
basePath: string;
|
|
16
|
+
cdnApiPrefab?: CdnApiPrefab;
|
|
17
|
+
userPool?: UserPool;
|
|
18
|
+
userPoolClient?: UserPoolClient;
|
|
19
|
+
customAuthorizerHandler?: IFunction;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export class ApiHttpPrefab extends Construct {
|
|
23
|
+
public readonly api: HttpApi;
|
|
24
|
+
public readonly authorizer!: IHttpRouteAuthorizer;
|
|
25
|
+
|
|
26
|
+
constructor(service: ServiceStack, params: ApiHttPrefabParams) {
|
|
27
|
+
super(service, getLogicalName(ApiHttpPrefab.name));
|
|
28
|
+
|
|
29
|
+
if (params.userPool && params.userPoolClient)
|
|
30
|
+
this.authorizer = new HttpUserPoolAuthorizer('Authorizer', params.userPool, {
|
|
31
|
+
userPoolClients: [params.userPoolClient],
|
|
32
|
+
identitySource: ['$request.header.Authorization'],
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
if (params.customAuthorizerHandler)
|
|
36
|
+
this.authorizer = new HttpLambdaAuthorizer('LambdaAuthorizer', params.customAuthorizerHandler, {
|
|
37
|
+
responseTypes: [HttpLambdaResponseType.SIMPLE],
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
this.api = new HttpApi(this, 'HttpApi', {
|
|
41
|
+
apiName: getResourceName('', service.props),
|
|
42
|
+
corsPreflight: {
|
|
43
|
+
allowOrigins: ['*'],
|
|
44
|
+
allowMethods: [CorsHttpMethod.ANY],
|
|
45
|
+
allowHeaders: ['*'],
|
|
46
|
+
maxAge: Duration.seconds(10),
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const apiUrl: string = Fn.join('', [this.api.apiId, '.execute-api.', service.props.regionName, '.amazonaws.com']);
|
|
51
|
+
|
|
52
|
+
params.cdnApiPrefab?.addApiGateway(params.basePath, apiUrl);
|
|
53
|
+
|
|
54
|
+
new CfnOutput(this, 'ApiUrl', { value: apiUrl });
|
|
55
|
+
}
|
|
56
|
+
public addPath(params: {
|
|
57
|
+
basePath: string;
|
|
58
|
+
path: string;
|
|
59
|
+
method: ApiDefinition<ApiInterface>['method'];
|
|
60
|
+
lambdaFunction: IFunction;
|
|
61
|
+
isPublic?: true;
|
|
62
|
+
}): void {
|
|
63
|
+
const path = params.path === '/' ? '' : params.path;
|
|
64
|
+
this.api.addRoutes({
|
|
65
|
+
path: `/${params.basePath}${path}`,
|
|
66
|
+
methods: [params.method as HttpMethod],
|
|
67
|
+
integration: new HttpLambdaIntegration(params.lambdaFunction.functionName, params.lambdaFunction),
|
|
68
|
+
...(params.isPublic ? {} : { authorizer: this.authorizer }),
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as awsApigateway from 'aws-cdk-lib/aws-apigateway';
|
|
2
|
+
import { CfnOutput, Fn } from 'aws-cdk-lib';
|
|
3
|
+
import { UserPool } from 'aws-cdk-lib/aws-cognito';
|
|
4
|
+
import { IFunction } from 'aws-cdk-lib/aws-lambda';
|
|
5
|
+
import { Construct } from 'constructs';
|
|
6
|
+
|
|
7
|
+
import { ServiceStack, getLogicalName, getResourceName } from '../../../common';
|
|
8
|
+
import { CdnApiPrefab } from '../../cdn';
|
|
9
|
+
|
|
10
|
+
export type ApiRestPrefabParams = {
|
|
11
|
+
basePath: string;
|
|
12
|
+
cdnApiPrefab?: CdnApiPrefab;
|
|
13
|
+
userPool?: UserPool;
|
|
14
|
+
customAuthorizerHandler?: IFunction;
|
|
15
|
+
stageName?: string;
|
|
16
|
+
stageVariables?: Record<string, string>;
|
|
17
|
+
httpProxyIntegrationUrl?: string;
|
|
18
|
+
apiKeyRequired?: boolean;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export class ApiRestPrefab extends Construct {
|
|
22
|
+
public readonly api: awsApigateway.RestApi;
|
|
23
|
+
public readonly authorizer!: awsApigateway.IAuthorizer;
|
|
24
|
+
public readonly basePath: awsApigateway.Resource;
|
|
25
|
+
|
|
26
|
+
constructor(service: ServiceStack, params: ApiRestPrefabParams) {
|
|
27
|
+
super(service, getLogicalName(ApiRestPrefab.name));
|
|
28
|
+
|
|
29
|
+
if (params.userPool) {
|
|
30
|
+
this.authorizer = new awsApigateway.CognitoUserPoolsAuthorizer(this, 'Authorizer', {
|
|
31
|
+
cognitoUserPools: [params.userPool],
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (params.customAuthorizerHandler) {
|
|
36
|
+
this.authorizer = new awsApigateway.RequestAuthorizer(this, 'LambdaAuthorizer', {
|
|
37
|
+
identitySources: ['$request.header.Authorization'],
|
|
38
|
+
handler: params.customAuthorizerHandler,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
this.api = new awsApigateway.RestApi(this, 'RestApi', {
|
|
43
|
+
restApiName: getResourceName('', service.props),
|
|
44
|
+
deploy: true,
|
|
45
|
+
deployOptions: {
|
|
46
|
+
tracingEnabled: true,
|
|
47
|
+
stageName: params.stageName || 'default',
|
|
48
|
+
variables: params.stageVariables,
|
|
49
|
+
},
|
|
50
|
+
defaultCorsPreflightOptions: {
|
|
51
|
+
allowOrigins: awsApigateway.Cors.ALL_ORIGINS,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const apiUrl: string = Fn.join('', [this.api.restApiId, '.execute-api.', service.props.regionName, '.amazonaws.com']);
|
|
56
|
+
|
|
57
|
+
this.basePath = this.api.root.resourceForPath(params.basePath);
|
|
58
|
+
|
|
59
|
+
if (params.httpProxyIntegrationUrl) {
|
|
60
|
+
const proxy = this.basePath.addProxy({ anyMethod: false });
|
|
61
|
+
|
|
62
|
+
proxy.addMethod(
|
|
63
|
+
'ANY',
|
|
64
|
+
new awsApigateway.HttpIntegration(params.httpProxyIntegrationUrl, {
|
|
65
|
+
httpMethod: 'ANY',
|
|
66
|
+
proxy: true,
|
|
67
|
+
options: { requestParameters: { 'integration.request.path.proxy': 'method.request.path.proxy' } },
|
|
68
|
+
}),
|
|
69
|
+
{ requestParameters: { 'method.request.path.proxy': true }, apiKeyRequired: params.apiKeyRequired }
|
|
70
|
+
);
|
|
71
|
+
// I'm sorry for this, but there isn't a better way to do this...
|
|
72
|
+
this.api.methods
|
|
73
|
+
.filter((method) => method.httpMethod === 'OPTIONS')
|
|
74
|
+
.forEach((m) => {
|
|
75
|
+
proxy.node.tryRemoveChild(m.node.id);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
proxy.addCorsPreflight({
|
|
79
|
+
allowOrigins: ['*'],
|
|
80
|
+
allowHeaders: ['*'],
|
|
81
|
+
allowMethods: awsApigateway.Cors.ALL_METHODS,
|
|
82
|
+
statusCode: 204,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (params.cdnApiPrefab)
|
|
87
|
+
params.cdnApiPrefab.addApiGateway(params.basePath, apiUrl, {
|
|
88
|
+
originPath: `/${this.api.deploymentStage.stageName}`,
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
new CfnOutput(this, 'RestApiUrl', { value: apiUrl });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
2
|
+
import 'reflect-metadata';
|
|
3
|
+
|
|
4
|
+
import * as appsync from 'aws-cdk-lib/aws-appsync';
|
|
5
|
+
import { CfnOutput } from 'aws-cdk-lib';
|
|
6
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
|
|
7
|
+
import { UserPool } from 'aws-cdk-lib/aws-cognito';
|
|
8
|
+
import { RetentionDays } from 'aws-cdk-lib/aws-logs';
|
|
9
|
+
import { CnameRecord, HostedZone } from 'aws-cdk-lib/aws-route53';
|
|
10
|
+
import { Construct } from 'constructs';
|
|
11
|
+
|
|
12
|
+
import { log } from 'console';
|
|
13
|
+
import path from 'path';
|
|
14
|
+
import { buildSchemaSync, NonEmptyArray } from 'type-graphql';
|
|
15
|
+
|
|
16
|
+
import { ServiceStack, getLogicalName, SynthError, getDomain, getResourceName } from '../../../common';
|
|
17
|
+
import { CdnApiPrefab } from '../../cdn';
|
|
18
|
+
import { EventBusPrefab } from '../../integration';
|
|
19
|
+
|
|
20
|
+
export type AppSyncPrefabParams = {
|
|
21
|
+
name: string;
|
|
22
|
+
baseFolder: string;
|
|
23
|
+
schemas: NonEmptyArray<Function>;
|
|
24
|
+
eventBusPrefab?: EventBusPrefab;
|
|
25
|
+
userPool?: UserPool;
|
|
26
|
+
cdnApiPrefab?: CdnApiPrefab;
|
|
27
|
+
domainConfig?: {
|
|
28
|
+
certificate: ICertificate;
|
|
29
|
+
subdomain: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export class AppSyncPrefab extends Construct {
|
|
34
|
+
public api: appsync.GraphqlApi;
|
|
35
|
+
public eventBridgeDataSource!: EventBridgeDataSource;
|
|
36
|
+
public schemas: NonEmptyArray<Function>;
|
|
37
|
+
|
|
38
|
+
constructor(service: ServiceStack, params: AppSyncPrefabParams) {
|
|
39
|
+
super(service, getLogicalName(AppSyncPrefab.name));
|
|
40
|
+
|
|
41
|
+
if (params.cdnApiPrefab && params.domainConfig) throw new SynthError('Cannot use cdnApi and custom domain at the same time');
|
|
42
|
+
|
|
43
|
+
this.schemas = params.schemas;
|
|
44
|
+
|
|
45
|
+
const defaultAuthorization: appsync.AuthorizationMode = params.userPool
|
|
46
|
+
? {
|
|
47
|
+
authorizationType: appsync.AuthorizationType.USER_POOL,
|
|
48
|
+
userPoolConfig: { userPool: params.userPool },
|
|
49
|
+
}
|
|
50
|
+
: { authorizationType: appsync.AuthorizationType.API_KEY };
|
|
51
|
+
|
|
52
|
+
const domainConfig: appsync.GraphqlApiProps['domainName'] = params.domainConfig
|
|
53
|
+
? {
|
|
54
|
+
certificate: params.domainConfig.certificate,
|
|
55
|
+
domainName: getDomain(params.domainConfig.subdomain, service.props),
|
|
56
|
+
}
|
|
57
|
+
: undefined;
|
|
58
|
+
|
|
59
|
+
log('<< Building GraphQL Schema >>');
|
|
60
|
+
const schemaPath = path.join(params.baseFolder, 'consolidated.graphql');
|
|
61
|
+
buildSchemaSync({
|
|
62
|
+
resolvers: this.schemas as NonEmptyArray<Function>,
|
|
63
|
+
emitSchemaFile: schemaPath,
|
|
64
|
+
});
|
|
65
|
+
log('<< GraphQL Schema Built >>');
|
|
66
|
+
|
|
67
|
+
this.api = new appsync.GraphqlApi(this, 'Api', {
|
|
68
|
+
name: getResourceName('', service.props),
|
|
69
|
+
schema: appsync.SchemaFile.fromAsset(schemaPath),
|
|
70
|
+
authorizationConfig: { defaultAuthorization },
|
|
71
|
+
domainName: domainConfig,
|
|
72
|
+
logConfig: {
|
|
73
|
+
fieldLogLevel: appsync.FieldLogLevel.ALL,
|
|
74
|
+
retention: RetentionDays.ONE_MONTH,
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
if (params.eventBusPrefab) {
|
|
79
|
+
this.eventBridgeDataSource = new EventBridgeDataSource(service, 'EventBridgeDataSource', {
|
|
80
|
+
name: 'EventBridgeDataSource',
|
|
81
|
+
api: this.api,
|
|
82
|
+
});
|
|
83
|
+
appsync.CfnDataSource;
|
|
84
|
+
const cfDs = this.eventBridgeDataSource.node.defaultChild as appsync.CfnDataSource;
|
|
85
|
+
cfDs.eventBridgeConfig = { eventBusArn: params.eventBusPrefab.bus.eventBusArn };
|
|
86
|
+
params.eventBusPrefab.bus.grantPutEventsTo(this.eventBridgeDataSource);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (params.domainConfig) {
|
|
90
|
+
const hostedZone = HostedZone.fromLookup(this, 'HostedZoneEnvDns', {
|
|
91
|
+
domainName: getDomain('', service.props),
|
|
92
|
+
});
|
|
93
|
+
new CnameRecord(service, 'Record', {
|
|
94
|
+
zone: hostedZone,
|
|
95
|
+
recordName: domainConfig?.domainName,
|
|
96
|
+
domainName: this.api.appSyncDomainName,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (params.cdnApiPrefab) {
|
|
100
|
+
params.cdnApiPrefab.addAppSync(this.api.graphqlUrl);
|
|
101
|
+
}
|
|
102
|
+
new CfnOutput(this, 'Domain', { value: domainConfig?.domainName || this.api.graphqlUrl });
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// addSchema(schema: Function) {
|
|
106
|
+
// if (!this.schemas) this.schemas = [];
|
|
107
|
+
// this.schemas.push(schema);
|
|
108
|
+
// }
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export class EventBridgeDataSource extends appsync.BackedDataSource {
|
|
112
|
+
constructor(scope: Construct, id: string, props: appsync.BackedDataSourceProps) {
|
|
113
|
+
super(scope, id, props, {
|
|
114
|
+
type: 'AMAZON_EVENTBRIDGE',
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import * as appsync from 'aws-cdk-lib/aws-appsync';
|
|
2
|
+
import { BaseDataSource } from 'aws-cdk-lib/aws-appsync';
|
|
3
|
+
import { Construct } from 'constructs';
|
|
4
|
+
|
|
5
|
+
import * as esbuild from 'esbuild';
|
|
6
|
+
import { readFileSync, writeFileSync } from 'fs';
|
|
7
|
+
|
|
8
|
+
import { AppSyncPrefab } from '.';
|
|
9
|
+
import { ServiceStack, getLogicalName, capFirstLetter, toDashCase } from '../../../common';
|
|
10
|
+
import { DynamoTablePrefab } from '../../database';
|
|
11
|
+
import { FunctionResolver } from './types';
|
|
12
|
+
|
|
13
|
+
type Resolver = {
|
|
14
|
+
typeName: string;
|
|
15
|
+
resolversPipeline?: { name: string; dataSource?: BaseDataSource }[];
|
|
16
|
+
env?: Record<string, string>;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type AppSyncResolverAggregateParams<T> = {
|
|
20
|
+
appSyncPrefab: AppSyncPrefab;
|
|
21
|
+
baseApiFolder: string;
|
|
22
|
+
tablePrefab: DynamoTablePrefab;
|
|
23
|
+
resolvers: Record<MethodNames<T>, Resolver>;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
27
|
+
type MethodNames<T> = { [K in keyof T]: T[K] extends Function ? K : never }[keyof T];
|
|
28
|
+
|
|
29
|
+
export class AppSyncResolverAggregate<T> extends Construct {
|
|
30
|
+
public readonly api!: appsync.GraphqlApi;
|
|
31
|
+
public readonly baseApiFolder!: string;
|
|
32
|
+
|
|
33
|
+
constructor(service: ServiceStack, params: AppSyncResolverAggregateParams<T>) {
|
|
34
|
+
super(service, getLogicalName(AppSyncResolverAggregate.name));
|
|
35
|
+
const { appSyncPrefab, baseApiFolder, resolvers, tablePrefab } = params;
|
|
36
|
+
|
|
37
|
+
const dataSource = new appsync.DynamoDbDataSource(service, getLogicalName('dynamoDataSource', tablePrefab.tableName), {
|
|
38
|
+
api: appSyncPrefab.api,
|
|
39
|
+
table: tablePrefab.table,
|
|
40
|
+
name: `${tablePrefab.tableName}TableDataSource`,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
Object.keys(resolvers).map((r) => {
|
|
44
|
+
const fieldName = r;
|
|
45
|
+
const resolver = resolvers[r as MethodNames<T>];
|
|
46
|
+
const fnPipeline =
|
|
47
|
+
resolver.resolversPipeline && resolver.resolversPipeline.length > 1
|
|
48
|
+
? resolver.resolversPipeline.map((rp) =>
|
|
49
|
+
this.functionResolver(service, {
|
|
50
|
+
api: appSyncPrefab.api,
|
|
51
|
+
baseApiFolder,
|
|
52
|
+
dataSource: rp.dataSource || dataSource,
|
|
53
|
+
fieldName: fieldName,
|
|
54
|
+
resolverName: rp.name,
|
|
55
|
+
env: resolver.env,
|
|
56
|
+
})
|
|
57
|
+
)
|
|
58
|
+
: [
|
|
59
|
+
this.functionResolver(service, {
|
|
60
|
+
api: appSyncPrefab.api,
|
|
61
|
+
dataSource,
|
|
62
|
+
baseApiFolder,
|
|
63
|
+
fieldName: fieldName,
|
|
64
|
+
env: resolver.env,
|
|
65
|
+
}),
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
// PipelineResolver
|
|
69
|
+
new appsync.Resolver(service, getLogicalName('pipeline', fieldName), {
|
|
70
|
+
api: appSyncPrefab.api,
|
|
71
|
+
typeName: resolver.typeName,
|
|
72
|
+
fieldName: fieldName,
|
|
73
|
+
pipelineConfig: fnPipeline,
|
|
74
|
+
code: appsync.Code.fromInline(`
|
|
75
|
+
// The before step
|
|
76
|
+
export function request() {
|
|
77
|
+
return {};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// The after step
|
|
81
|
+
export function response(ctx) {
|
|
82
|
+
return ctx.prev.result;
|
|
83
|
+
}
|
|
84
|
+
`),
|
|
85
|
+
runtime: appsync.FunctionRuntime.JS_1_0_0,
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
addDynamoTableDataSource = (tablePrefab: DynamoTablePrefab): appsync.DynamoDbDataSource => {
|
|
91
|
+
return this.api.addDynamoDbDataSource(tablePrefab.tableName, tablePrefab.table, {
|
|
92
|
+
name: `${tablePrefab.tableName}TableDataSource`,
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
functionResolver = (service: ServiceStack, params: FunctionResolver): appsync.AppsyncFunction => {
|
|
97
|
+
return new appsync.AppsyncFunction(
|
|
98
|
+
service,
|
|
99
|
+
getLogicalName('function', params.resolverName ? `${params.fieldName}${params.resolverName}` : params.fieldName),
|
|
100
|
+
{
|
|
101
|
+
api: params.api,
|
|
102
|
+
dataSource: params.dataSource,
|
|
103
|
+
name: params.resolverName ? `${params.fieldName}${capFirstLetter(params.resolverName)}` : params.fieldName,
|
|
104
|
+
code: bundleAppSyncResolver(params.baseApiFolder, params.fieldName, params.resolverName, params.env),
|
|
105
|
+
runtime: appsync.FunctionRuntime.JS_1_0_0,
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
const bundleAppSyncResolver = (
|
|
111
|
+
baseApiFolder: string,
|
|
112
|
+
fieldName: string,
|
|
113
|
+
resolverName = 'index',
|
|
114
|
+
env: Record<string, string> | undefined
|
|
115
|
+
): appsync.Code => {
|
|
116
|
+
const outFile = `cdk.out/resolvers/${toDashCase(fieldName)}/${resolverName}.js`;
|
|
117
|
+
esbuild.buildSync({
|
|
118
|
+
entryPoints: [`${baseApiFolder}/resolvers/${toDashCase(fieldName)}/${resolverName}.ts`],
|
|
119
|
+
external: ['@aws-appsync/utils'],
|
|
120
|
+
allowOverwrite: true,
|
|
121
|
+
outfile: outFile,
|
|
122
|
+
bundle: true,
|
|
123
|
+
write: true,
|
|
124
|
+
platform: 'node',
|
|
125
|
+
target: 'esnext',
|
|
126
|
+
format: 'esm',
|
|
127
|
+
sourcesContent: false,
|
|
128
|
+
// minify: true,
|
|
129
|
+
});
|
|
130
|
+
if (Object.keys(env || {}).length > 0) {
|
|
131
|
+
let mappedFile = readFileSync(outFile, 'utf8');
|
|
132
|
+
for (const [key, value] of Object.entries(env || {})) {
|
|
133
|
+
mappedFile = mappedFile.replace(new RegExp(key, 'gi'), value);
|
|
134
|
+
}
|
|
135
|
+
writeFileSync(outFile, mappedFile);
|
|
136
|
+
}
|
|
137
|
+
return appsync.Code.fromAsset(outFile);
|
|
138
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BaseDataSource, GraphqlApi } from 'aws-cdk-lib/aws-appsync';
|
|
2
|
+
|
|
3
|
+
import { DynamoTablePrefab } from '../../database';
|
|
4
|
+
import { EventBusPrefab } from '../../integration';
|
|
5
|
+
|
|
6
|
+
export type EventBridgeDataSourceParams = {
|
|
7
|
+
api: GraphqlApi;
|
|
8
|
+
eventBusPrefab: EventBusPrefab;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type ServiceResolver = {
|
|
12
|
+
api: GraphqlApi;
|
|
13
|
+
baseApiFolder: string;
|
|
14
|
+
tablePrefab: DynamoTablePrefab;
|
|
15
|
+
resolvers: {
|
|
16
|
+
fieldName: string;
|
|
17
|
+
typeName: 'Mutation' | 'Query' | 'Subscription';
|
|
18
|
+
resolversPipeline?: { name: string; dataSource?: BaseDataSource }[];
|
|
19
|
+
}[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type FunctionResolver = {
|
|
23
|
+
fieldName: string;
|
|
24
|
+
resolverName?: string;
|
|
25
|
+
baseApiFolder: string;
|
|
26
|
+
api: GraphqlApi;
|
|
27
|
+
dataSource: BaseDataSource;
|
|
28
|
+
env?: Record<string, string>;
|
|
29
|
+
};
|
package/prefab/index.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './analytics';
|
|
2
|
+
export * from './auth';
|
|
3
|
+
export * from './cdn';
|
|
4
|
+
export * from './compute';
|
|
5
|
+
export * from './database';
|
|
6
|
+
export * from './gateway';
|
|
7
|
+
export * from './integration';
|
|
8
|
+
export * from './networking';
|
|
9
|
+
export * from './storage';
|
|
10
|
+
export * from './utils';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { EventBus, IEventBus } from 'aws-cdk-lib/aws-events';
|
|
2
|
+
import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';
|
|
3
|
+
import { Construct } from 'constructs';
|
|
4
|
+
|
|
5
|
+
import { ServiceStack, getLogicalName, getResourceName, Modifier } from '../../../common';
|
|
6
|
+
|
|
7
|
+
export type EventBusPrefabParams = {
|
|
8
|
+
defaultEventBus?: true;
|
|
9
|
+
};
|
|
10
|
+
export class EventBusPrefab extends Construct {
|
|
11
|
+
public readonly bus: IEventBus;
|
|
12
|
+
|
|
13
|
+
constructor(service: ServiceStack, params?: EventBusPrefabParams) {
|
|
14
|
+
super(service, getLogicalName(EventBusPrefab.name));
|
|
15
|
+
|
|
16
|
+
if (params?.defaultEventBus) {
|
|
17
|
+
this.bus = EventBus.fromEventBusName(service, 'DefaultEventBus', 'default');
|
|
18
|
+
} else {
|
|
19
|
+
this.bus = new EventBus(this, 'bus', { eventBusName: getResourceName('', service.props) });
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Mods
|
|
24
|
+
public useMod(variableName = 'EVENT_BUS', mods: ((bus: IEventBus) => any)[]): Modifier {
|
|
25
|
+
return (lambda) => {
|
|
26
|
+
lambda.addEnvironment(variableName, this.bus.eventBusName);
|
|
27
|
+
mods.map((fn) => fn(this.bus)(lambda));
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Class Mods
|
|
32
|
+
public static modifier = {
|
|
33
|
+
writer: (bus: IEventBus): Modifier => {
|
|
34
|
+
return (lambda) => {
|
|
35
|
+
bus.grantPutEventsTo(lambda);
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// Instance Mods
|
|
41
|
+
public useModWriter(variableName = 'EVENT_BUS'): Modifier {
|
|
42
|
+
return this.useMod(variableName, [EventBusPrefab.modifier.writer]);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// addBus is used inside aggregates in order to apply permissions if EventBus is there.
|
|
46
|
+
public static addBus(lambdaFunction: NodejsFunction, eventBus?: IEventBus): void {
|
|
47
|
+
if (eventBus instanceof EventBus) {
|
|
48
|
+
eventBus.grantPutEventsTo(lambdaFunction);
|
|
49
|
+
lambdaFunction.addEnvironment('EVENT_BUS', eventBus.eventBusName);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|