Skip to content

Instantly share code, notes, and snippets.

@jmlrt
Created June 27, 2017 09:49
Show Gist options
  • Save jmlrt/2286121c0b7de16bf940d7558c5af9d8 to your computer and use it in GitHub Desktop.
Save jmlrt/2286121c0b7de16bf940d7558c5af9d8 to your computer and use it in GitHub Desktop.
Unattend cloudformation creation
#!/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