aws:aws-deploy_cloudformation_from_cli
Differences
This shows you the differences between two versions of the page.
| aws:aws-deploy_cloudformation_from_cli [15/02/2024 10:09] – created - external edit 127.0.0.1 | aws:aws-deploy_cloudformation_from_cli [30/05/2025 09:44] (current) – removed andrew | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Deploy CloudFormation from cli ====== | ||
| - | |||
| - | This bash script uses aws cli to deploy a stack compared to using the web GUI to create a stack. Main advantage is for automation and repeatability: | ||
| - | |||
| - | <code bash> | ||
| - | #!/bin/bash | ||
| - | #Written Andrew Stringer 01/03/2021 | ||
| - | #Purpose to deploy a cloudformation stack from the cli. | ||
| - | |||
| - | STACK_NAME=' | ||
| - | TEMPLATE_BODY=' | ||
| - | REGION=' | ||
| - | PROFILE=$1 | ||
| - | |||
| - | TAGS=" | ||
| - | |||
| - | echo "Using ${PROFILE}." | ||
| - | |||
| - | #Test $1 exists | ||
| - | if [ -z " | ||
| - | echo "Your AWS Profile is not set, using default" | ||
| - | PROFILE=default | ||
| - | fi | ||
| - | |||
| - | # Who are we? | ||
| - | aws sts get-caller-identity --profile ${PROFILE} | ||
| - | |||
| - | # Deploy the stack | ||
| - | aws cloudformation update-stack --stack-name ${STACK_NAME} --template-body ${TEMPLATE_BODY} --region ${REGION} --profile ${PROFILE} --capabilities CAPABILITY_NAMED_IAM --tags ${TAGS} | ||
| - | |||
| - | </ | ||
aws/aws-deploy_cloudformation_from_cli.1707991761.txt.gz · Last modified: by 127.0.0.1
