diff --git a/.github/workflows/pause-resources.yml b/.github/workflows/pause-resources.yml index 4d50508f..d6edd82f 100644 --- a/.github/workflows/pause-resources.yml +++ b/.github/workflows/pause-resources.yml @@ -22,7 +22,7 @@ jobs: - name: Pause AWS Resources shell: bash run: | - aws application-autoscaling register-scalable-target --service-namespace ecs --resource-id service/ecs-cluster-node-api-dev/node-api-dev-service --scalable-dimension ecs:service:DesiredCount --suspended-state DynamicScalingInSuspended=true,DynamicScalingOutSuspended=true --no-cli-pager --output json + aws application-autoscaling register-scalable-target --service-namespace ecs --resource-id service/ecs-cluster-node-api-dev/node-api-dev-service --scalable-dimension ecs:service:DesiredCount --min-capacity 0 --max-capacity 0 --no-cli-pager --output json aws ecs update-service --cluster ecs-cluster-node-api-dev --service node-api-dev-service --desired-count 0 --no-cli-pager --output json DB_CLUSTER_STATUS=$(aws rds describe-db-clusters --db-cluster-identifier qsawsc-aurora-cluster-dev --query 'DBClusters[0].Status' --output text) if [ "$DB_CLUSTER_STATUS" = "available" ]; then diff --git a/.github/workflows/resume-resources.yml b/.github/workflows/resume-resources.yml index 325b1195..c2cd3d97 100644 --- a/.github/workflows/resume-resources.yml +++ b/.github/workflows/resume-resources.yml @@ -29,4 +29,4 @@ jobs: echo "DB cluster is not in an stopped state. Current state: $DB_CLUSTER_STATUS" fi aws ecs update-service --cluster ecs-cluster-node-api-dev --service node-api-dev-service --desired-count 1 --no-cli-pager --output json - aws application-autoscaling register-scalable-target --service-namespace ecs --resource-id service/ecs-cluster-node-api-dev/node-api-dev-service --scalable-dimension ecs:service:DesiredCount --suspended-state DynamicScalingInSuspended=false,DynamicScalingOutSuspended=false --no-cli-pager --output json + aws application-autoscaling register-scalable-target --service-namespace ecs --resource-id service/ecs-cluster-node-api-dev/node-api-dev-service --scalable-dimension ecs:service:DesiredCount --min-capacity 1 --max-capacity 3 --no-cli-pager --output json diff --git a/infrastructure/api/ecs.tf b/infrastructure/api/ecs.tf index 2046194d..eda1b25e 100644 --- a/infrastructure/api/ecs.tf +++ b/infrastructure/api/ecs.tf @@ -70,6 +70,10 @@ resource "aws_ecs_task_definition" "node_api_task" { { name = "FLYWAY_CONNECT_RETRIES" value = "2" + }, + { + name = "FLYWAY_GROUP" + value = "true" } ] diff --git a/migrations/Dockerfile b/migrations/Dockerfile index 0a192e48..9f6c0675 100644 --- a/migrations/Dockerfile +++ b/migrations/Dockerfile @@ -1,4 +1,4 @@ -FROM flyway/flyway:10-alpine +FROM flyway/flyway:11-alpine # Copy migrations COPY ./sql /flyway/sql @@ -9,4 +9,4 @@ USER app # Health check and startup HEALTHCHECK CMD info -CMD ["info", "migrate", "info"] +CMD ["info", "migrate", "repair"]