Created
February 27, 2019 10:11
-
-
Save tkhk/e9ae10cf5c2082a084c4c35f91eacb4c 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 | |
if [ $# -ne 1 ]; then | |
echo "ERROR: Need profile name" | |
exit 1 | |
fi | |
profile_name=$1 | |
stack_name=$(aws cloudformation list-stacks --profile ${profile_name} --region ap-northeast-1 \ | |
| jq -r '.StackSummaries[] | .StackName + "\t" + .StackStatus' \ | |
| fzf \ | |
| awk '$0=$1') | |
[ -n "$stack_name" ] && aws cloudformation get-template \ | |
--stack-name ${stack_name} \ | |
--profile ${profile_name} \ | |
--region ap-northeast-1 \ | |
| jq -r ".TemplateBody" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment