Created
October 30, 2020 07:19
-
-
Save codexponent/afba5229129e2ce8b9a5d2090d46c582 to your computer and use it in GitHub Desktop.
Script to install CodeDeploy agent and associate Elastic IP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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