Skip to content

Instantly share code, notes, and snippets.

@eaconde
Created November 20, 2019 02:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eaconde/16211fd528c2e1e0cf8f5812ea6ce82e to your computer and use it in GitHub Desktop.
Save eaconde/16211fd528c2e1e0cf8f5812ea6ce82e to your computer and use it in GitHub Desktop.
#!/bin/bash
yum -y update
yum install -y ruby aws-cli -y
cd /home/ec2-user
aws s3 cp s3://aws-codedeploy-us-east-1/latest/install . --region us-east-1
chmod +x ./install
./install auto
service codedeploy-agent stop
##adduser username <--- this is only required if you use a username that does not already exist
sed -i 's/""/"ec2-user"/g' /etc/init.d/codedeploy-agent
##sed -i 's/#User=codedeploy/User=ec2-user/g' /usr/lib/systemd/system/codedeploy-agent.service <--- Uncomment this line for Amazon Linux 2
chown ec2-user:ec2-user -R /opt/codedeploy-agent/
chown ec2-user:ec2-user -R /var/log/aws/
service codedeploy-agent start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment