Created
June 5, 2020 21:09
-
-
Save RichardSilveira/376d863bb3e87fbf3b901eafb2a89898 to your computer and use it in GitHub Desktop.
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 -xe | |
## Code Deploy Agent Bootstrap Script## | |
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 | |
function installdep(){ | |
yum install -y ruby jq | |
} | |
function execute(){ | |
wget https://aws-codedeploy-${REGION}.s3.amazonaws.com/latest/install | |
chmod +x ./install | |
if ./install auto; then | |
echo "Instalation completed" | |
exit 0 | |
else | |
echo "Instalation script failed, please investigate" | |
rm -f /install | |
exit 1 | |
fi | |
} | |
installdep | |
REGION=$(curl -s 169.254.169.254/latest/dynamic/instance-identity/document | jq -r ".region") | |
execute |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment