December 13, 2017

Install CodeDeploy agent on EC2 Instance


 Code Snippet to install code deploy agent

When you provision EC2 instance for deployment to be done by AWS CodeDeploy, that EC2 instance should have CodeDeploy agent for deployment to proceed. https://docs.aws.amazon.com/codedeploy/latest/userguide/codedeploy-agent-operations-install-linux.html 

Option 1:


            yum update -y
            yum install -y ruby
            yum install wget

            cd /home/ec2-user

            wget https://aws-codedeploy-${AWS::Region}.s3.amazonaws.com/latest/install

            chmod +x ./install
            ./install auto  

service codedeploy-agent status 
service codedeploy-agent start


Option 2:


yum update -y 
            yum install -y ruby aws-cli 
  
            cd /home/ec2-user 
            aws s3 cp s3://aws-codedeploy-us-east-1/latest/install . --region us-east-1 
            chmod +x ./install 
./install auto

Note: Use sudo, if elevated privilege is required.

No comments:

Post a Comment