Skip to content

Commit

Permalink
🐛 Fix error when deleteing ecs cluster
Browse files Browse the repository at this point in the history
ecs can't be deleted because the ec2 stil atachhed. To fix the issue we change the capacity of the cluster
  • Loading branch information
brunodasilvalenga committed Jan 23, 2024
1 parent 41a931c commit 9199c9a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,12 @@ resource "aws_ecs_cluster" "ecs" {
]
}

provisioner "local-exec" {
when = destroy
command = <<-EOT
aws autoscaling update-auto-scaling-group --auto-scaling-group-name ecs-${self.name} --min-size 0 --desired-capacity 0
EOT
}

}

0 comments on commit 9199c9a

Please sign in to comment.