I am trying to deploy my application using CodeDeploy but each time I encounter, Deployment Failed message with additional information attached that says : No hosts succeeded. (Error code: HEALTH_CONSTRAINTS).
I do not understand the reason for this. Following are the steps performed in order:
I launched instance with an IAM role that has 2 policies attached
AmazonEC2FullAccessandAmazonS3FullAccess. The later policy suggests the following:{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "s3:*", "Resource": "*" } ] }While launching the instance from the aws console, I had specified the following in the advanced section : (as text selected)
apt-get -y update apt-get -y install awscli apt-get -y install ruby2.0 cd /home/ubuntu aws s3 cp s3://aws-codedeploy-us-west-2/latest/install . --region us-west-2 chmod +x ./install ./install autoTo push the code, I wrote:
aws deploy push --application-name CDTestApp --s3-location s3://codedeploy-test-bucket-pc/PC.zip --source PulsarCloud/To deploy, I wrote:
aws deploy create-deployment --application-name CDTestApp --s3-location bucket=codedeploy-test-bucket-pc,key=PC.zip,bundleType zip,eTag="834db424710b1819b753444460dd361d" --deployment-group-name CDGroup --deployment-config-name CodeDeployDefault.OneAtATime --description MyTestApplicationI got the
deployment idin return.After sometime, the deployment turns into a failure!
appspec.yml:
version: 0.0 os: linux files: - source: /sdk/js/index.html destination: /var/www/html hooks: BeforeInstall: - location: /installerassets/installer.sh timeout: 6000 runas: root
What could be the reason for this?
When I logged into the machine and entered:
sudo service codedeploy-agent status I got : codedeploy-agent: unrecognized service
But then I tried to re-install it using the steps here. The service is running, but cannot deploy the code.
sudo service codedeploy-agent statusto work or not?