Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save SystemicEmotions/ba19bc4beb29cf9e871b0f2cff49c367 to your computer and use it in GitHub Desktop.
Save SystemicEmotions/ba19bc4beb29cf9e871b0f2cff49c367 to your computer and use it in GitHub Desktop.
EC2 UserData script to install CodeDeploy agent
#!/bin/bash
yum install -y aws-cli
cd /home/ec2-user/
aws s3 cp 's3://aws-codedeploy-us-east-1/latest/codedeploy-agent.noarch.rpm' . --region us-east-1
yum -y install codedeploy-agent.noarch.rpm
@SystemicEmotions
Copy link
Author

I tried the same with aws latest AMI, however it failed to install codedeploy agent since ruby was missing.

13.989572] cloud-init[3280]: AWS CodeDeploy needs Ruby version 2.0 or above to be installed for under /usr/bin
[ 13.996968] cloud-init[3280]: Please install Ruby 2.x for user
[ 14.001774] cloud-init[3280]: ==========================================================================================
[ 14.009420] cloud-init[3280]: error: %pre(codedeploy-agent-1.0-1.1518.noarch) scriptlet failed, exit status 1
[ 14.017808] cloud-init[3280]: Error in PREIN scriptlet in rpm package codedeploy-agent-1.0-1.1518.noarch
[ 14.044508] cloud-init[3280]: Verifying : codedeploy-agent-1.0-1.1518.noarch 1/1
[ 14.058017] cloud-init[3280]: Failed:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment