Skip to content

Instantly share code, notes, and snippets.

@tunaranch
Created February 18, 2021 00:57
Show Gist options
  • Save tunaranch/6f1cc0c8d858b78beb46a0fa698e5f7c to your computer and use it in GitHub Desktop.
Save tunaranch/6f1cc0c8d858b78beb46a0fa698e5f7c to your computer and use it in GitHub Desktop.
CloudFormation accelerator
strip-extension(){
echo $1| rev | cut -d. -f2 | rev
}
create-stack(){
TEMPLATE_FILE=$1
shift 1;
aws cloudformation create-stack --stack-name \
"$(strip-extension $TEMPLATE_FILE)" \
--template-body file://${TEMPLATE_FILE} "$@"
}
update-stack(){
TEMPLATE_FILE=$1
shift 1;
aws cloudformation update-stack --stack-name \
"$(strip-extension $TEMPLATE_FILE)" \
--template-body file://${TEMPLATE_FILE} "$@"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment