Reputation: 2072
My test application has 3 EC2 instances.
After a failed deployment, I noticed that the ASG keeps bringing back the failed instances.
So after 3 failed deployments, I now have 12 instances running: 9 from the failed deployments, 3 from the live servers.
How do I stop this from happening? Thanks.
Upvotes: 4
Views: 1610
Reputation: 56
According to this thread: https://forums.aws.amazon.com/thread.jspa?threadID=265522 they (AWS) have an backlog item to implement a way to delete automatically the ASG if the deployment fails but for know they suggests a creation of a lambda function that's delete it triggered by a failed deploy.
Upvotes: 2
Reputation: 190
CodeDeploy will not delete the autoscaling group. The way the integration works is that if CodeDeploy fails to deploy to an ASG instance, ASG will terminate the instance and try to launch a new one and start a CodeDeploy deployment on the newly launched instances. This eventually gets into a loop and you can either delete the ASG or suspend the scaling process to prevent further scale ups.
Upvotes: 2
Reputation: 2072
Ok turns out it is simple ... I needed to go into the ASG settings and delete the ASGs manually
Looks like each CodeDeploy deployment creates an ASG
Upvotes: 0