Skip to content

Commit c510559

Browse files
authored
fix: few issues (#124)
1 parent 080d9e2 commit c510559

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/scripts/resume.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,17 @@ resume_ecs_service() {
6262
local service="${prefix}-node-api-${env}"
6363

6464
echo "Resuming ECS service ${service} on cluster ${cluster}..."
65-
65+
# Check if the ECS cluster exists
66+
if ! aws ecs describe-clusters --clusters "${cluster}" --query 'clusters[0]' --output text &>/dev/null; then
67+
echo "ECS cluster ${cluster} does not exist. Skipping service resume."
68+
return 0
69+
fi
70+
71+
# Check if the ECS service exists
72+
if ! aws ecs describe-services --cluster "${cluster}" --services "${service}" --query 'services[0]' --output text &>/dev/null; then
73+
echo "ECS service ${service} does not exist in cluster ${cluster}. Skipping service resume."
74+
return 0
75+
fi
6676
# Update scaling policy
6777
aws application-autoscaling register-scalable-target \
6878
--service-namespace ecs \

infrastructure/api/ecs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ resource "aws_ecs_task_definition" "flyway_task" {
108108
while [[ $attempt -le $max_attempts ]]; do
109109
echo "Starting Flyway task (attempt $attempt)..."
110110
task_arn=$(aws ecs run-task \
111-
--task-definition ${var.app_name}-flyway-task \
111+
--task-definition ${var.app_name}-flyway \
112112
--cluster ${aws_ecs_cluster.ecs_cluster.id} \
113113
--count 1 \
114114
--network-configuration "{\"awsvpcConfiguration\":{\"subnets\":[\"${data.aws_subnets.app.ids[0]}\"],\"securityGroups\":[\"${data.aws_security_group.app.id}\"],\"assignPublicIp\":\"DISABLED\"}}" \

0 commit comments

Comments
 (0)