Naroju
Naroju

Reputation: 2677

AWS Code Deploy Deployment Failed

I have been using AWS Code deploy from the past 3 months. Every thing went nice. And suddenly When I want to deploy code to EC2 servers today. I am getting this strange error (after it is trying to deploy for more than 20 Minutes).

The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available for deployment, or some instances in your deployment group are experiencing problems. (Error code: HEALTH_CONSTRAINTS)

I don't understand what happened.I have not messed any thing with AWS at all,I just tried to deploy code as I always do. What could be the reason?

Upvotes: 1

Views: 4582

Answers (2)

Kuldeep
Kuldeep

Reputation: 2589

2 potential reasons could be possible here :

  1. You might have missed to install the Code Deploy Agent on your EC2 instance(s) for which the below set of commands will help you to install

sudo yum update

sudo yum install aws-cli

cd /home/ec2-user

aws s3 cp s3://aws-codedeploy-us-east-1/latest/install . --region us-east-1

chmod +x ./install

sudo ./install auto

Please make sure above set of commands depend on the platform you are using, if you are using Amazon's Linux AMI its good to go, for other platforms it may vary.

  1. There might be error in your appspec.yml, if that is the case then you may be able to see that error in which lifecycle event the error is there. To identify that, go to the deployments => select one of the deployments which got failed => go to events => here you will see the error => clicking on that error will display the reason.

If you want to understand in detail how it works, kindly go through my blog here

Please let me know if it doesn't fix your problem.

Upvotes: 1

rocketz
rocketz

Reputation: 21

Before starting the deployment, make sure to check the deployment group to see if there is any healthy instance listed.

Upvotes: 2

Related Questions