Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This stupid simple function exists to make it more obvious when a Cloudformation stack is finished doing its thing.
- # I'm barely proficient with bash so if there's a better way to do stuff let me know. This is my life's work so I'll definitely be responsive and update this immediately.
- # Usage: cfnw [command] <stack_name>
- # Default command is c = create, d = delete and u = update are also available
- cfnw() {
- declare -A commands
- commands=(["c"]="create" ["d"]="delete" ["u"]="update")
- [[ $# = 2 ]] && command="${commands[$1]}" || command="create"
- [[ $# = 2 ]] && stack=$2 || stack=$1
- echo "Checking to see if $command is done for stack $stack"
- output=$((aws cloudformation wait stack-$command-complete --stack-name $stack) 2>&1)
- if [[ $output == *"failed"* ]]; then
- cowsay $stack $command 'failed!'
- else
- cowsay $stack $command 'done!'
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement