Created
November 3, 2018 22:46
-
-
Save xhiroga/b414e2fc68a2382c54618d6467e7d118 to your computer and use it in GitHub Desktop.
CloudFomationの勉強を円滑にするための便利スクリプト
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
cmd=$1 | |
stack_name=$2 | |
if [ $cmd = "create" ]; then | |
case $3 in | |
"") echo "Error: Please give a template file path!"; exit 0;; | |
/*) absolute=$3 ;; | |
*) absolute=$PWD/$3 ;; | |
# S3にはこれから対応する、かも | |
esac | |
aws cloudformation create-stack --stack-name $stack_name --template-body file://$absolute | |
elif [ $cmd = "delete" ]; then | |
aws cloudformation delete-stack --stack-name $stack_name | |
elif [ $cmd = "status" ]; then | |
aws cloudformation describe-stacks --stack-name $stack_name | jq .Stacks[] | jq '.StackId, .StackStatus' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment