@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,34 @@
|
|
|
1
|
+
import * as awsCloudfront from 'aws-cdk-lib/aws-cloudfront';
|
|
2
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
|
|
3
|
+
import { HttpOriginProps } from 'aws-cdk-lib/aws-cloudfront-origins';
|
|
4
|
+
import { ApplicationLoadBalancer } from 'aws-cdk-lib/aws-elasticloadbalancingv2';
|
|
5
|
+
import { Construct } from 'constructs';
|
|
6
|
+
import { ServiceStack } from '../../../common';
|
|
7
|
+
import { PublicAlbPrefab, ApiRestPrefab } from '../../gateway';
|
|
8
|
+
import { WafPrefab } from '../../networking';
|
|
9
|
+
export type CdnApiPrefabParams = {
|
|
10
|
+
subDomain: string;
|
|
11
|
+
certificate: ICertificate;
|
|
12
|
+
albDefaultBehavior?: PublicAlbPrefab;
|
|
13
|
+
restApiDefaultBehavior?: ApiRestPrefab;
|
|
14
|
+
headersWhitelist?: string[];
|
|
15
|
+
waf?: WafPrefab;
|
|
16
|
+
skipRecord?: true;
|
|
17
|
+
explicitDomains?: string[];
|
|
18
|
+
cachePolicyProps?: Omit<awsCloudfront.CachePolicyProps, 'cachePolicyName' | 'headerBehavior' | 'queryStringBehavior'>;
|
|
19
|
+
};
|
|
20
|
+
export declare class CdnApiPrefab extends Construct {
|
|
21
|
+
readonly domain: string;
|
|
22
|
+
readonly baseUrl: string;
|
|
23
|
+
private readonly service;
|
|
24
|
+
private readonly distribution;
|
|
25
|
+
private readonly apiGatewayRequestPolicy;
|
|
26
|
+
private readonly apiGatewayCachePolicy;
|
|
27
|
+
private readonly apiGatewayBehaviorOptions;
|
|
28
|
+
private readonly unrestrictedBehaviorOptions;
|
|
29
|
+
constructor(service: ServiceStack, params: CdnApiPrefabParams);
|
|
30
|
+
addApiGateway(basePath: string, apiUrl: string, originOptions?: HttpOriginProps): void;
|
|
31
|
+
addAppSync(apiUrl: string, originOptions?: HttpOriginProps): void;
|
|
32
|
+
addAlb(basePath: string, alb: ApplicationLoadBalancer): void;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../prefab/cdn/cdn-api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAc,eAAe,EAAuC,MAAM,oCAAoC,CAAC;AACtH,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAGjF,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,YAAY,EAA6E,MAAM,iBAAiB,CAAC;AAC1H,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,YAAY,CAAC;IAC1B,kBAAkB,CAAC,EAAE,eAAe,CAAC;IACrC,sBAAsB,CAAC,EAAE,aAAa,CAAC;IACvC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,gBAAgB,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,qBAAqB,CAAC,CAAC;CACvH,CAAC;AAEF,qBAAa,YAAa,SAAQ,SAAS;IACzC,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,OAAO,EAAE,MAAM,CAAC;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;IACvC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6B;IAC1D,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAoC;IAC5E,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAA4B;IAClE,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAgD;IAC1F,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAgD;gBAEhF,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,kBAAkB;IA0GtD,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,eAAe,GAAG,IAAI;IAQtF,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,eAAe,GAAG,IAAI;IAWjE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,uBAAuB,GAAG,IAAI;CAOpE"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.CdnApiPrefab = void 0;
|
|
27
|
+
const awsCloudfront = __importStar(require("aws-cdk-lib/aws-cloudfront"));
|
|
28
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
29
|
+
const aws_cloudfront_origins_1 = require("aws-cdk-lib/aws-cloudfront-origins");
|
|
30
|
+
const aws_route53_1 = require("aws-cdk-lib/aws-route53");
|
|
31
|
+
const aws_route53_targets_1 = require("aws-cdk-lib/aws-route53-targets");
|
|
32
|
+
const constructs_1 = require("constructs");
|
|
33
|
+
const common_1 = require("../../../common");
|
|
34
|
+
const storage_1 = require("../../storage");
|
|
35
|
+
class CdnApiPrefab extends constructs_1.Construct {
|
|
36
|
+
domain;
|
|
37
|
+
baseUrl;
|
|
38
|
+
service;
|
|
39
|
+
distribution;
|
|
40
|
+
apiGatewayRequestPolicy;
|
|
41
|
+
apiGatewayCachePolicy;
|
|
42
|
+
apiGatewayBehaviorOptions;
|
|
43
|
+
unrestrictedBehaviorOptions;
|
|
44
|
+
constructor(service, params) {
|
|
45
|
+
super(service, (0, common_1.getLogicalName)(CdnApiPrefab.name, params.subDomain));
|
|
46
|
+
this.service = service;
|
|
47
|
+
this.domain = (0, common_1.getDomain)(params.subDomain, service.props);
|
|
48
|
+
this.baseUrl = `https://${this.domain}/`;
|
|
49
|
+
if (params.albDefaultBehavior && params.restApiDefaultBehavior)
|
|
50
|
+
throw new common_1.SynthError('Only alb or api can be default behavior', service.props);
|
|
51
|
+
// Api Gateway Policies
|
|
52
|
+
this.apiGatewayCachePolicy = new awsCloudfront.CachePolicy(this, 'CachePolicy', {
|
|
53
|
+
cachePolicyName: (0, common_1.getCloudFrontName)('ApiGateway', 'CachePolicy', this.service.props),
|
|
54
|
+
queryStringBehavior: awsCloudfront.CacheQueryStringBehavior.all(),
|
|
55
|
+
headerBehavior: {
|
|
56
|
+
behavior: 'whitelist',
|
|
57
|
+
headers: [...(params.headersWhitelist || []), 'Authorization'],
|
|
58
|
+
},
|
|
59
|
+
...params.cachePolicyProps,
|
|
60
|
+
});
|
|
61
|
+
this.apiGatewayRequestPolicy = new awsCloudfront.OriginRequestPolicy(this, 'OriginRequestPolicy', {
|
|
62
|
+
originRequestPolicyName: (0, common_1.getCloudFrontName)('ApiGateway', 'RequestPolicy', this.service.props),
|
|
63
|
+
headerBehavior: {
|
|
64
|
+
behavior: 'whitelist',
|
|
65
|
+
headers: [
|
|
66
|
+
...(params.headersWhitelist || []),
|
|
67
|
+
'Access-Control-Allow-Origin',
|
|
68
|
+
'Access-Control-Request-Method',
|
|
69
|
+
'Access-Control-Allow-Headers',
|
|
70
|
+
'Access-Control-Request-Headers',
|
|
71
|
+
'Origin',
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
queryStringBehavior: awsCloudfront.OriginRequestQueryStringBehavior.all(),
|
|
75
|
+
});
|
|
76
|
+
this.apiGatewayBehaviorOptions = {
|
|
77
|
+
compress: true,
|
|
78
|
+
cachePolicy: this.apiGatewayCachePolicy,
|
|
79
|
+
originRequestPolicy: this.apiGatewayRequestPolicy,
|
|
80
|
+
allowedMethods: awsCloudfront.AllowedMethods.ALLOW_ALL,
|
|
81
|
+
viewerProtocolPolicy: awsCloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
82
|
+
};
|
|
83
|
+
// Integrations Policies
|
|
84
|
+
this.unrestrictedBehaviorOptions = {
|
|
85
|
+
compress: true,
|
|
86
|
+
cachePolicy: awsCloudfront.CachePolicy.CACHING_DISABLED,
|
|
87
|
+
originRequestPolicy: awsCloudfront.OriginRequestPolicy.ALL_VIEWER,
|
|
88
|
+
allowedMethods: awsCloudfront.AllowedMethods.ALLOW_ALL,
|
|
89
|
+
viewerProtocolPolicy: awsCloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
90
|
+
};
|
|
91
|
+
// Default Behavior
|
|
92
|
+
let defaultBehavior = {
|
|
93
|
+
origin: new aws_cloudfront_origins_1.HttpOrigin(new storage_1.PrivateBucketPrefab(service, { bucketName: 'default-origin' }).bucket.bucketDomainName, {
|
|
94
|
+
originId: (0, common_1.getCloudFrontName)('Origin', 'Default', this.service.props),
|
|
95
|
+
}),
|
|
96
|
+
...this.apiGatewayBehaviorOptions,
|
|
97
|
+
};
|
|
98
|
+
if (params.albDefaultBehavior) {
|
|
99
|
+
defaultBehavior = {
|
|
100
|
+
origin: new aws_cloudfront_origins_1.LoadBalancerV2Origin(params.albDefaultBehavior.alb, {
|
|
101
|
+
originId: (0, common_1.getCloudFrontName)('Origin', 'Default', this.service.props),
|
|
102
|
+
}),
|
|
103
|
+
...this.unrestrictedBehaviorOptions,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
if (params.restApiDefaultBehavior) {
|
|
107
|
+
defaultBehavior = {
|
|
108
|
+
origin: new aws_cloudfront_origins_1.RestApiOrigin(params.restApiDefaultBehavior.api, {
|
|
109
|
+
originId: (0, common_1.getCloudFrontName)('Origin', 'Default', this.service.props),
|
|
110
|
+
}),
|
|
111
|
+
...this.unrestrictedBehaviorOptions,
|
|
112
|
+
originRequestPolicy: awsCloudfront.OriginRequestPolicy.ALL_VIEWER_EXCEPT_HOST_HEADER,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
// Distribution
|
|
116
|
+
this.distribution = new awsCloudfront.Distribution(this, 'Distribution', {
|
|
117
|
+
enabled: true,
|
|
118
|
+
comment: (0, common_1.getResourceName)('cdn', service.props),
|
|
119
|
+
certificate: params.certificate,
|
|
120
|
+
domainNames: params.explicitDomains ?? [this.domain],
|
|
121
|
+
defaultBehavior,
|
|
122
|
+
...(service.props.envName !== 'prod' ? { priceClass: awsCloudfront.PriceClass.PRICE_CLASS_100 } : {}),
|
|
123
|
+
webAclId: params.waf?.webACL?.attrArn,
|
|
124
|
+
});
|
|
125
|
+
// Route53
|
|
126
|
+
if (!params.explicitDomains && !params.skipRecord) {
|
|
127
|
+
const hostedZone = aws_route53_1.HostedZone.fromLookup(this, 'HostedZoneEnvDns', { domainName: (0, common_1.getDomain)('', service.props) });
|
|
128
|
+
new aws_route53_1.ARecord(service, 'Record', {
|
|
129
|
+
zone: hostedZone,
|
|
130
|
+
target: aws_route53_1.RecordTarget.fromAlias(new aws_route53_targets_1.CloudFrontTarget(this.distribution)),
|
|
131
|
+
recordName: this.domain,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
new aws_cdk_lib_1.CfnOutput(this, 'Domain', { value: params.explicitDomains ? params.explicitDomains[0] : this.domain });
|
|
135
|
+
new aws_cdk_lib_1.CfnOutput(this, 'BaseUrl', {
|
|
136
|
+
value: params.explicitDomains ? `https://${params.explicitDomains[0]}/` : this.baseUrl,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
addApiGateway(basePath, apiUrl, originOptions) {
|
|
140
|
+
this.distribution.addBehavior(`/${basePath}*`, new aws_cloudfront_origins_1.HttpOrigin(apiUrl, { originId: (0, common_1.getCloudFrontName)('Origin', basePath, this.service.props), ...originOptions }), this.apiGatewayBehaviorOptions);
|
|
141
|
+
}
|
|
142
|
+
addAppSync(apiUrl, originOptions) {
|
|
143
|
+
this.distribution.addBehavior('/graphql*', new aws_cloudfront_origins_1.HttpOrigin(aws_cdk_lib_1.Fn.select(2, aws_cdk_lib_1.Fn.split('/', apiUrl)), {
|
|
144
|
+
originId: (0, common_1.getCloudFrontName)('Origin', 'graphql', this.service.props),
|
|
145
|
+
...originOptions,
|
|
146
|
+
}), this.apiGatewayBehaviorOptions);
|
|
147
|
+
}
|
|
148
|
+
addAlb(basePath, alb) {
|
|
149
|
+
this.distribution.addBehavior(`/${basePath}/*`, new aws_cloudfront_origins_1.LoadBalancerV2Origin(alb, { originId: (0, common_1.getCloudFrontName)('Origin', basePath, this.service.props) }), this.unrestrictedBehaviorOptions);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
exports.CdnApiPrefab = CdnApiPrefab;
|
|
153
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../prefab/cdn/cdn-api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAA4D;AAC5D,6CAA4C;AAE5C,+EAAsH;AAEtH,yDAA4E;AAC5E,yEAAmE;AACnE,2CAAuC;AAEvC,4CAA0H;AAG1H,2CAAoD;AAcpD,MAAa,YAAa,SAAQ,sBAAS;IACzB,MAAM,CAAS;IACf,OAAO,CAAS;IACf,OAAO,CAAe;IACtB,YAAY,CAA6B;IACzC,uBAAuB,CAAoC;IAC3D,qBAAqB,CAA4B;IACjD,yBAAyB,CAAgD;IACzE,2BAA2B,CAAgD;IAE5F,YAAY,OAAqB,EAAE,MAA0B;QAC3D,KAAK,CAAC,OAAO,EAAE,IAAA,uBAAc,EAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;QAEpE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,IAAA,kBAAS,EAAC,MAAM,CAAC,SAAS,EA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EM,MAAM,CAAC,QAAgB,EAAE,GAA4B;QAC1D,IAAI,CAAC,YAAY,CAAC,WAAW,CAC3B,IAAI,QAAQ,IAAI,EAChB,IAAI,6CAAoB,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAA,0BAAiB,EAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,EACtG,IAAI,CAAC,2BAA2B,CACjC,CAAC;IACJ,CAAC;CACF;AA9ID,oCA8IC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as awsCloudfront from 'aws-cdk-lib/aws-cloudfront';
|
|
2
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
|
|
3
|
+
import { Construct } from 'constructs';
|
|
4
|
+
import { ServiceStack } from '../../../common';
|
|
5
|
+
import { WafPrefab } from '../../networking';
|
|
6
|
+
import { AssetBucketParams, AssetBucketPrefab } from '../../storage';
|
|
7
|
+
export type CdnAssetConstructProps = {
|
|
8
|
+
subDomain: string;
|
|
9
|
+
certificate: ICertificate;
|
|
10
|
+
assetBucketProps: AssetBucketParams;
|
|
11
|
+
waf?: WafPrefab;
|
|
12
|
+
skipRecord?: true;
|
|
13
|
+
explicitDomains?: string[];
|
|
14
|
+
distributionProps?: Partial<awsCloudfront.DistributionProps>;
|
|
15
|
+
};
|
|
16
|
+
export declare class CdnAssetPrefab extends Construct {
|
|
17
|
+
readonly bucketPrefab: AssetBucketPrefab;
|
|
18
|
+
readonly domain: string;
|
|
19
|
+
readonly baseUrl: string;
|
|
20
|
+
readonly distribution: awsCloudfront.Distribution;
|
|
21
|
+
readonly behaviorOptions: Omit<awsCloudfront.BehaviorOptions, 'origin'>;
|
|
22
|
+
constructor(service: ServiceStack, params: CdnAssetConstructProps);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../prefab/cdn/cdn-asset/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAKlE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAiE,MAAM,iBAAiB,CAAC;AAC9G,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAErE,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,YAAY,CAAC;IAC1B,gBAAgB,EAAE,iBAAiB,CAAC;IACpC,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;CAC9D,CAAC;AAEF,qBAAa,cAAe,SAAQ,SAAS;IAC3C,SAAgB,YAAY,EAAE,iBAAiB,CAAC;IAChD,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,OAAO,EAAE,MAAM,CAAC;IAChC,SAAgB,YAAY,EAAE,aAAa,CAAC,YAAY,CAAC;IACzD,SAAgB,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;gBAEnE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,sBAAsB;CA0DlE"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.CdnAssetPrefab = void 0;
|
|
27
|
+
const awsCloudfront = __importStar(require("aws-cdk-lib/aws-cloudfront"));
|
|
28
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
29
|
+
const aws_cloudfront_origins_1 = require("aws-cdk-lib/aws-cloudfront-origins");
|
|
30
|
+
const aws_route53_1 = require("aws-cdk-lib/aws-route53");
|
|
31
|
+
const aws_route53_targets_1 = require("aws-cdk-lib/aws-route53-targets");
|
|
32
|
+
const aws_s3_1 = require("aws-cdk-lib/aws-s3");
|
|
33
|
+
const constructs_1 = require("constructs");
|
|
34
|
+
const common_1 = require("../../../common");
|
|
35
|
+
const storage_1 = require("../../storage");
|
|
36
|
+
class CdnAssetPrefab extends constructs_1.Construct {
|
|
37
|
+
bucketPrefab;
|
|
38
|
+
domain;
|
|
39
|
+
baseUrl;
|
|
40
|
+
distribution;
|
|
41
|
+
behaviorOptions;
|
|
42
|
+
constructor(service, params) {
|
|
43
|
+
super(service, (0, common_1.getLogicalName)(CdnAssetPrefab.name, params.subDomain));
|
|
44
|
+
this.domain = (0, common_1.getDomain)(params.subDomain, service.props);
|
|
45
|
+
this.baseUrl = `https://${this.domain}/`;
|
|
46
|
+
this.bucketPrefab = new storage_1.AssetBucketPrefab(service, {
|
|
47
|
+
...params.assetBucketProps,
|
|
48
|
+
bucketProps: {
|
|
49
|
+
cors: [{ allowedMethods: [aws_s3_1.HttpMethods.GET, aws_s3_1.HttpMethods.POST], allowedOrigins: ['*'], allowedHeaders: ['*'] }],
|
|
50
|
+
...params.assetBucketProps?.bucketProps,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
this.behaviorOptions = {
|
|
54
|
+
compress: true,
|
|
55
|
+
originRequestPolicy: new awsCloudfront.OriginRequestPolicy(this, 'OriginRequestPolicy', {
|
|
56
|
+
originRequestPolicyName: (0, common_1.getCloudFrontName)('Bucket', 'RequestPolicy', service.props),
|
|
57
|
+
headerBehavior: {
|
|
58
|
+
behavior: 'whitelist',
|
|
59
|
+
headers: ['Access-Control-Allow-Origin', 'Access-Control-Allow-Headers', 'Origin'],
|
|
60
|
+
},
|
|
61
|
+
}),
|
|
62
|
+
cachePolicy: awsCloudfront.CachePolicy.CACHING_OPTIMIZED,
|
|
63
|
+
allowedMethods: awsCloudfront.AllowedMethods.ALLOW_ALL,
|
|
64
|
+
viewerProtocolPolicy: awsCloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
65
|
+
};
|
|
66
|
+
this.distribution = new awsCloudfront.Distribution(this, 'Distribution', {
|
|
67
|
+
enabled: true,
|
|
68
|
+
comment: (0, common_1.getResourceName)('cdn', service.props),
|
|
69
|
+
certificate: params.certificate,
|
|
70
|
+
domainNames: params.explicitDomains ?? [this.domain],
|
|
71
|
+
defaultBehavior: {
|
|
72
|
+
origin: new aws_cloudfront_origins_1.S3Origin(this.bucketPrefab.bucket, {
|
|
73
|
+
originId: (0, common_1.getCloudFrontName)('Origin', 'Default', service.props),
|
|
74
|
+
}),
|
|
75
|
+
...this.behaviorOptions,
|
|
76
|
+
},
|
|
77
|
+
...(service.props.envName !== 'prod' ? { priceClass: awsCloudfront.PriceClass.PRICE_CLASS_100 } : {}),
|
|
78
|
+
webAclId: params.waf?.webACL?.attrArn,
|
|
79
|
+
...params.distributionProps,
|
|
80
|
+
});
|
|
81
|
+
if (!params.explicitDomains || !params.skipRecord) {
|
|
82
|
+
const hostedZone = aws_route53_1.HostedZone.fromLookup(this, 'HostedZoneEnvDns', { domainName: (0, common_1.getDomain)('', service.props) });
|
|
83
|
+
new aws_route53_1.ARecord(service, 'Record', {
|
|
84
|
+
zone: hostedZone,
|
|
85
|
+
target: aws_route53_1.RecordTarget.fromAlias(new aws_route53_targets_1.CloudFrontTarget(this.distribution)),
|
|
86
|
+
recordName: this.domain,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
new aws_cdk_lib_1.CfnOutput(this, 'Domain', { value: params.explicitDomains ? params.explicitDomains[0] : this.domain });
|
|
90
|
+
new aws_cdk_lib_1.CfnOutput(this, 'BaseUrl', {
|
|
91
|
+
value: params.explicitDomains ? `https://${params.explicitDomains[0]}/` : this.baseUrl,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.CdnAssetPrefab = CdnAssetPrefab;
|
|
96
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../prefab/cdn/cdn-asset/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAA4D;AAC5D,6CAAwC;AAExC,+EAA8D;AAC9D,yDAA4E;AAC5E,yEAAmE;AACnE,+CAAiD;AACjD,2CAAuC;AAEvC,4CAA8G;AAE9G,2CAAqE;AAYrE,MAAa,cAAe,SAA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AAS,CAAC,IAAI,sCAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBACvE,UAAU,EAAE,IAAI,CAAC,MAAM;aACxB,CAAC,CAAC;QACL,CAAC;QAED,IAAI,uBAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QAC5G,IAAI,uBAAS,CAAC,IAAI,EAAE,SAAS,EAAE;YAC7B,KAAK,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO;SACvF,CAAC,CAAC;IACL,CAAC;CACF;AAjED,wCAiEC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
|
|
2
|
+
import { Construct } from 'constructs';
|
|
3
|
+
import { ServiceStack } from '../../../common';
|
|
4
|
+
import { WafPrefab } from '../../networking';
|
|
5
|
+
export type SpaPrefabParams = {
|
|
6
|
+
subDomain: string;
|
|
7
|
+
certificate: ICertificate;
|
|
8
|
+
assetMaxAge?: string;
|
|
9
|
+
indexMaxAge?: string;
|
|
10
|
+
baseDir?: string;
|
|
11
|
+
distDir?: string;
|
|
12
|
+
calculatedSecrets?: Record<string, string>;
|
|
13
|
+
waf?: WafPrefab;
|
|
14
|
+
skipRecord?: true;
|
|
15
|
+
wwwRedirectEnabled?: true;
|
|
16
|
+
explicitDomains?: string[];
|
|
17
|
+
};
|
|
18
|
+
export declare class SpaPrefab extends Construct {
|
|
19
|
+
private readonly domain;
|
|
20
|
+
private readonly baseUrl;
|
|
21
|
+
private readonly distribution;
|
|
22
|
+
constructor(service: ServiceStack, params: SpaPrefabParams);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../prefab/cdn/cdn-spa/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAMlE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,YAAY,EAA6E,MAAM,iBAAiB,CAAC;AAC1H,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAI7C,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,YAAY,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,kBAAkB,CAAC,EAAE,IAAI,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAEF,qBAAa,SAAU,SAAQ,SAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6B;gBAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe;CAqG3D"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.SpaPrefab = void 0;
|
|
27
|
+
const awsCloudfront = __importStar(require("aws-cdk-lib/aws-cloudfront"));
|
|
28
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
29
|
+
const aws_cloudfront_origins_1 = require("aws-cdk-lib/aws-cloudfront-origins");
|
|
30
|
+
const aws_route53_1 = require("aws-cdk-lib/aws-route53");
|
|
31
|
+
const aws_route53_targets_1 = require("aws-cdk-lib/aws-route53-targets");
|
|
32
|
+
const aws_s3_1 = require("aws-cdk-lib/aws-s3");
|
|
33
|
+
const aws_ssm_1 = require("aws-cdk-lib/aws-ssm");
|
|
34
|
+
const constructs_1 = require("constructs");
|
|
35
|
+
const common_1 = require("../../../common");
|
|
36
|
+
const storage_1 = require("../../storage");
|
|
37
|
+
const utils_1 = require("../../utils");
|
|
38
|
+
class SpaPrefab extends constructs_1.Construct {
|
|
39
|
+
domain;
|
|
40
|
+
baseUrl;
|
|
41
|
+
distribution;
|
|
42
|
+
constructor(service, params) {
|
|
43
|
+
super(service, (0, common_1.getLogicalName)(SpaPrefab.name, params.subDomain));
|
|
44
|
+
this.domain = (0, common_1.getDomain)(params.subDomain, service.props);
|
|
45
|
+
this.baseUrl = `https://${this.domain}/`;
|
|
46
|
+
const privateBucketPrefab = new storage_1.PrivateBucketPrefab(service, {
|
|
47
|
+
bucketName: 'spawebapp',
|
|
48
|
+
bucketProps: {
|
|
49
|
+
autoDeleteObjects: true,
|
|
50
|
+
removalPolicy: aws_cdk_lib_1.RemovalPolicy.DESTROY,
|
|
51
|
+
cors: [
|
|
52
|
+
{
|
|
53
|
+
allowedMethods: [aws_s3_1.HttpMethods.GET, aws_s3_1.HttpMethods.HEAD],
|
|
54
|
+
allowedOrigins: ['*'],
|
|
55
|
+
allowedHeaders: ['*'],
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
const behaviorOptions = {
|
|
61
|
+
compress: true,
|
|
62
|
+
origin: new aws_cloudfront_origins_1.S3Origin(privateBucketPrefab.bucket, {
|
|
63
|
+
originId: (0, common_1.getCloudFrontName)('Origin', 'Default', service.props),
|
|
64
|
+
}),
|
|
65
|
+
originRequestPolicy: new awsCloudfront.OriginRequestPolicy(this, 'OriginRequestPolicy', {
|
|
66
|
+
originRequestPolicyName: (0, common_1.getCloudFrontName)('Bucket', 'RequestPolicy', service.props),
|
|
67
|
+
headerBehavior: {
|
|
68
|
+
behavior: 'whitelist',
|
|
69
|
+
headers: ['Access-Control-Allow-Origin', 'Access-Control-Allow-Headers', 'Origin'],
|
|
70
|
+
},
|
|
71
|
+
}),
|
|
72
|
+
cachePolicy: awsCloudfront.CachePolicy.CACHING_OPTIMIZED,
|
|
73
|
+
cachedMethods: awsCloudfront.AllowedMethods.ALLOW_GET_HEAD_OPTIONS,
|
|
74
|
+
allowedMethods: awsCloudfront.AllowedMethods.ALLOW_GET_HEAD_OPTIONS,
|
|
75
|
+
viewerProtocolPolicy: awsCloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
76
|
+
};
|
|
77
|
+
const domains = [this.domain];
|
|
78
|
+
if (params.wwwRedirectEnabled) {
|
|
79
|
+
if (params.subDomain)
|
|
80
|
+
throw new common_1.SynthError('wwwRedirectEnabled is only allowed in the root domain', service.props);
|
|
81
|
+
domains.push(`www.${this.domain}`);
|
|
82
|
+
}
|
|
83
|
+
this.distribution = new awsCloudfront.Distribution(this, 'Distribution', {
|
|
84
|
+
enabled: true,
|
|
85
|
+
comment: (0, common_1.getResourceName)('cdn', service.props),
|
|
86
|
+
certificate: params.certificate,
|
|
87
|
+
domainNames: params.explicitDomains ?? domains,
|
|
88
|
+
defaultRootObject: 'index.html',
|
|
89
|
+
errorResponses: [
|
|
90
|
+
{
|
|
91
|
+
httpStatus: 403,
|
|
92
|
+
responseHttpStatus: 200,
|
|
93
|
+
ttl: aws_cdk_lib_1.Duration.seconds(86400),
|
|
94
|
+
responsePagePath: '/index.html',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
httpStatus: 404,
|
|
98
|
+
responseHttpStatus: 200,
|
|
99
|
+
responsePagePath: '/index.html',
|
|
100
|
+
ttl: aws_cdk_lib_1.Duration.seconds(86400),
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
defaultBehavior: behaviorOptions,
|
|
104
|
+
...(service.props.envName !== 'prod' ? { priceClass: awsCloudfront.PriceClass.PRICE_CLASS_100 } : {}),
|
|
105
|
+
webAclId: params.waf?.webACL?.attrArn,
|
|
106
|
+
});
|
|
107
|
+
if (!params.explicitDomains && !params.skipRecord) {
|
|
108
|
+
const hostedZone = aws_route53_1.HostedZone.fromLookup(this, 'HostedZoneEnvDns', { domainName: (0, common_1.getDomain)('', service.props) });
|
|
109
|
+
domains.map((d) => {
|
|
110
|
+
new aws_route53_1.ARecord(service, d.split('.')[0], {
|
|
111
|
+
zone: hostedZone,
|
|
112
|
+
target: aws_route53_1.RecordTarget.fromAlias(new aws_route53_targets_1.CloudFrontTarget(this.distribution)),
|
|
113
|
+
recordName: d,
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
new utils_1.FrontendEnvBuilder(service, { ...params, name: params.subDomain });
|
|
118
|
+
new aws_ssm_1.StringParameter(this, 'Config', {
|
|
119
|
+
simpleName: true,
|
|
120
|
+
parameterName: (0, common_1.getResourceName)('config', service.props),
|
|
121
|
+
stringValue: JSON.stringify({
|
|
122
|
+
domain: params.explicitDomains ? params.explicitDomains[0] : this.domain,
|
|
123
|
+
bucketName: privateBucketPrefab.bucket.bucketName,
|
|
124
|
+
distributionId: this.distribution.distributionId,
|
|
125
|
+
assetMaxAge: params.assetMaxAge || '604800',
|
|
126
|
+
indexMaxAge: params.indexMaxAge || '1800',
|
|
127
|
+
baseDir: params.baseDir || `frontend/${service.props.serviceName}`,
|
|
128
|
+
distDir: params.distDir || 'build',
|
|
129
|
+
}),
|
|
130
|
+
});
|
|
131
|
+
new aws_cdk_lib_1.CfnOutput(this, 'Domain', { value: params.explicitDomains ? params.explicitDomains[0] : this.domain });
|
|
132
|
+
new aws_cdk_lib_1.CfnOutput(this, 'BaseUrl', {
|
|
133
|
+
value: params.explicitDomains ? `https://${params.explicitDomains[0]}/` : this.baseUrl,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
exports.SpaPrefab = SpaPrefab;
|
|
138
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../prefab/cdn/cdn-spa/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0EAA4D;AAC5D,6CAAiE;AAEjE,+EAA8D;AAC9D,yDAA4E;AAC5E,yEAAmE;AACnE,+CAAiD;AACjD,iDAAsD;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CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM;gBACxE,UAAU,EAAE,mBAAmB,CAAC,MAAM,CAAC,UAAU;gBACjD,cAAc,EAAE,IAAI,CAAC,YAAY,CAAC,cAAc;gBAChD,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,QAAQ;gBAC3C,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,MAAM;gBACzC,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,YAAY,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE;gBAClE,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,OAAO;aACnC,CAAC;SACH,CAAC,CAAC;QAEH,IAAI,uBAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QAC5G,IAAI,uBAAS,CAAC,IAAI,EAAE,SAAS,EAAE;YAC7B,KAAK,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO;SACvF,CAAC,CAAC;IACL,CAAC;CACF;AA1GD,8BA0GC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as awsCloudfront from 'aws-cdk-lib/aws-cloudfront';
|
|
2
|
+
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
3
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
|
|
4
|
+
import { Construct } from 'constructs';
|
|
5
|
+
import { ServiceStack } from '../../../common';
|
|
6
|
+
import { WafPrefab } from '../../networking';
|
|
7
|
+
import { PrivateBucketPrefab } from '../../storage';
|
|
8
|
+
export type SsrPrefabParams = {
|
|
9
|
+
subDomain: string;
|
|
10
|
+
certificate: ICertificate;
|
|
11
|
+
assetMaxAge?: string;
|
|
12
|
+
indexMaxAge?: string;
|
|
13
|
+
baseDir?: string;
|
|
14
|
+
distDir?: string;
|
|
15
|
+
calculatedSecrets?: Record<string, string>;
|
|
16
|
+
waf?: WafPrefab;
|
|
17
|
+
skipRecord?: true;
|
|
18
|
+
wwwRedirectEnabled?: true;
|
|
19
|
+
filesPathAssets: string;
|
|
20
|
+
filesPathNextFunction: string;
|
|
21
|
+
filesPathImageFunction: string;
|
|
22
|
+
};
|
|
23
|
+
export declare class SsrPrefab extends Construct {
|
|
24
|
+
readonly domain: string;
|
|
25
|
+
readonly baseUrl: string;
|
|
26
|
+
readonly distribution: awsCloudfront.Distribution;
|
|
27
|
+
readonly bucket: PrivateBucketPrefab;
|
|
28
|
+
readonly serverFunction: lambda.Function;
|
|
29
|
+
readonly imageFunction: lambda.Function;
|
|
30
|
+
constructor(service: ServiceStack, params: SsrPrefabParams);
|
|
31
|
+
protected createCloudFrontServerCachePolicy(): awsCloudfront.CachePolicy;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../prefab/cdn/cdn-ssr/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AASlE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAMvC,OAAO,EAAE,YAAY,EAAgF,MAAM,iBAAiB,CAAC;AAC7H,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGpD,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAA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