Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS CodeDeploy Blue/Green with ASG - Failed Deployment Keeps Restarting EC2 Instances

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.

like image 379
echen Avatar asked Oct 16 '25 09:10

echen


1 Answers

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.

like image 107
Deblina Gupta Avatar answered Oct 18 '25 23:10

Deblina Gupta