diff options
Diffstat (limited to 'tools/bin/deploy-stack.sh')
-rwxr-xr-x | tools/bin/deploy-stack.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tools/bin/deploy-stack.sh b/tools/bin/deploy-stack.sh new file mode 100755 index 0000000..06faf80 --- /dev/null +++ b/tools/bin/deploy-stack.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env sh + +set -ex + +STACK_NAME=blog-kennyballou +REGION=us-east-1 + +function deploy() { + aws cloudformation \ + --region ${REGION} \ + create-stack \ + --stack-name ${STACK_NAME} \ + --capabilities CAPABILITY_NAMED_IAM \ + --template-body file://$(pwd)/_build/${REGION}/stacks/blog.template +} + +function undeploy() { + aws cloudformation \ + --region ${REGION} \ + delete-stack \ + --stack-name ${STACK_NAME} +} + +function changeset() { + aws cloudformation \ + --region ${REGION} \ + create-change-set \ + --stack-name ${STACK_NAME} \ + --change-set-name ${STACK_NAME}-$(uuidgen) \ + --capabilities CAPABILITY_NAMED_IAM \ + --template-body file://$(pwd)/_build/${REGION}/stacks/blog.template +} + +case $1 in + deploy) + deploy + ;; + changeset) + changeset + ;; + undeploy) + undeploy + ;; +esac |