AWS CLI CloudFormation Cheat Sheet

AWS CLI CloudFormation commands for templates, stacks, change sets, events, package, and deploy workflows.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all

Stacks

Create, update, inspect, and delete CloudFormation stacks.

Validate a template

Check a template for basic syntax and structural validity.

bashANYawscloudformationtemplate
bash
aws cloudformation validate-template --template-body file://template.yaml
Notes

Good preflight check before create or update.

Create a stack

Create a CloudFormation stack from a local template.

bashANYawscloudformationstackcreate
bash
aws cloudformation create-stack --stack-name app-prod --template-body file://template.yaml --capabilities CAPABILITY_NAMED_IAM
Notes

Use `--parameters` for runtime values and acknowledge IAM capability when needed.

Update a stack

Update an existing stack with a new template or parameters.

bashANYawscloudformationstackupdate
bash
aws cloudformation update-stack --stack-name app-prod --template-body file://template.yaml --capabilities CAPABILITY_NAMED_IAM
Notes

Fails with a no-op error if there are no changes.

Deploy a stack with package-style semantics

Create or update a stack using `deploy`.

bashANYawscloudformationdeploy
bash
aws cloudformation deploy --stack-name app-prod --template-file template.yaml --capabilities CAPABILITY_NAMED_IAM
Notes

A very convenient wrapper for common stack deployment workflows.

Describe stacks

Inspect stack status and outputs.

bashANYawscloudformationstack
bash
aws cloudformation describe-stacks --stack-name app-prod
Notes

Useful for checking outputs, status, and rollback information.

Delete a stack

Remove a CloudFormation stack.

bashANYawscloudformationstackdelete
bash
aws cloudformation delete-stack --stack-name app-prod
Notes

Deletes managed resources unless protected or retained.

Wait for stack create complete

Block until a stack finishes creating.

bashANYawscloudformationwaiter
bash
aws cloudformation wait stack-create-complete --stack-name app-prod
Notes

Useful in scripts and CI/CD flows.

Wait for stack update complete

Block until a stack finishes updating.

bashANYawscloudformationwaiter
bash
aws cloudformation wait stack-update-complete --stack-name app-prod
Notes

Lets automation wait for a known-good terminal state.

Change Sets and Events

Preview changes and inspect deployment history.

Create a change set

Preview stack changes before execution.

bashANYawscloudformationchange-set
bash
aws cloudformation create-change-set --stack-name app-prod --change-set-name preview-001 --template-body file://template.yaml --capabilities CAPABILITY_NAMED_IAM
Notes

Useful in controlled production deploy pipelines.

Describe a change set

Inspect the changes proposed for a stack.

bashANYawscloudformationchange-set
bash
aws cloudformation describe-change-set --stack-name app-prod --change-set-name preview-001
Notes

Shows which resources will be added, modified, or replaced.

Execute a change set

Apply the changes in an existing change set.

bashANYawscloudformationchange-set
bash
aws cloudformation execute-change-set --stack-name app-prod --change-set-name preview-001
Notes

Use after reviewing the proposed modifications.

Describe stack events

Read the event history for a stack.

bashANYawscloudformationevents
bash
aws cloudformation describe-stack-events --stack-name app-prod
Notes

Essential for troubleshooting failed creates and updates.

List stack resources

Show resources managed by a stack.

bashANYawscloudformationresources
bash
aws cloudformation list-stack-resources --stack-name app-prod
Notes

Helpful when mapping logical resources to physical IDs.

Get template summary

Return parameter and capability requirements for a template.

bashANYawscloudformationtemplate
bash
aws cloudformation get-template-summary --template-body file://template.yaml
Notes

Useful in tooling that needs to introspect a template before deployment.

Packaging and Artifact Flows

Package local artifacts for deployment-ready templates.

Package local artifacts

Upload local artifacts and rewrite a template.

bashANYawscloudformationpackage
bash
aws cloudformation package --template-file template.yaml --s3-bucket my-cfn-artifacts --output-template-file packaged.yaml
Notes

Useful when templates reference local Lambda zips or nested templates.

Deploy with parameter overrides

Pass parameters at deployment time.

bashANYawscloudformationdeployparameters
bash
aws cloudformation deploy --stack-name app-prod --template-file packaged.yaml --parameter-overrides Env=prod ImageTag=2026-03-05
Notes

Common CI/CD deployment pattern for environment-specific values.

Deploy without failing on empty change set

Treat no-op deployments as success.

bashANYawscloudformationdeploy
bash
aws cloudformation deploy --stack-name app-prod --template-file packaged.yaml --no-fail-on-empty-changeset
Notes

Convenient in pipelines where idempotent deploys are expected.

Recommended next

No recommendations yet.