Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/scripts/resume.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,17 @@ resume_ecs_service() {
local service="${prefix}-node-api-${env}"

echo "Resuming ECS service ${service} on cluster ${cluster}..."

# Check if the ECS cluster exists
if ! aws ecs describe-clusters --clusters "${cluster}" --query 'clusters[0]' --output text &>/dev/null; then
echo "ECS cluster ${cluster} does not exist. Skipping service resume."
return 0
fi

# Check if the ECS service exists
if ! aws ecs describe-services --cluster "${cluster}" --services "${service}" --query 'services[0]' --output text &>/dev/null; then
echo "ECS service ${service} does not exist in cluster ${cluster}. Skipping service resume."
return 0
fi
# Update scaling policy
aws application-autoscaling register-scalable-target \
--service-namespace ecs \
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/api/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ resource "aws_ecs_task_definition" "flyway_task" {
while [[ $attempt -le $max_attempts ]]; do
echo "Starting Flyway task (attempt $attempt)..."
task_arn=$(aws ecs run-task \
--task-definition ${var.app_name}-flyway-task \
--task-definition ${var.app_name}-flyway \
--cluster ${aws_ecs_cluster.ecs_cluster.id} \
--count 1 \
--network-configuration "{\"awsvpcConfiguration\":{\"subnets\":[\"${data.aws_subnets.app.ids[0]}\"],\"securityGroups\":[\"${data.aws_security_group.app.id}\"],\"assignPublicIp\":\"DISABLED\"}}" \
Expand Down
Loading