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
Validate a template
aws cloudformation validate-template --template-body file://template.yaml

# Check a template for basic syntax and structural validity.

Create a stack
aws cloudformation create-stack --stack-name app-prod --template-body file://template.yaml --capabilities CAPABILITY_NAMED_IAM

# Create a CloudFormation stack from a local template.

Update a stack
aws cloudformation update-stack --stack-name app-prod --template-body file://template.yaml --capabilities CAPABILITY_NAMED_IAM

# Update an existing stack with a new template or parameters.

Deploy a stack with package-style semantics
aws cloudformation deploy --stack-name app-prod --template-file template.yaml --capabilities CAPABILITY_NAMED_IAM

# Create or update a stack using `deploy`.

Describe stacks
aws cloudformation describe-stacks --stack-name app-prod

# Inspect stack status and outputs.

Delete a stack
aws cloudformation delete-stack --stack-name app-prod

# Remove a CloudFormation stack.

Wait for stack create complete
aws cloudformation wait stack-create-complete --stack-name app-prod

# Block until a stack finishes creating.

Wait for stack update complete
aws cloudformation wait stack-update-complete --stack-name app-prod

# Block until a stack finishes updating.

## Change Sets and Events
Create a change set
aws cloudformation create-change-set --stack-name app-prod --change-set-name preview-001 --template-body file://template.yaml --capabilities CAPABILITY_NAMED_IAM

# Preview stack changes before execution.

Describe a change set
aws cloudformation describe-change-set --stack-name app-prod --change-set-name preview-001

# Inspect the changes proposed for a stack.

Execute a change set
aws cloudformation execute-change-set --stack-name app-prod --change-set-name preview-001

# Apply the changes in an existing change set.

Describe stack events
aws cloudformation describe-stack-events --stack-name app-prod

# Read the event history for a stack.

List stack resources
aws cloudformation list-stack-resources --stack-name app-prod

# Show resources managed by a stack.

Get template summary
aws cloudformation get-template-summary --template-body file://template.yaml

# Return parameter and capability requirements for a template.

## Packaging and Artifact Flows
Package local artifacts
aws cloudformation package --template-file template.yaml --s3-bucket my-cfn-artifacts --output-template-file packaged.yaml

# Upload local artifacts and rewrite a template.

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

# Pass parameters at deployment time.

Deploy without failing on empty change set
aws cloudformation deploy --stack-name app-prod --template-file packaged.yaml --no-fail-on-empty-changeset

# Treat no-op deployments as success.

Recommended next

No recommendations yet.