This script will install the latest version of AWS CodeDeploy agent on your EC2 instance running Ubuntu.
First, let’s create a bash script that will do this for us
Add this into your script:
#!/bin/bash sudo apt-get update sudo apt-get install python-pip python-pip ruby2.0 wget -y cd /home/ubuntu wget https://aws-codedeploy-us-west-2.s3.amazonaws.com/latest/install chmod +x ./install sudo ./install auto sudo service codedeploy-agent status rm install
Make the script executable:
chmod +x install_code_deploy_agent.sh
Execute your script as root:
The only adjustment you may need to make is the S3 URL inside the script that has a region-specific endpoint. In my case, this is us-west-2 region:
Simply update us-west-2 to any other region where CodeDeploy is supported and you should be good to go.