@takumi-stack/core 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/coordinator.d.ts +28 -0
- package/common/coordinator.d.ts.map +1 -0
- package/common/coordinator.js +94 -0
- package/common/coordinator.js.map +1 -0
- package/common/index.d.ts +6 -0
- package/common/index.d.ts.map +1 -0
- package/common/index.js +22 -0
- package/common/index.js.map +1 -0
- package/common/modifier.d.ts +5 -0
- package/common/modifier.d.ts.map +1 -0
- package/common/modifier.js +12 -0
- package/common/modifier.js.map +1 -0
- package/common/naming/get-deploy-config.d.ts +9 -0
- package/common/naming/get-deploy-config.d.ts.map +1 -0
- package/common/naming/get-deploy-config.js +8 -0
- package/common/naming/get-deploy-config.js.map +1 -0
- package/common/naming/get-domain.d.ts +9 -0
- package/common/naming/get-domain.d.ts.map +1 -0
- package/common/naming/get-domain.js +13 -0
- package/common/naming/get-domain.js.map +1 -0
- package/common/naming/get-function-entry.d.ts +4 -0
- package/common/naming/get-function-entry.d.ts.map +1 -0
- package/common/naming/get-function-entry.js +14 -0
- package/common/naming/get-function-entry.js.map +1 -0
- package/common/naming/get-logical-name.d.ts +2 -0
- package/common/naming/get-logical-name.d.ts.map +1 -0
- package/common/naming/get-logical-name.js +8 -0
- package/common/naming/get-logical-name.js.map +1 -0
- package/common/naming/get-resource-name.d.ts +47 -0
- package/common/naming/get-resource-name.d.ts.map +1 -0
- package/common/naming/get-resource-name.js +38 -0
- package/common/naming/get-resource-name.js.map +1 -0
- package/common/naming/get-service-name.d.ts +10 -0
- package/common/naming/get-service-name.d.ts.map +1 -0
- package/common/naming/get-service-name.js +10 -0
- package/common/naming/get-service-name.js.map +1 -0
- package/common/naming/index.d.ts +8 -0
- package/common/naming/index.d.ts.map +1 -0
- package/common/naming/index.js +24 -0
- package/common/naming/index.js.map +1 -0
- package/common/naming/string-parser.d.ts +4 -0
- package/common/naming/string-parser.d.ts.map +1 -0
- package/common/naming/string-parser.js +22 -0
- package/common/naming/string-parser.js.map +1 -0
- package/common/service.d.ts +29 -0
- package/common/service.d.ts.map +1 -0
- package/common/service.js +28 -0
- package/common/service.js.map +1 -0
- package/common/synth/account-mapping.d.ts +2 -0
- package/common/synth/account-mapping.d.ts.map +1 -0
- package/common/synth/account-mapping.js +18 -0
- package/common/synth/account-mapping.js.map +1 -0
- package/common/synth/assume-role.d.ts +18 -0
- package/common/synth/assume-role.d.ts.map +1 -0
- package/common/synth/assume-role.js +25 -0
- package/common/synth/assume-role.js.map +1 -0
- package/common/synth/get-global-props.d.ts +16 -0
- package/common/synth/get-global-props.d.ts.map +1 -0
- package/common/synth/get-global-props.js +34 -0
- package/common/synth/get-global-props.js.map +1 -0
- package/common/synth/get-service-props.d.ts +11 -0
- package/common/synth/get-service-props.d.ts.map +1 -0
- package/common/synth/get-service-props.js +12 -0
- package/common/synth/get-service-props.js.map +1 -0
- package/common/synth/index.d.ts +8 -0
- package/common/synth/index.d.ts.map +1 -0
- package/common/synth/index.js +24 -0
- package/common/synth/index.js.map +1 -0
- package/common/synth/pre-script.d.ts +32 -0
- package/common/synth/pre-script.d.ts.map +1 -0
- package/common/synth/pre-script.js +74 -0
- package/common/synth/pre-script.js.map +1 -0
- package/common/synth/props-types.d.ts +60 -0
- package/common/synth/props-types.d.ts.map +1 -0
- package/common/synth/props-types.js +3 -0
- package/common/synth/props-types.js.map +1 -0
- package/common/synth/synth-error.d.ts +8 -0
- package/common/synth/synth-error.d.ts.map +1 -0
- package/common/synth/synth-error.js +17 -0
- package/common/synth/synth-error.js.map +1 -0
- package/index.d.ts +4 -0
- package/index.d.ts.map +1 -0
- package/index.js +20 -0
- package/index.js.map +1 -0
- package/package.json +43 -0
- package/prefab/analytics/events/handlers/ingestion-transform/handler.d.ts +4 -0
- package/prefab/analytics/events/handlers/ingestion-transform/handler.d.ts.map +1 -0
- package/prefab/analytics/events/handlers/ingestion-transform/handler.js +34 -0
- package/prefab/analytics/events/handlers/ingestion-transform/handler.js.map +1 -0
- package/prefab/analytics/events/index.d.ts +31 -0
- package/prefab/analytics/events/index.d.ts.map +1 -0
- package/prefab/analytics/events/index.js +163 -0
- package/prefab/analytics/events/index.js.map +1 -0
- package/prefab/analytics/index.d.ts +2 -0
- package/prefab/analytics/index.d.ts.map +1 -0
- package/prefab/analytics/index.js +18 -0
- package/prefab/analytics/index.js.map +1 -0
- package/prefab/auth/cognito-pool/index.d.ts +65 -0
- package/prefab/auth/cognito-pool/index.d.ts.map +1 -0
- package/prefab/auth/cognito-pool/index.js +240 -0
- package/prefab/auth/cognito-pool/index.js.map +1 -0
- package/prefab/auth/index.d.ts +2 -0
- package/prefab/auth/index.d.ts.map +1 -0
- package/prefab/auth/index.js +18 -0
- package/prefab/auth/index.js.map +1 -0
- package/prefab/cdn/cdn-api/index.d.ts +38 -0
- package/prefab/cdn/cdn-api/index.d.ts.map +1 -0
- package/prefab/cdn/cdn-api/index.js +153 -0
- package/prefab/cdn/cdn-api/index.js.map +1 -0
- package/prefab/cdn/cdn-asset/index.d.ts +27 -0
- package/prefab/cdn/cdn-asset/index.d.ts.map +1 -0
- package/prefab/cdn/cdn-asset/index.js +96 -0
- package/prefab/cdn/cdn-asset/index.js.map +1 -0
- package/prefab/cdn/cdn-spa/index.d.ts +27 -0
- package/prefab/cdn/cdn-spa/index.d.ts.map +1 -0
- package/prefab/cdn/cdn-spa/index.js +138 -0
- package/prefab/cdn/cdn-spa/index.js.map +1 -0
- package/prefab/cdn/cdn-ssr/index.d.ts +36 -0
- package/prefab/cdn/cdn-ssr/index.d.ts.map +1 -0
- package/prefab/cdn/cdn-ssr/index.js +271 -0
- package/prefab/cdn/cdn-ssr/index.js.map +1 -0
- package/prefab/cdn/index.d.ts +5 -0
- package/prefab/cdn/index.d.ts.map +1 -0
- package/prefab/cdn/index.js +21 -0
- package/prefab/cdn/index.js.map +1 -0
- package/prefab/compute/fargate/cluster.d.ts +16 -0
- package/prefab/compute/fargate/cluster.d.ts.map +1 -0
- package/prefab/compute/fargate/cluster.js +42 -0
- package/prefab/compute/fargate/cluster.js.map +1 -0
- package/prefab/compute/fargate/index.d.ts +3 -0
- package/prefab/compute/fargate/index.d.ts.map +1 -0
- package/prefab/compute/fargate/index.js +19 -0
- package/prefab/compute/fargate/index.js.map +1 -0
- package/prefab/compute/fargate/service.d.ts +49 -0
- package/prefab/compute/fargate/service.d.ts.map +1 -0
- package/prefab/compute/fargate/service.js +109 -0
- package/prefab/compute/fargate/service.js.map +1 -0
- package/prefab/compute/function/api-function/api-aggregate.d.ts +32 -0
- package/prefab/compute/function/api-function/api-aggregate.d.ts.map +1 -0
- package/prefab/compute/function/api-function/api-aggregate.js +54 -0
- package/prefab/compute/function/api-function/api-aggregate.js.map +1 -0
- package/prefab/compute/function/api-function/api-function.d.ts +22 -0
- package/prefab/compute/function/api-function/api-function.d.ts.map +1 -0
- package/prefab/compute/function/api-function/api-function.js +45 -0
- package/prefab/compute/function/api-function/api-function.js.map +1 -0
- package/prefab/compute/function/api-function/index.d.ts +3 -0
- package/prefab/compute/function/api-function/index.d.ts.map +1 -0
- package/prefab/compute/function/api-function/index.js +19 -0
- package/prefab/compute/function/api-function/index.js.map +1 -0
- package/prefab/compute/function/base-function/index.d.ts +33 -0
- package/prefab/compute/function/base-function/index.d.ts.map +1 -0
- package/prefab/compute/function/base-function/index.js +70 -0
- package/prefab/compute/function/base-function/index.js.map +1 -0
- package/prefab/compute/function/cognito-function/cognito-aggregate.d.ts +18 -0
- package/prefab/compute/function/cognito-function/cognito-aggregate.d.ts.map +1 -0
- package/prefab/compute/function/cognito-function/cognito-aggregate.js +22 -0
- package/prefab/compute/function/cognito-function/cognito-aggregate.js.map +1 -0
- package/prefab/compute/function/cognito-function/cognito-function.d.ts +19 -0
- package/prefab/compute/function/cognito-function/cognito-function.d.ts.map +1 -0
- package/prefab/compute/function/cognito-function/cognito-function.js +24 -0
- package/prefab/compute/function/cognito-function/cognito-function.js.map +1 -0
- package/prefab/compute/function/cognito-function/index.d.ts +3 -0
- package/prefab/compute/function/cognito-function/index.d.ts.map +1 -0
- package/prefab/compute/function/cognito-function/index.js +19 -0
- package/prefab/compute/function/cognito-function/index.js.map +1 -0
- package/prefab/compute/function/cron-function/cron-aggregate.d.ts +17 -0
- package/prefab/compute/function/cron-function/cron-aggregate.d.ts.map +1 -0
- package/prefab/compute/function/cron-function/cron-aggregate.js +22 -0
- package/prefab/compute/function/cron-function/cron-aggregate.js.map +1 -0
- package/prefab/compute/function/cron-function/cron-function.d.ts +17 -0
- package/prefab/compute/function/cron-function/cron-function.d.ts.map +1 -0
- package/prefab/compute/function/cron-function/cron-function.js +24 -0
- package/prefab/compute/function/cron-function/cron-function.js.map +1 -0
- package/prefab/compute/function/cron-function/index.d.ts +3 -0
- package/prefab/compute/function/cron-function/index.d.ts.map +1 -0
- package/prefab/compute/function/cron-function/index.js +19 -0
- package/prefab/compute/function/cron-function/index.js.map +1 -0
- package/prefab/compute/function/event-function/event-aggregate.d.ts +20 -0
- package/prefab/compute/function/event-function/event-aggregate.d.ts.map +1 -0
- package/prefab/compute/function/event-function/event-aggregate.js +25 -0
- package/prefab/compute/function/event-function/event-aggregate.js.map +1 -0
- package/prefab/compute/function/event-function/event-function.d.ts +14 -0
- package/prefab/compute/function/event-function/event-function.d.ts.map +1 -0
- package/prefab/compute/function/event-function/event-function.js +33 -0
- package/prefab/compute/function/event-function/event-function.js.map +1 -0
- package/prefab/compute/function/event-function/index.d.ts +3 -0
- package/prefab/compute/function/event-function/index.d.ts.map +1 -0
- package/prefab/compute/function/event-function/index.js +19 -0
- package/prefab/compute/function/event-function/index.js.map +1 -0
- package/prefab/compute/function/index.d.ts +8 -0
- package/prefab/compute/function/index.d.ts.map +1 -0
- package/prefab/compute/function/index.js +24 -0
- package/prefab/compute/function/index.js.map +1 -0
- package/prefab/compute/function/queue-function/index.d.ts +25 -0
- package/prefab/compute/function/queue-function/index.d.ts.map +1 -0
- package/prefab/compute/function/queue-function/index.js +46 -0
- package/prefab/compute/function/queue-function/index.js.map +1 -0
- package/prefab/compute/function/topic-function/index.d.ts +23 -0
- package/prefab/compute/function/topic-function/index.d.ts.map +1 -0
- package/prefab/compute/function/topic-function/index.js +23 -0
- package/prefab/compute/function/topic-function/index.js.map +1 -0
- package/prefab/compute/index.d.ts +3 -0
- package/prefab/compute/index.d.ts.map +1 -0
- package/prefab/compute/index.js +19 -0
- package/prefab/compute/index.js.map +1 -0
- package/prefab/database/dynamo/index.d.ts +14 -0
- package/prefab/database/dynamo/index.d.ts.map +1 -0
- package/prefab/database/dynamo/index.js +106 -0
- package/prefab/database/dynamo/index.js.map +1 -0
- package/prefab/database/index.d.ts +4 -0
- package/prefab/database/index.d.ts.map +1 -0
- package/prefab/database/index.js +20 -0
- package/prefab/database/index.js.map +1 -0
- package/prefab/database/rds/handlers/start-cluster/handler.d.ts +2 -0
- package/prefab/database/rds/handlers/start-cluster/handler.d.ts.map +1 -0
- package/prefab/database/rds/handlers/start-cluster/handler.js +10 -0
- package/prefab/database/rds/handlers/start-cluster/handler.js.map +1 -0
- package/prefab/database/rds/handlers/stop-cluster/handler.d.ts +2 -0
- package/prefab/database/rds/handlers/stop-cluster/handler.d.ts.map +1 -0
- package/prefab/database/rds/handlers/stop-cluster/handler.js +10 -0
- package/prefab/database/rds/handlers/stop-cluster/handler.js.map +1 -0
- package/prefab/database/rds/index.d.ts +54 -0
- package/prefab/database/rds/index.d.ts.map +1 -0
- package/prefab/database/rds/index.js +223 -0
- package/prefab/database/rds/index.js.map +1 -0
- package/prefab/database/timestream/index.d.ts +3 -0
- package/prefab/database/timestream/index.d.ts.map +1 -0
- package/prefab/database/timestream/index.js +19 -0
- package/prefab/database/timestream/index.js.map +1 -0
- package/prefab/database/timestream/timestream-database.d.ts +13 -0
- package/prefab/database/timestream/timestream-database.d.ts.map +1 -0
- package/prefab/database/timestream/timestream-database.js +21 -0
- package/prefab/database/timestream/timestream-database.js.map +1 -0
- package/prefab/database/timestream/timestream-table.d.ts +23 -0
- package/prefab/database/timestream/timestream-table.d.ts.map +1 -0
- package/prefab/database/timestream/timestream-table.js +62 -0
- package/prefab/database/timestream/timestream-table.js.map +1 -0
- package/prefab/gateway/alb-public/index.d.ts +44 -0
- package/prefab/gateway/alb-public/index.d.ts.map +1 -0
- package/prefab/gateway/alb-public/index.js +116 -0
- package/prefab/gateway/alb-public/index.js.map +1 -0
- package/prefab/gateway/api-gateway/api-http.d.ts +27 -0
- package/prefab/gateway/api-gateway/api-http.d.ts.map +1 -0
- package/prefab/gateway/api-gateway/api-http.js +48 -0
- package/prefab/gateway/api-gateway/api-http.js.map +1 -0
- package/prefab/gateway/api-gateway/api-rest.d.ts +26 -0
- package/prefab/gateway/api-gateway/api-rest.d.ts.map +1 -0
- package/prefab/gateway/api-gateway/api-rest.js +90 -0
- package/prefab/gateway/api-gateway/api-rest.js.map +1 -0
- package/prefab/gateway/api-gateway/index.d.ts +3 -0
- package/prefab/gateway/api-gateway/index.d.ts.map +1 -0
- package/prefab/gateway/api-gateway/index.js +19 -0
- package/prefab/gateway/api-gateway/index.js.map +1 -0
- package/prefab/gateway/app-sync/index.d.ts +36 -0
- package/prefab/gateway/app-sync/index.d.ts.map +1 -0
- package/prefab/gateway/app-sync/index.js +114 -0
- package/prefab/gateway/app-sync/index.js.map +1 -0
- package/prefab/gateway/app-sync/resolver-aggregate.d.ts +33 -0
- package/prefab/gateway/app-sync/resolver-aggregate.d.ts.map +1 -0
- package/prefab/gateway/app-sync/resolver-aggregate.js +125 -0
- package/prefab/gateway/app-sync/resolver-aggregate.js.map +1 -0
- package/prefab/gateway/app-sync/types.d.ts +29 -0
- package/prefab/gateway/app-sync/types.d.ts.map +1 -0
- package/prefab/gateway/app-sync/types.js +3 -0
- package/prefab/gateway/app-sync/types.js.map +1 -0
- package/prefab/gateway/index.d.ts +4 -0
- package/prefab/gateway/index.d.ts.map +1 -0
- package/prefab/gateway/index.js +20 -0
- package/prefab/gateway/index.js.map +1 -0
- package/prefab/index.d.ts +11 -0
- package/prefab/index.d.ts.map +1 -0
- package/prefab/index.js +27 -0
- package/prefab/index.js.map +1 -0
- package/prefab/integration/event-bus/index.d.ts +20 -0
- package/prefab/integration/event-bus/index.d.ts.map +1 -0
- package/prefab/integration/event-bus/index.js +46 -0
- package/prefab/integration/event-bus/index.js.map +1 -0
- package/prefab/integration/index.d.ts +4 -0
- package/prefab/integration/index.d.ts.map +1 -0
- package/prefab/integration/index.js +20 -0
- package/prefab/integration/index.js.map +1 -0
- package/prefab/integration/queue/index.d.ts +29 -0
- package/prefab/integration/queue/index.d.ts.map +1 -0
- package/prefab/integration/queue/index.js +70 -0
- package/prefab/integration/queue/index.js.map +1 -0
- package/prefab/integration/topic/index.d.ts +21 -0
- package/prefab/integration/topic/index.d.ts.map +1 -0
- package/prefab/integration/topic/index.js +48 -0
- package/prefab/integration/topic/index.js.map +1 -0
- package/prefab/networking/dns-domain-ref/index.d.ts +16 -0
- package/prefab/networking/dns-domain-ref/index.d.ts.map +1 -0
- package/prefab/networking/dns-domain-ref/index.js +28 -0
- package/prefab/networking/dns-domain-ref/index.js.map +1 -0
- package/prefab/networking/dns-subdomain-certificate/index.d.ts +13 -0
- package/prefab/networking/dns-subdomain-certificate/index.d.ts.map +1 -0
- package/prefab/networking/dns-subdomain-certificate/index.js +28 -0
- package/prefab/networking/dns-subdomain-certificate/index.js.map +1 -0
- package/prefab/networking/dns-subdomain-hosted-zone/index.d.ts +12 -0
- package/prefab/networking/dns-subdomain-hosted-zone/index.d.ts.map +1 -0
- package/prefab/networking/dns-subdomain-hosted-zone/index.js +27 -0
- package/prefab/networking/dns-subdomain-hosted-zone/index.js.map +1 -0
- package/prefab/networking/index.d.ts +6 -0
- package/prefab/networking/index.d.ts.map +1 -0
- package/prefab/networking/index.js +22 -0
- package/prefab/networking/index.js.map +1 -0
- package/prefab/networking/vpc/index.d.ts +20 -0
- package/prefab/networking/vpc/index.d.ts.map +1 -0
- package/prefab/networking/vpc/index.js +28 -0
- package/prefab/networking/vpc/index.js.map +1 -0
- package/prefab/networking/waf/index.d.ts +14 -0
- package/prefab/networking/waf/index.d.ts.map +1 -0
- package/prefab/networking/waf/index.js +45 -0
- package/prefab/networking/waf/index.js.map +1 -0
- package/prefab/storage/bucket/asset-bucket.d.ts +12 -0
- package/prefab/storage/bucket/asset-bucket.d.ts.map +1 -0
- package/prefab/storage/bucket/asset-bucket.js +19 -0
- package/prefab/storage/bucket/asset-bucket.js.map +1 -0
- package/prefab/storage/bucket/index.d.ts +3 -0
- package/prefab/storage/bucket/index.d.ts.map +1 -0
- package/prefab/storage/bucket/index.js +19 -0
- package/prefab/storage/bucket/index.js.map +1 -0
- package/prefab/storage/bucket/private-bucket.d.ts +26 -0
- package/prefab/storage/bucket/private-bucket.d.ts.map +1 -0
- package/prefab/storage/bucket/private-bucket.js +82 -0
- package/prefab/storage/bucket/private-bucket.js.map +1 -0
- package/prefab/storage/index.d.ts +2 -0
- package/prefab/storage/index.d.ts.map +1 -0
- package/prefab/storage/index.js +18 -0
- package/prefab/storage/index.js.map +1 -0
- package/prefab/utils/config/frontend-env-builder.d.ts +14 -0
- package/prefab/utils/config/frontend-env-builder.d.ts.map +1 -0
- package/prefab/utils/config/frontend-env-builder.js +25 -0
- package/prefab/utils/config/frontend-env-builder.js.map +1 -0
- package/prefab/utils/config/index.d.ts +4 -0
- package/prefab/utils/config/index.d.ts.map +1 -0
- package/prefab/utils/config/index.js +20 -0
- package/prefab/utils/config/index.js.map +1 -0
- package/prefab/utils/config/parameter-secret.d.ts +21 -0
- package/prefab/utils/config/parameter-secret.d.ts.map +1 -0
- package/prefab/utils/config/parameter-secret.js +42 -0
- package/prefab/utils/config/parameter-secret.js.map +1 -0
- package/prefab/utils/config/runtime-secret.d.ts +20 -0
- package/prefab/utils/config/runtime-secret.d.ts.map +1 -0
- package/prefab/utils/config/runtime-secret.js +37 -0
- package/prefab/utils/config/runtime-secret.js.map +1 -0
- package/prefab/utils/deploy-pipeline/catalog/integrations/index.d.ts +2 -0
- package/prefab/utils/deploy-pipeline/catalog/integrations/index.d.ts.map +1 -0
- package/prefab/utils/deploy-pipeline/catalog/integrations/index.js +28 -0
- package/prefab/utils/deploy-pipeline/catalog/integrations/index.js.map +1 -0
- package/prefab/utils/deploy-pipeline/catalog/integrations/slack.d.ts +28 -0
- package/prefab/utils/deploy-pipeline/catalog/integrations/slack.d.ts.map +1 -0
- package/prefab/utils/deploy-pipeline/catalog/integrations/slack.js +8 -0
- package/prefab/utils/deploy-pipeline/catalog/integrations/slack.js.map +1 -0
- package/prefab/utils/deploy-pipeline/entities/index.d.ts +29 -0
- package/prefab/utils/deploy-pipeline/entities/index.d.ts.map +1 -0
- package/prefab/utils/deploy-pipeline/entities/index.js +3 -0
- package/prefab/utils/deploy-pipeline/entities/index.js.map +1 -0
- package/prefab/utils/deploy-pipeline/handlers/send-to-slack/handler.d.ts +3 -0
- package/prefab/utils/deploy-pipeline/handlers/send-to-slack/handler.d.ts.map +1 -0
- package/prefab/utils/deploy-pipeline/handlers/send-to-slack/handler.js +28 -0
- package/prefab/utils/deploy-pipeline/handlers/send-to-slack/handler.js.map +1 -0
- package/prefab/utils/deploy-pipeline/index.d.ts +15 -0
- package/prefab/utils/deploy-pipeline/index.d.ts.map +1 -0
- package/prefab/utils/deploy-pipeline/index.js +173 -0
- package/prefab/utils/deploy-pipeline/index.js.map +1 -0
- package/prefab/utils/deploy-pipeline/platform/get-pipeline-detail.d.ts +6 -0
- package/prefab/utils/deploy-pipeline/platform/get-pipeline-detail.d.ts.map +1 -0
- package/prefab/utils/deploy-pipeline/platform/get-pipeline-detail.js +26 -0
- package/prefab/utils/deploy-pipeline/platform/get-pipeline-detail.js.map +1 -0
- package/prefab/utils/deploy-pipeline/platform/get-slack-payload.d.ts +4 -0
- package/prefab/utils/deploy-pipeline/platform/get-slack-payload.d.ts.map +1 -0
- package/prefab/utils/deploy-pipeline/platform/get-slack-payload.js +39 -0
- package/prefab/utils/deploy-pipeline/platform/get-slack-payload.js.map +1 -0
- package/prefab/utils/deploy-pipeline/platform/send-to-slack.d.ts +3 -0
- package/prefab/utils/deploy-pipeline/platform/send-to-slack.d.ts.map +1 -0
- package/prefab/utils/deploy-pipeline/platform/send-to-slack.js +14 -0
- package/prefab/utils/deploy-pipeline/platform/send-to-slack.js.map +1 -0
- package/prefab/utils/duration.d.ts +2 -0
- package/prefab/utils/duration.d.ts.map +1 -0
- package/prefab/utils/duration.js +6 -0
- package/prefab/utils/duration.js.map +1 -0
- package/prefab/utils/index.d.ts +5 -0
- package/prefab/utils/index.d.ts.map +1 -0
- package/prefab/utils/index.js +21 -0
- package/prefab/utils/index.js.map +1 -0
- package/prefab/utils/ses/index.d.ts +22 -0
- package/prefab/utils/ses/index.d.ts.map +1 -0
- package/prefab/utils/ses/index.js +124 -0
- package/prefab/utils/ses/index.js.map +1 -0
- package/script/config-command/bootstrap.d.ts +4 -0
- package/script/config-command/bootstrap.d.ts.map +1 -0
- package/script/config-command/bootstrap.js +66 -0
- package/script/config-command/bootstrap.js.map +1 -0
- package/script/config-command/deploy-spa.d.ts +4 -0
- package/script/config-command/deploy-spa.d.ts.map +1 -0
- package/script/config-command/deploy-spa.js +84 -0
- package/script/config-command/deploy-spa.js.map +1 -0
- package/script/config-command/deploy.d.ts +4 -0
- package/script/config-command/deploy.d.ts.map +1 -0
- package/script/config-command/deploy.js +26 -0
- package/script/config-command/deploy.js.map +1 -0
- package/script/config-command/destroy.d.ts +4 -0
- package/script/config-command/destroy.d.ts.map +1 -0
- package/script/config-command/destroy.js +26 -0
- package/script/config-command/destroy.js.map +1 -0
- package/script/config-command/env-ssr.d.ts +4 -0
- package/script/config-command/env-ssr.d.ts.map +1 -0
- package/script/config-command/env-ssr.js +51 -0
- package/script/config-command/env-ssr.js.map +1 -0
- package/script/config-command/invalidation-ssr.d.ts +4 -0
- package/script/config-command/invalidation-ssr.d.ts.map +1 -0
- package/script/config-command/invalidation-ssr.js +55 -0
- package/script/config-command/invalidation-ssr.js.map +1 -0
- package/script/config-command/rds-migration.d.ts +7 -0
- package/script/config-command/rds-migration.d.ts.map +1 -0
- package/script/config-command/rds-migration.js +125 -0
- package/script/config-command/rds-migration.js.map +1 -0
- package/script/config-command/rds-sync.d.ts +4 -0
- package/script/config-command/rds-sync.d.ts.map +1 -0
- package/script/config-command/rds-sync.js +66 -0
- package/script/config-command/rds-sync.js.map +1 -0
- package/script/config-command/ssm-connect.d.ts +4 -0
- package/script/config-command/ssm-connect.d.ts.map +1 -0
- package/script/config-command/ssm-connect.js +86 -0
- package/script/config-command/ssm-connect.js.map +1 -0
- package/script/config-command/start-spa.d.ts +4 -0
- package/script/config-command/start-spa.d.ts.map +1 -0
- package/script/config-command/start-spa.js +55 -0
- package/script/config-command/start-spa.js.map +1 -0
- package/script/config-command/start-ssr.d.ts +4 -0
- package/script/config-command/start-ssr.d.ts.map +1 -0
- package/script/config-command/start-ssr.js +55 -0
- package/script/config-command/start-ssr.js.map +1 -0
- package/script/config-command/synth.d.ts +4 -0
- package/script/config-command/synth.d.ts.map +1 -0
- package/script/config-command/synth.js +26 -0
- package/script/config-command/synth.js.map +1 -0
- package/script/index.d.ts +25 -0
- package/script/index.d.ts.map +1 -0
- package/script/index.js +70 -0
- package/script/index.js.map +1 -0
- package/script/output-command/create-user.d.ts +9 -0
- package/script/output-command/create-user.d.ts.map +1 -0
- package/script/output-command/create-user.js +61 -0
- package/script/output-command/create-user.js.map +1 -0
- package/script/output-command/gen-postman-env.d.ts +28 -0
- package/script/output-command/gen-postman-env.d.ts.map +1 -0
- package/script/output-command/gen-postman-env.js +56 -0
- package/script/output-command/gen-postman-env.js.map +1 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../prefab/utils/ses/index.ts"],"names":[],"mappings":";;;AA6HA,gFAQC;AAnID,iDAA8D;AAC9D,yDAA+E;AAC/E,mEAA8G;AAC9G,2CAAuC;AAEvC,mCAAkF;AAElF,MAAa,SAAU,SAAQ,sBAAS;IACtC,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CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC;YACjD,MAAM,EAAE,gBAAM,CAAC,KAAK;YACpB,SAAS,EAAE,CAAC,GAAG,CAAC;SACjB,CAAC;KACH,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../script/config-command/bootstrap.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAEnC,eAAO,MAAM,SAAS,EAAE,aAoDvB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bootstrap = void 0;
|
|
4
|
+
/* eslint-disable no-console */
|
|
5
|
+
const child_process_1 = require("child_process");
|
|
6
|
+
const assume_role_1 = require("../../common/synth/assume-role");
|
|
7
|
+
const pre_script_1 = require("../../common/synth/pre-script");
|
|
8
|
+
const bootstrap = async (globalConstConfig, globalEnvConfig, globalDeployTargetConfig, args) => {
|
|
9
|
+
try {
|
|
10
|
+
console.log('<< Bootstrap Started >>');
|
|
11
|
+
const { envName, envNameInput, roleName, outputFile, servicesNames, accountMap, bootstrappingServices, landingZones } = await (0, pre_script_1.preScript)(globalConstConfig, globalEnvConfig, globalDeployTargetConfig, args);
|
|
12
|
+
const accountArr = accountMap.split(' ');
|
|
13
|
+
const deployAccount = accountArr.find((a) => a.includes('deploy'))?.split('=')[1] || '';
|
|
14
|
+
const serviceAccount = accountArr.find((a) => a.includes('services'))?.split('=')[1] || '';
|
|
15
|
+
const dnsAccount = accountArr.find((a) => a.includes('dnsShared'))?.split('=')[1] || '';
|
|
16
|
+
const region = globalDeployTargetConfig[envName]['services']['region'];
|
|
17
|
+
await runBootstrap(landingZones, serviceAccount, region, roleName, envNameInput, outputFile, accountMap, servicesNames);
|
|
18
|
+
await runBootstrap(landingZones, deployAccount, region, roleName, envNameInput, outputFile, accountMap, servicesNames);
|
|
19
|
+
if (dnsAccount !== deployAccount) {
|
|
20
|
+
await runBootstrap(landingZones, dnsAccount, region, roleName, envNameInput, outputFile, accountMap, servicesNames);
|
|
21
|
+
}
|
|
22
|
+
if (bootstrappingServices) {
|
|
23
|
+
const command = `npx cdk deploy \
|
|
24
|
+
--require-approval='never' \
|
|
25
|
+
--cloudformation-execution-policies=arn:aws:iam::aws:policy/AdministratorAccess \
|
|
26
|
+
--context env=${envNameInput} \
|
|
27
|
+
--context isBootstrapping=true \
|
|
28
|
+
--context assume-role-credentials:writeIamRoleName=${roleName} \
|
|
29
|
+
--context assume-role-credentials:readIamRoleName=${roleName} \
|
|
30
|
+
--outputs-file ${outputFile} \
|
|
31
|
+
${accountMap} ${bootstrappingServices}`;
|
|
32
|
+
(0, child_process_1.execSync)(command, { stdio: 'inherit', env: process.env });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.bootstrap = bootstrap;
|
|
40
|
+
const runBootstrap = async (landingZones, account, region, roleName, envNameInput, outputFile, accountMap, serviceName) => {
|
|
41
|
+
const command = `npx cdk bootstrap ${account}/${region} \
|
|
42
|
+
--require-approval='never' \
|
|
43
|
+
${landingZones.map((lz) => `--trust ${lz}`).join(' ')} \
|
|
44
|
+
${landingZones.map((lz) => `--trust-for-lookup ${lz}`).join(' ')} \
|
|
45
|
+
--no-bootstrap-customer-key \
|
|
46
|
+
--require-approval='never' \
|
|
47
|
+
--cloudformation-execution-policies=arn:aws:iam::aws:policy/AdministratorAccess \
|
|
48
|
+
--context env=${envNameInput} \
|
|
49
|
+
--outputs-file ${outputFile} \
|
|
50
|
+
${accountMap} ${serviceName}`;
|
|
51
|
+
const role = await (0, assume_role_1.assumeRole)({ account, region }, roleName).catch((e) => {
|
|
52
|
+
console.log(e);
|
|
53
|
+
throw e;
|
|
54
|
+
});
|
|
55
|
+
(0, child_process_1.execSync)(command, {
|
|
56
|
+
stdio: 'inherit',
|
|
57
|
+
env: {
|
|
58
|
+
...process.env,
|
|
59
|
+
AWS_ACCESS_KEY_ID: role.credentials.accessKeyId,
|
|
60
|
+
AWS_SECRET_ACCESS_KEY: role.credentials.secretAccessKey,
|
|
61
|
+
AWS_SESSION_TOKEN: role.credentials.sessionToken,
|
|
62
|
+
AWS_REGION: role.region,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../script/config-command/bootstrap.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,iDAAyC;AAEzC,0DAAsD;AACtD,wDAAoD;AAa7C,MAAM,SAAS,GAAkB,KAAK,EAM3C,iBAAqD,EACrD,eAA2D,EAC3D,wBAAoF,EACpF,IAAc,EACC,EAAE;IACjB,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;QAEvC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,qBAAqB,EAAE,YAAY,EAAE,GAAG,MAAM,IAAA,sBAAS,EACrI,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,IAAI,CACL,CAAC;QAEF,MAAM,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACzC,MAAM,aAAa,GAAW,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAChG,MAAM,cAAc,GAAW,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EA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mBA,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAEnC,eAAO,MAAM,SAAS,EAAE,aAuGvB,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deploySPA = void 0;
|
|
4
|
+
/* eslint-disable no-console */
|
|
5
|
+
const client_cloudfront_1 = require("@aws-sdk/client-cloudfront");
|
|
6
|
+
const client_ssm_1 = require("@aws-sdk/client-ssm");
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
const fs_1 = require("fs");
|
|
9
|
+
const get_resource_name_1 = require("../../common/naming/get-resource-name");
|
|
10
|
+
const assume_role_1 = require("../../common/synth/assume-role");
|
|
11
|
+
const pre_script_1 = require("../../common/synth/pre-script");
|
|
12
|
+
const deploySPA = async (globalConstConfig, globalEnvConfig, globalDeployTargetConfig, args) => {
|
|
13
|
+
try {
|
|
14
|
+
console.log('<< Deploy SPA Started >>');
|
|
15
|
+
const yarnCommand = args[5] || 'build';
|
|
16
|
+
const { envName, ephemeralEnvName, servicesNamesInput, envNameInput, roleName, accountMap, isSingleProjectAccount } = await (0, pre_script_1.preScript)(globalConstConfig, globalEnvConfig, globalDeployTargetConfig, args);
|
|
17
|
+
console.log('>> STEP: (1/4) => LOADING CONFIGS');
|
|
18
|
+
const projectName = globalConstConfig.projectName;
|
|
19
|
+
const account = accountMap
|
|
20
|
+
.split(' ')
|
|
21
|
+
.find((a) => a.includes('services'))
|
|
22
|
+
?.split('=')[1] || '';
|
|
23
|
+
const region = globalDeployTargetConfig[envName]['services']['region'];
|
|
24
|
+
const role = await (0, assume_role_1.assumeRole)({ account, region }, roleName);
|
|
25
|
+
console.log('>> STEP: (2/4) => RENDERING ENV');
|
|
26
|
+
const getParamName = (name) => (0, get_resource_name_1.getResourceName)(name, {
|
|
27
|
+
isSingleProjectAccount,
|
|
28
|
+
projectName,
|
|
29
|
+
envName,
|
|
30
|
+
ephemeralEnvName,
|
|
31
|
+
serviceName: servicesNamesInput[0],
|
|
32
|
+
});
|
|
33
|
+
const ssm = new client_ssm_1.SSMClient(role);
|
|
34
|
+
const deployConfig = await ssm.send(new client_ssm_1.GetParameterCommand({ Name: getParamName('config') }));
|
|
35
|
+
if (!deployConfig.Parameter?.Value)
|
|
36
|
+
throw new Error('Invalid Config');
|
|
37
|
+
const { domain, bucketName, distributionId, assetMaxAge, indexMaxAge, baseDir, distDir } = JSON.parse(deployConfig.Parameter?.Value);
|
|
38
|
+
const calculatedEnv = await ssm.send(new client_ssm_1.GetParameterCommand({ Name: getParamName('env-calculated') }));
|
|
39
|
+
if (!calculatedEnv.Parameter?.Value)
|
|
40
|
+
throw new Error('Invalid CalculatedEnv');
|
|
41
|
+
const manualEnv = await ssm.send(new client_ssm_1.GetParameterCommand({ Name: getParamName('env-manual') }));
|
|
42
|
+
if (!manualEnv.Parameter?.Value)
|
|
43
|
+
throw new Error('Invalid CalculatedEnv');
|
|
44
|
+
const envFile = `${calculatedEnv.Parameter?.Value}\n${manualEnv.Parameter?.Value}`;
|
|
45
|
+
(0, fs_1.writeFileSync)(`${process.cwd()}/${baseDir}/.env.${envNameInput}`, envFile);
|
|
46
|
+
console.log('>> STEP: (3/4) => BUILDING');
|
|
47
|
+
const command = `yarn && yarn ${yarnCommand} ${envNameInput}`;
|
|
48
|
+
(0, child_process_1.execSync)(command, { stdio: 'inherit', cwd: `${process.cwd()}/${baseDir}` });
|
|
49
|
+
const copyFolderCmd = `aws s3 cp ${distDir}/ s3://${bucketName}/ --recursive --cache-control "max-age=${assetMaxAge}" --exclude "index.html"`;
|
|
50
|
+
const copyIndexCmd = `aws s3 cp ${distDir}/index.html s3://${bucketName}/index.html --cache-control "max-age=${indexMaxAge}"`;
|
|
51
|
+
const execOptions = {
|
|
52
|
+
stdio: 'inherit',
|
|
53
|
+
cwd: `${process.cwd()}/${baseDir}`,
|
|
54
|
+
env: {
|
|
55
|
+
...process.env,
|
|
56
|
+
AWS_ACCESS_KEY_ID: role.credentials.accessKeyId,
|
|
57
|
+
AWS_SECRET_ACCESS_KEY: role.credentials.secretAccessKey,
|
|
58
|
+
AWS_SESSION_TOKEN: role.credentials.sessionToken,
|
|
59
|
+
AWS_REGION: role.region,
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
(0, child_process_1.execSync)(copyFolderCmd, execOptions);
|
|
63
|
+
(0, child_process_1.execSync)(copyIndexCmd, execOptions);
|
|
64
|
+
console.log('STEP: (4/4) => CREATING INVALIDATION');
|
|
65
|
+
const cf = new client_cloudfront_1.CloudFrontClient(role);
|
|
66
|
+
await cf.send(new client_cloudfront_1.CreateInvalidationCommand({
|
|
67
|
+
DistributionId: distributionId,
|
|
68
|
+
InvalidationBatch: {
|
|
69
|
+
CallerReference: Date.now().toString(),
|
|
70
|
+
Paths: {
|
|
71
|
+
Items: ['/*'],
|
|
72
|
+
Quantity: 1,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
}));
|
|
76
|
+
console.log(`>> DEPLOYED AT => ${domain}`);
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
console.log(error);
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
exports.deploySPA = deploySPA;
|
|
84
|
+
//# sourceMappingURL=deploy-spa.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-spa.js","sourceRoot":"","sources":["../../../script/config-command/deploy-spa.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,kEAAyF;AACzF,oDAAqE;AAErE,iDAA0D;AAC1D,2BAAmC;AAEnC,uEAAkE;AAClE,0DAAsD;AACtD,wDAAoD;AAY7C,MAAM,SAAS,GAAkB,KAAK,EAM3C,iBAAqD,EACrD,eAA2D,EAC3D,wBAAoF,EACpF,IAAc,EACC,EAAE;IACjB,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,0BAA0B,C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,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC;AAvGW,QAAA,SAAS,aAuGpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../script/config-command/deploy.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAEnC,eAAO,MAAM,MAAM,EAAE,aAkCpB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deploy = void 0;
|
|
4
|
+
/* eslint-disable no-console */
|
|
5
|
+
const child_process_1 = require("child_process");
|
|
6
|
+
const pre_script_1 = require("../../common/synth/pre-script");
|
|
7
|
+
const deploy = async (globalConstConfig, globalEnvConfig, globalDeployTargetConfig, args) => {
|
|
8
|
+
try {
|
|
9
|
+
console.log('<< Deploy Started >>');
|
|
10
|
+
const { envNameInput, roleName, outputFile, servicesNames, accountMap } = await (0, pre_script_1.preScript)(globalConstConfig, globalEnvConfig, globalDeployTargetConfig, args);
|
|
11
|
+
const command = `npx cdk deploy \
|
|
12
|
+
--require-approval='never' \
|
|
13
|
+
--cloudformation-execution-policies=arn:aws:iam::aws:policy/AdministratorAccess \
|
|
14
|
+
--context env=${envNameInput} \
|
|
15
|
+
--context assume-role-credentials:writeIamRoleName=${roleName} \
|
|
16
|
+
--context assume-role-credentials:readIamRoleName=${roleName} \
|
|
17
|
+
--outputs-file ${outputFile} \
|
|
18
|
+
${accountMap} ${servicesNames}`;
|
|
19
|
+
(0, child_process_1.execSync)(command, { stdio: 'inherit', env: process.env });
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.deploy = deploy;
|
|
26
|
+
//# sourceMappingURL=deploy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../../script/config-command/deploy.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,iDAAyC;AAEzC,wDAAoD;AAY7C,MAAM,MAAM,GAAkB,KAAK,EAMxC,iBAAqD,EACrD,eAA2D,EAC3D,wBAAoF,EACpF,IAAc,EACC,EAAE;IACjB,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QAEpC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,MAAM,IAAA,sBAAS,EACvF,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,IAAI,CACL,CAAC;QAEF,MAAM,OAAO,GAAG;;;oBAGA,YAAY;yDACyB,QAAQ;wDACT,QAAQ;qBAC3C,UAAU;MACzB,UAAU,IAAI,aAAa,EAAE,CAAC;QAEhC,IAAA,wBAAQ,EAAC,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5D,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC;AAlCW,QAAA,MAAM,UAkCjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"destroy.d.ts","sourceRoot":"","sources":["../../../script/config-command/destroy.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,aAiCrB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.destroy = void 0;
|
|
4
|
+
/* eslint-disable no-console */
|
|
5
|
+
const child_process_1 = require("child_process");
|
|
6
|
+
const pre_script_1 = require("../../common/synth/pre-script");
|
|
7
|
+
const destroy = async (globalConstConfig, globalEnvConfig, globalDeployTargetConfig, args) => {
|
|
8
|
+
try {
|
|
9
|
+
console.log('<< Destroy Started >>');
|
|
10
|
+
const { envNameInput, roleName, outputFile, servicesNames, accountMap } = await (0, pre_script_1.preScript)(globalConstConfig, globalEnvConfig, globalDeployTargetConfig, args);
|
|
11
|
+
const command = `npx cdk destroy \
|
|
12
|
+
--require-approval='never' \
|
|
13
|
+
--cloudformation-execution-policies=arn:aws:iam::aws:policy/AdministratorAccess \
|
|
14
|
+
--context env=${envNameInput} \
|
|
15
|
+
--context assume-role-credentials:writeIamRoleName=${roleName} \
|
|
16
|
+
--context assume-role-credentials:readIamRoleName=${roleName} \
|
|
17
|
+
--outputs-file ${outputFile} \
|
|
18
|
+
${accountMap} ${servicesNames}`;
|
|
19
|
+
(0, child_process_1.execSync)(command, { stdio: 'inherit', env: process.env });
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.destroy = destroy;
|
|
26
|
+
//# sourceMappingURL=destroy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"destroy.js","sourceRoot":"","sources":["../../../script/config-command/destroy.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,iDAAyC;AAEzC,wDAAoD;AAY7C,MAAM,OAAO,GAAkB,KAAK,EAMzC,iBAAqD,EACrD,eAA2D,EAC3D,wBAAoF,EACpF,IAAc,EACC,EAAE;IACjB,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QAErC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,MAAM,IAAA,sBAAS,EACvF,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,IAAI,CACL,CAAC;QACF,MAAM,OAAO,GAAG;;;sBAGE,YAAY;2DACyB,QAAQ;0DACT,QAAQ;uBAC3C,UAAU;QACzB,UAAU,IAAI,aAAa,EAAE,CAAC;QAElC,IAAA,wBAAQ,EAAC,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5D,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC;AAjCW,QAAA,OAAO,WAiClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-ssr.d.ts","sourceRoot":"","sources":["../../../script/config-command/env-ssr.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAEnC,eAAO,MAAM,MAAM,EAAE,aAiEpB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.envSSR = void 0;
|
|
4
|
+
/* eslint-disable no-console */
|
|
5
|
+
const client_ssm_1 = require("@aws-sdk/client-ssm");
|
|
6
|
+
const fs_1 = require("fs");
|
|
7
|
+
const get_resource_name_1 = require("../../common/naming/get-resource-name");
|
|
8
|
+
const assume_role_1 = require("../../common/synth/assume-role");
|
|
9
|
+
const pre_script_1 = require("../../common/synth/pre-script");
|
|
10
|
+
const envSSR = async (globalConstConfig, globalEnvConfig, globalDeployTargetConfig, args) => {
|
|
11
|
+
try {
|
|
12
|
+
console.log('<< Env SSR Started >>');
|
|
13
|
+
const { envName, ephemeralEnvName, servicesNamesInput, envNameInput, roleName, accountMap, isSingleProjectAccount } = await (0, pre_script_1.preScript)(globalConstConfig, globalEnvConfig, globalDeployTargetConfig, args);
|
|
14
|
+
console.log('>> STEP: (1/2) => LOADING CONFIGS');
|
|
15
|
+
const projectName = globalConstConfig.projectName;
|
|
16
|
+
const account = accountMap
|
|
17
|
+
.split(' ')
|
|
18
|
+
.find((a) => a.includes('services'))
|
|
19
|
+
?.split('=')[1] || '';
|
|
20
|
+
const region = globalDeployTargetConfig[envName]['services']['region'];
|
|
21
|
+
console.log('>> STEP: (2/2) => RENDERING ENV');
|
|
22
|
+
const getParamName = (name) => (0, get_resource_name_1.getResourceName)(name, {
|
|
23
|
+
isSingleProjectAccount,
|
|
24
|
+
projectName,
|
|
25
|
+
envName,
|
|
26
|
+
ephemeralEnvName,
|
|
27
|
+
serviceName: servicesNamesInput[0],
|
|
28
|
+
});
|
|
29
|
+
const role = await (0, assume_role_1.assumeRole)({ account, region }, roleName);
|
|
30
|
+
const ssm = new client_ssm_1.SSMClient(role);
|
|
31
|
+
const deployConfig = await ssm.send(new client_ssm_1.GetParameterCommand({ Name: getParamName('config') }));
|
|
32
|
+
if (!deployConfig.Parameter?.Value)
|
|
33
|
+
throw new Error('Invalid Config');
|
|
34
|
+
const { baseDir } = JSON.parse(deployConfig.Parameter?.Value);
|
|
35
|
+
const calculatedEnv = await ssm.send(new client_ssm_1.GetParameterCommand({ Name: getParamName('env-calculated') }));
|
|
36
|
+
if (!calculatedEnv.Parameter?.Value)
|
|
37
|
+
throw new Error('Invalid CalculatedEnv');
|
|
38
|
+
const manualEnv = await ssm.send(new client_ssm_1.GetParameterCommand({ Name: getParamName('env-manual') }));
|
|
39
|
+
if (!manualEnv.Parameter?.Value)
|
|
40
|
+
throw new Error('Invalid CalculatedEnv');
|
|
41
|
+
const envFile = `${calculatedEnv.Parameter?.Value}\n${manualEnv.Parameter?.Value}`;
|
|
42
|
+
(0, fs_1.writeFileSync)(`${process.cwd()}/${baseDir}/.env.${envNameInput}`, envFile);
|
|
43
|
+
console.log(`>> Env Created => ${process.cwd()}/${baseDir}/.env.${envNameInput}`);
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
console.log(error);
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
exports.envSSR = envSSR;
|
|
51
|
+
//# sourceMappingURL=env-ssr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-ssr.js","sourceRoot":"","sources":["../../../script/config-command/env-ssr.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,oDAAqE;AAErE,2BAAmC;AAEnC,uEAAkE;AAClE,0DAAsD;AACtD,wDAAoD;AAY7C,MAAM,MAAM,GAAkB,KAAK,EAMxC,iBAAqD,EACrD,eAA2D,EAC3D,wBAAoF,EACpF,IAAc,EACC,EAAE;IACjB,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QAErC,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,sBAAsB,EAAE,GAAG,MAAM,IAAA,sBAAS,EACnI,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,IAAI,CACL,CAAC;QAEF,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;QACjD,MAAM,WAAW,GAAG,iBAAiB,CAAC,WAAW,CAAC;QAElD,MAAM,OAAO,GACX,UAAU;aACP,KAAK,CAAC,GAAG,CAAC;aACV,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;YACpC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAE1B,MAAM,MAAM,GAAG,wBAAwB,CAAC,OAAqB,CAAC,CAAC,UAA8B,CAAC,CAAC,QAAQ,CAAC,CAAC;QAEzG,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;QAE/C,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE,CACpC,IAAA,mCAAe,EAAC,IAAI,EAAE;YACpB,sBAAsB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AAG,OAAO,CAAC,GAAG,EAAE,IAAI,OAAO,SAAS,YAAY,EAAE,EAAE,OAAO,CAAC,CAAC;QAE3E,OAAO,CAAC,GAAG,CAAC,qBAAqB,OAAO,CAAC,GAAG,EAAE,IAAI,OAAO,SAAS,YAAY,EAAE,CAAC,CAAC;IACpF,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC;AAjEW,QAAA,MAAM,UAiEjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalidation-ssr.d.ts","sourceRoot":"","sources":["../../../script/config-command/invalidation-ssr.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAEnC,eAAO,MAAM,eAAe,EAAE,aAqE7B,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.invalidationSSR = void 0;
|
|
4
|
+
/* eslint-disable no-console */
|
|
5
|
+
const client_cloudfront_1 = require("@aws-sdk/client-cloudfront");
|
|
6
|
+
const client_ssm_1 = require("@aws-sdk/client-ssm");
|
|
7
|
+
const get_resource_name_1 = require("../../common/naming/get-resource-name");
|
|
8
|
+
const assume_role_1 = require("../../common/synth/assume-role");
|
|
9
|
+
const pre_script_1 = require("../../common/synth/pre-script");
|
|
10
|
+
const invalidationSSR = async (globalConstConfig, globalEnvConfig, globalDeployTargetConfig, args) => {
|
|
11
|
+
try {
|
|
12
|
+
console.log('<< Invalidation SSR Started >>');
|
|
13
|
+
const { envName, ephemeralEnvName, servicesNamesInput, roleName, accountMap, isSingleProjectAccount } = await (0, pre_script_1.preScript)(globalConstConfig, globalEnvConfig, globalDeployTargetConfig, args);
|
|
14
|
+
console.log('>> STEP: (1/3) => LOADING CONFIGS');
|
|
15
|
+
const projectName = globalConstConfig.projectName;
|
|
16
|
+
const account = accountMap
|
|
17
|
+
.split(' ')
|
|
18
|
+
.find((a) => a.includes('services'))
|
|
19
|
+
?.split('=')[1] || '';
|
|
20
|
+
const region = globalDeployTargetConfig[envName]['services']['region'];
|
|
21
|
+
console.log('>> STEP: (2/3) => RENDERING ENV');
|
|
22
|
+
const getParamName = (name) => (0, get_resource_name_1.getResourceName)(name, {
|
|
23
|
+
isSingleProjectAccount,
|
|
24
|
+
projectName,
|
|
25
|
+
envName,
|
|
26
|
+
ephemeralEnvName,
|
|
27
|
+
serviceName: servicesNamesInput[0],
|
|
28
|
+
});
|
|
29
|
+
const role = await (0, assume_role_1.assumeRole)({ account, region }, roleName);
|
|
30
|
+
const ssm = new client_ssm_1.SSMClient(role);
|
|
31
|
+
const deployConfig = await ssm.send(new client_ssm_1.GetParameterCommand({ Name: getParamName('config') }));
|
|
32
|
+
if (!deployConfig.Parameter?.Value)
|
|
33
|
+
throw new Error('Invalid Config');
|
|
34
|
+
const { distributionId } = JSON.parse(deployConfig.Parameter?.Value);
|
|
35
|
+
console.log('STEP: (3/3) => CREATING INVALIDATION');
|
|
36
|
+
const cf = new client_cloudfront_1.CloudFrontClient(role);
|
|
37
|
+
await cf.send(new client_cloudfront_1.CreateInvalidationCommand({
|
|
38
|
+
DistributionId: distributionId,
|
|
39
|
+
InvalidationBatch: {
|
|
40
|
+
CallerReference: Date.now().toString(),
|
|
41
|
+
Paths: {
|
|
42
|
+
Items: ['/*'],
|
|
43
|
+
Quantity: 1,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
}));
|
|
47
|
+
console.log(`>> Invalidation Created => DistributionId ${distributionId}`);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
console.log(error);
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
exports.invalidationSSR = invalidationSSR;
|
|
55
|
+
//# sourceMappingURL=invalidation-ssr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalidation-ssr.js","sourceRoot":"","sources":["../../../script/config-command/invalidation-ssr.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,kEAAyF;AACzF,oDAAqE;AAErE,uEAAkE;AAClE,0DAAsD;AACtD,wDAAoD;AAY7C,MAAM,eAAe,GAAkB,KAAK,EAMjD,iBAAqD,EACrD,eAA2D,EAC3D,wBAAoF,EACpF,IAAc,EACC,EAAE;IACjB,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;QAE9C,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,UAAU,EAAE,sBAAsB,EAAE,GAAG,MAAM,IAAA,sBAAS,EACrH,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,IAAI,CACL,CAAC;QAEF,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;QACjD,MAAM,WAAW,GAAG,iBAAiB,CAAC,WAAW,CAAC;QAElD,MAAM,OAAO,GACX,UAAU;aACP,KAAK,CAAC,GAAG,CAAC;aACV,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;YACpC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,wBAAwB,CAAC,OAAqB,CAAC,CAAC,UAA8B,CAAC,CAAC,QAAQ,CAAC,CAAC;QAEzG,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;QAE/C,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE,CACpC,IAAA,mCAAe,EAAC,IAAI,EAAE;YACpB,sBAAsB;YACtB,WAAW;YACX,OAAO;YACP,gBAAgB;YAChB,WAAW,EAAE,kBAAkB,CAA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
{"version":3,"file":"rds-migration.d.ts","sourceRoot":"","sources":["../../../script/config-command/rds-migration.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAcrC,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAEnC,eAAO,IAAI,UAAU,EAAE,UAAU,CAAC;AAElC,eAAO,MAAM,YAAY,EAAE,aAsJ1B,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rdsMigration = exports.dataSource = void 0;
|
|
4
|
+
/* eslint-disable no-console */
|
|
5
|
+
const client_secrets_manager_1 = require("@aws-sdk/client-secrets-manager");
|
|
6
|
+
const client_ssm_1 = require("@aws-sdk/client-ssm");
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
const console_1 = require("console");
|
|
9
|
+
const fs_1 = require("fs");
|
|
10
|
+
const typeorm_1 = require("typeorm");
|
|
11
|
+
const common_1 = require("../../common");
|
|
12
|
+
const rdsMigration = async (globalConstConfig, globalEnvConfig, globalDeployTargetConfig, args) => {
|
|
13
|
+
try {
|
|
14
|
+
console.log('<< Migration RDS Started >>');
|
|
15
|
+
const commandArg = args[5] || 'generate';
|
|
16
|
+
if (!['generate', 'run', 'revert'].includes(commandArg))
|
|
17
|
+
throw new Error('Action not allowed, you can use: generate, run or revert');
|
|
18
|
+
const { envName, ephemeralEnvName, servicesNamesInput, roleName, accountMap, isSingleProjectAccount } = await (0, common_1.preScript)(globalConstConfig, globalEnvConfig, globalDeployTargetConfig, args);
|
|
19
|
+
console.log('>> STEP: (1/2) => LOADING CONFIGS');
|
|
20
|
+
const projectName = globalConstConfig.projectName;
|
|
21
|
+
const account = accountMap
|
|
22
|
+
.split(' ')
|
|
23
|
+
.find((a) => a.includes('services'))
|
|
24
|
+
?.split('=')[1] || '';
|
|
25
|
+
const region = globalDeployTargetConfig[envName]['services']['region'];
|
|
26
|
+
const role = await (0, common_1.assumeRole)({ account, region }, roleName);
|
|
27
|
+
const getParamName = (name) => (0, common_1.getResourceName)(name, {
|
|
28
|
+
isSingleProjectAccount,
|
|
29
|
+
projectName,
|
|
30
|
+
envName,
|
|
31
|
+
ephemeralEnvName,
|
|
32
|
+
serviceName: servicesNamesInput[0],
|
|
33
|
+
});
|
|
34
|
+
const ssm = new client_ssm_1.SSMClient(role);
|
|
35
|
+
const configs = await ssm.send(new client_ssm_1.GetParameterCommand({ Name: getParamName('config') }));
|
|
36
|
+
if (!configs.Parameter?.Value)
|
|
37
|
+
throw new Error('Invalid Config');
|
|
38
|
+
const { baseDir, clusterSecretArn, publicAccess } = JSON.parse(configs.Parameter?.Value);
|
|
39
|
+
const sm = new client_secrets_manager_1.SecretsManagerClient(role);
|
|
40
|
+
const response = await sm.send(new client_secrets_manager_1.GetSecretValueCommand({
|
|
41
|
+
SecretId: clusterSecretArn,
|
|
42
|
+
}));
|
|
43
|
+
const DbSecrets = JSON.parse(response.SecretString);
|
|
44
|
+
const { username, password, host, port } = DbSecrets;
|
|
45
|
+
const localHost = '127.0.0.1';
|
|
46
|
+
const localPort = 1433;
|
|
47
|
+
const rdsConfigPath = `${process.cwd()}/${baseDir}/config/rds.ts`;
|
|
48
|
+
const rdsConfigValue = (await import(rdsConfigPath))['default'];
|
|
49
|
+
const migrationsDefault = `${process.cwd()}/${baseDir}/migrations/*.{ts, js}`;
|
|
50
|
+
if (commandArg === 'generate') {
|
|
51
|
+
(0, console_1.log)('>> STEP: (2/2) => GENERATING MIGRATION');
|
|
52
|
+
(0, fs_1.writeFileSync)(`${process.cwd()}/${baseDir}/config/ormconfig.ts`, `import { DataSource } from 'typeorm';
|
|
53
|
+
|
|
54
|
+
export const connectionSource = new DataSource({
|
|
55
|
+
type: 'postgres',
|
|
56
|
+
database: 'postgres',
|
|
57
|
+
host: process.env.CC_HOST,
|
|
58
|
+
port: Number(process.env.CC_PORT),
|
|
59
|
+
username: process.env.CC_USER,
|
|
60
|
+
password: process.env.CC_PASS,
|
|
61
|
+
entities: [...process.env.CC_ENTITIES!.split(',')],
|
|
62
|
+
migrations: [process.env.CC_MIGRATIONS!],
|
|
63
|
+
});`);
|
|
64
|
+
const command = `npx typeorm-ts-node-esm migration:generate ./${baseDir}/migrations/m -d ./${baseDir}/config/ormconfig.ts`;
|
|
65
|
+
const execOptions = {
|
|
66
|
+
stdio: 'inherit',
|
|
67
|
+
cwd: `${process.cwd()}`,
|
|
68
|
+
env: {
|
|
69
|
+
...process.env,
|
|
70
|
+
CC_HOST: publicAccess ? host : localHost,
|
|
71
|
+
CC_PORT: publicAccess ? `${port}` : `${localPort}`,
|
|
72
|
+
CC_USER: username,
|
|
73
|
+
CC_PASS: password,
|
|
74
|
+
CC_ENTITIES: rdsConfigValue.entities,
|
|
75
|
+
CC_MIGRATIONS: migrationsDefault,
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
try {
|
|
79
|
+
(0, child_process_1.execSync)(command, execOptions);
|
|
80
|
+
(0, fs_1.unlinkSync)(`${process.cwd()}/${baseDir}/config/ormconfig.ts`);
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
(0, fs_1.unlinkSync)(`${process.cwd()}/${baseDir}/config/ormconfig.ts`);
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (commandArg === 'run') {
|
|
88
|
+
(0, console_1.log)('>> STEP: (2/2) => RUNNING MIGRATION');
|
|
89
|
+
const dataSource = new typeorm_1.DataSource({
|
|
90
|
+
type: 'postgres',
|
|
91
|
+
database: 'postgres',
|
|
92
|
+
host: publicAccess ? host : localHost,
|
|
93
|
+
port: publicAccess ? port : localPort,
|
|
94
|
+
username,
|
|
95
|
+
password,
|
|
96
|
+
entities: rdsConfigValue.entities,
|
|
97
|
+
migrations: [migrationsDefault],
|
|
98
|
+
});
|
|
99
|
+
await dataSource.initialize();
|
|
100
|
+
await dataSource.runMigrations();
|
|
101
|
+
}
|
|
102
|
+
if (commandArg === 'revert') {
|
|
103
|
+
(0, console_1.log)('>> STEP: (2/2) => REVERT MIGRATION');
|
|
104
|
+
const dataSource = new typeorm_1.DataSource({
|
|
105
|
+
type: 'postgres',
|
|
106
|
+
database: 'postgres',
|
|
107
|
+
host: publicAccess ? host : localHost,
|
|
108
|
+
port: publicAccess ? port : localPort,
|
|
109
|
+
username,
|
|
110
|
+
password,
|
|
111
|
+
entities: rdsConfigValue.entities,
|
|
112
|
+
migrations: [migrationsDefault],
|
|
113
|
+
});
|
|
114
|
+
await dataSource.initialize();
|
|
115
|
+
await dataSource.undoLastMigration();
|
|
116
|
+
}
|
|
117
|
+
console.log('MIGRATION READY! ✅');
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
console.log(error);
|
|
121
|
+
process.exit(1);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
exports.rdsMigration = rdsMigration;
|
|
125
|
+
//# sourceMappingURL=rds-migration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rds-migration.js","sourceRoot":"","sources":["../../../script/config-command/rds-migration.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,4EAA8F;AAC9F,oDAAqE;AAGrE,iDAA0D;AAC1D,qCAA8B;AAC9B,2BAA+C;AAC/C,qCAAqC;AAErC,mCAUgB;AAMT,MAAM,YAAY,GAAkB,KAAK,EAM9C,iBAAqD,EACrD,eAA2D,EAC3D,wBAAoF,EACpF,IAAc,EACC,EAAE;IACjB,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;QAE3C,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC;QAEzC,IAAI,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,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