Created
December 23, 2015 10:29
-
-
Save rvedotrc/7374716ccb4e06033d9d 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 | |
stack_name=$1 | |
if [ "${2:-}" == "--update" ] ; then | |
aws cloudformation update-stack \ | |
--stack-name $stack_name \ | |
--template-body "$( cat tmp.template.json )" \ | |
--parameters "$( jq '.Stacks[0].Parameters // []' < tmp.describe.json )" \ | |
--capabilities "$( jq '.Stacks[0].Capabilities // []' < tmp.describe.json )" \ | |
--notification-arns "$( jq '.Stacks[0].NotificationARNs // []' < tmp.describe.json )" \ | |
; | |
rm -i tmp.*.json | |
exit | |
fi | |
aws cloudformation get-template --stack-name $stack_name > tmp.template.json | |
aws cloudformation describe-stacks --stack-name $stack_name > tmp.describe.json | |
jq -M --sort-keys .TemplateBody < tmp.template.json > tmp.template.json.2 | |
mv tmp.template.json.2 tmp.template.json | |
vim tmp.*.json | |
echo Now run vim-stack "$@" --update | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment