Created
June 27, 2017 09:49
-
-
Save jmlrt/2286121c0b7de16bf940d7558c5af9d8 to your computer and use it in GitHub Desktop.
Unattend cloudformation creation
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 -ex | |
export name | |
export template_url=$2 | |
aws cloudformation create-stack --stack-name ${name} --template-url ${template_url} \ | |
# Check StackStatus | |
sleep 120 | |
STATUS=$(aws cloudformation describe-stacks --stack-name ${name} | awk '/StackStatus/ {print $2}') | |
if [[ ${STATUS} =~ ^\"ROLLBACK_ ]] | |
then | |
echo "\n--- ${STATUS} !!!" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment