Skip to content

Instantly share code, notes, and snippets.

@codexponent
Created October 30, 2020 07:19
Show Gist options
  • Select an option

  • Save codexponent/afba5229129e2ce8b9a5d2090d46c582 to your computer and use it in GitHub Desktop.

Select an option

Save codexponent/afba5229129e2ce8b9a5d2090d46c582 to your computer and use it in GitHub Desktop.
Script to install CodeDeploy agent and associate Elastic IP
#!/bin/bash
sudo yum update -y
sudo yum install ruby -y
sudo yum install wget -y
cd /home/ec2-user
wget https://aws-codedeploy-us-east-1.s3.us-east-1.amazonaws.com/latest/install
chmod +x ./install
sudo ./install auto
sudo service codedeploy-agent start
aws ec2 disassociate-address --public-ip <Your Allocated IPv4 Address> --region us-east-1
aws ec2 associate-address --instance-id "$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-id)" --allocation-id <Your Allocation ID> --region us-east-1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment