Skip to content

Instantly share code, notes, and snippets.

@WisaniShilumani
Last active February 25, 2019 10:15
Show Gist options
  • Save WisaniShilumani/5f8a615b20ec0b3d15114171f33f24fe to your computer and use it in GitHub Desktop.
Save WisaniShilumani/5f8a615b20ec0b3d15114171f33f24fe to your computer and use it in GitHub Desktop.
Cloudformation Deploy
NAME=my-sam-package
S3_BUCKET=my-sam-package
RESOURCES=services
ARCHIVE_NAME=resources.zip
TEMPLATE_FILE=sam.yaml
OUTPUT_TEMPLATE_FILE=sam-output.yaml
ENVIRONMENT=production
AWS_PROFILE=default
REGION=us-east-1
STACK_NAME=${ENVIRONMENT}-${NAME}
aws s3 mb s3://${S3_BUCKET} \
--region ${REGION}
aws cloudformation package \
--template-file ${TEMPLATE_FILE} \
--output-template-file ${OUTPUT_TEMPLATE_FILE} \
--s3-bucket ${S3_BUCKET} \
--region ${REGION}
${PROFILE}
aws cloudformation deploy \
--template-file ${OUTPUT_TEMPLATE_FILE} \
--stack-name ${STACK_NAME} \
--capabilities ${CAPABILITIES} \
--region ${REGION} \
${PROFILE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment