Stack operations and recovery
- Work through concepts, commands and troubleshooting in all eight modules.
- Review changesets and verify resource lifecycle behavior in a sandbox.
- Explain deployment results using stack events, outputs and service evidence.
1-hour schedule
| # | Time | Module | Core content | Learning views |
|---|---|---|---|---|
| 1 | 00–06 · 6 min | Create, update and delete | Understand stack operation commands, capabilities and no-op updates. | Concepts, commands, lab, production and troubleshooting |
| 2 | 06–13 · 7 min | Change set workflow | Create and inspect proposed changes before execution. | Concepts, commands, lab, production and troubleshooting |
| 3 | 13–21 · 8 min | Replacement and impact review | Review resource-level actions, replacements, deletes and property changes. | Concepts, commands, lab, production and troubleshooting |
| 4 | 21–29 · 8 min | Events and status reasons | Locate the first failure and separate root causes from cascading events. | Concepts, commands, lab, production and troubleshooting |
| 5 | 29–37 · 8 min | Rollback behavior | Understand automatic rollback, disabled rollback and retained resources. | Concepts, commands, lab, production and troubleshooting |
| 6 | 37–45 · 8 min | Continue update rollback | Recover UPDATE_ROLLBACK_FAILED stacks after fixing the underlying cause. | Concepts, commands, lab, production and troubleshooting |
| 7 | 45–52 · 7 min | Drift-aware change review | Check unmanaged changes before risky updates and reconcile safely. | Concepts, commands, lab, production and troubleshooting |
| 8 | 52–60 · 8 min | Safe deletion and cleanup | Plan stack deletion, retained-resource inventory and cost cleanup. | Concepts, commands, lab, production and troubleshooting |
How to use this course
Each module includes concepts, a diagram, a walkthrough, commands, a lab, a production case, troubleshooting, a quiz, narration and official references. Progress is saved in this browser.
Lab requirements: AWS CLI v2, a sandbox account and least-privilege permissions. Verify account/Region before labs and clean up afterward.
Setup
Prepare AWS CLI v2, a sandbox account and deployment permissions. Verify identity and Region; do not run labs in a production account.
aws --version
aws sts get-caller-identity --profile sandbox
aws configure list --profile sandboxLabs may create resources. Follow each lab's cleanup steps and verify stack status when finished.
Create, update and delete
Core concepts
Understand stack operation commands, capabilities and no-op updates.
- Check the resource reference for properties and update behavior.
- Make the relationship between template, parameters, execution identity and target environment explicit.
- Record an observable expected result and cleanup method.
Request path
Template → Validate → Change set → Review → Execute → Create, update and delete → Verify eventsKeep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.
Deployment state sequence
- Identify the requirement: Create, update and delete
- Validate the inputs and inspect the proposed resource action
- Execute in a sandbox and verify the resulting stack events
Commands and notes
aws cloudformation create-stack --stack-name app-dev --template-body file://template.yamlConfirm profile, account and Region first. Replace example names with sandbox resources.
Hands-on lab
Apply this module to a disposable sandbox stack. Record the input, command, expected CloudFormation event or result, and cleanup step. Verify the outcome before moving to the next module: Understand stack operation commands, capabilities and no-op updates.
- Run the command and save its output.
- Compare it with the expected result and record differences.
- Delete the lab stack and confirm there are no leftover resources.
Production case review
Production review: make this behavior explicit in the template and change review. Confirm ownership, blast radius, rollback or retention behavior, and the evidence an operator can use during an incident. Topic: Understand stack operation commands, capabilities and no-op updates.
Troubleshooting path
If the operation fails, capture the stack status, logical resource ID and earliest failed event. Separate template, permission, quota, service stabilization and dependency causes; fix the source, then create a fresh change set before retrying. Topic: Understand stack operation commands, capabilities and no-op updates.
aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1Narration script
Understand stack operation commands, capabilities and no-op updates.
The key is to record the desired state in a template, execute it through a stack, and use event evidence to verify the result.
Official learning resources
Work through the AWS User Guide and CloudFormation Workshop. This lesson emphasizes reviewable text-based labs.
Change set workflow
Core concepts
Create and inspect proposed changes before execution.
- Check the resource reference for properties and update behavior.
- Make the relationship between template, parameters, execution identity and target environment explicit.
- Record an observable expected result and cleanup method.
Request path
Template → Validate → Change set → Review → Execute → Change set workflow → Verify eventsKeep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.
Deployment state sequence
- Identify the requirement: Change set workflow
- Validate the inputs and inspect the proposed resource action
- Execute in a sandbox and verify the resulting stack events
Commands and notes
aws cloudformation create-change-set --stack-name app-dev --change-set-name review-1 --change-set-type UPDATE --template-body file://template.yamlConfirm profile, account and Region first. Replace example names with sandbox resources.
Hands-on lab
Apply this module to a disposable sandbox stack. Record the input, command, expected CloudFormation event or result, and cleanup step. Verify the outcome before moving to the next module: Create and inspect proposed changes before execution.
- Run the command and save its output.
- Compare it with the expected result and record differences.
- Delete the lab stack and confirm there are no leftover resources.
Production case review
Production review: make this behavior explicit in the template and change review. Confirm ownership, blast radius, rollback or retention behavior, and the evidence an operator can use during an incident. Topic: Create and inspect proposed changes before execution.
Troubleshooting path
If the operation fails, capture the stack status, logical resource ID and earliest failed event. Separate template, permission, quota, service stabilization and dependency causes; fix the source, then create a fresh change set before retrying. Topic: Create and inspect proposed changes before execution.
aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1Narration script
Create and inspect proposed changes before execution.
The key is to record the desired state in a template, execute it through a stack, and use event evidence to verify the result.
Official learning resources
Work through the AWS User Guide and CloudFormation Workshop. This lesson emphasizes reviewable text-based labs.
Replacement and impact review
Core concepts
Review resource-level actions, replacements, deletes and property changes.
- Check the resource reference for properties and update behavior.
- Make the relationship between template, parameters, execution identity and target environment explicit.
- Record an observable expected result and cleanup method.
Request path
Template → Validate → Change set → Review → Execute → Replacement and impact review → Verify eventsKeep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.
Deployment state sequence
- Identify the requirement: Replacement and impact review
- Validate the inputs and inspect the proposed resource action
- Execute in a sandbox and verify the resulting stack events
Commands and notes
aws cloudformation describe-change-set --stack-name app-dev --change-set-name review-1Confirm profile, account and Region first. Replace example names with sandbox resources.
Hands-on lab
Apply this module to a disposable sandbox stack. Record the input, command, expected CloudFormation event or result, and cleanup step. Verify the outcome before moving to the next module: Review resource-level actions, replacements, deletes and property changes.
- Run the command and save its output.
- Compare it with the expected result and record differences.
- Delete the lab stack and confirm there are no leftover resources.
Production case review
Production review: make this behavior explicit in the template and change review. Confirm ownership, blast radius, rollback or retention behavior, and the evidence an operator can use during an incident. Topic: Review resource-level actions, replacements, deletes and property changes.
Troubleshooting path
If the operation fails, capture the stack status, logical resource ID and earliest failed event. Separate template, permission, quota, service stabilization and dependency causes; fix the source, then create a fresh change set before retrying. Topic: Review resource-level actions, replacements, deletes and property changes.
aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1Narration script
Review resource-level actions, replacements, deletes and property changes.
The key is to record the desired state in a template, execute it through a stack, and use event evidence to verify the result.
Official learning resources
Work through the AWS User Guide and CloudFormation Workshop. This lesson emphasizes reviewable text-based labs.
Events and status reasons
Core concepts
Locate the first failure and separate root causes from cascading events.
- Check the resource reference for properties and update behavior.
- Make the relationship between template, parameters, execution identity and target environment explicit.
- Record an observable expected result and cleanup method.
Request path
Template → Validate → Change set → Review → Execute → Events and status reasons → Verify eventsKeep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.
Deployment state sequence
- Identify the requirement: Events and status reasons
- Validate the inputs and inspect the proposed resource action
- Execute in a sandbox and verify the resulting stack events
Commands and notes
aws cloudformation describe-stack-events --stack-name app-dev --max-items 30Confirm profile, account and Region first. Replace example names with sandbox resources.
Hands-on lab
Apply this module to a disposable sandbox stack. Record the input, command, expected CloudFormation event or result, and cleanup step. Verify the outcome before moving to the next module: Locate the first failure and separate root causes from cascading events.
- Run the command and save its output.
- Compare it with the expected result and record differences.
- Delete the lab stack and confirm there are no leftover resources.
Production case review
Production review: make this behavior explicit in the template and change review. Confirm ownership, blast radius, rollback or retention behavior, and the evidence an operator can use during an incident. Topic: Locate the first failure and separate root causes from cascading events.
Troubleshooting path
If the operation fails, capture the stack status, logical resource ID and earliest failed event. Separate template, permission, quota, service stabilization and dependency causes; fix the source, then create a fresh change set before retrying. Topic: Locate the first failure and separate root causes from cascading events.
aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1Narration script
Locate the first failure and separate root causes from cascading events.
The key is to record the desired state in a template, execute it through a stack, and use event evidence to verify the result.
Official learning resources
Work through the AWS User Guide and CloudFormation Workshop. This lesson emphasizes reviewable text-based labs.
Rollback behavior
Core concepts
Understand automatic rollback, disabled rollback and retained resources.
- Check the resource reference for properties and update behavior.
- Make the relationship between template, parameters, execution identity and target environment explicit.
- Record an observable expected result and cleanup method.
Request path
Template → Validate → Change set → Review → Execute → Rollback behavior → Verify eventsKeep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.
Deployment state sequence
- Identify the requirement: Rollback behavior
- Validate the inputs and inspect the proposed resource action
- Execute in a sandbox and verify the resulting stack events
Commands and notes
aws cloudformation describe-stacks --stack-name app-dev --query Stacks[0].StackStatusConfirm profile, account and Region first. Replace example names with sandbox resources.
Hands-on lab
Apply this module to a disposable sandbox stack. Record the input, command, expected CloudFormation event or result, and cleanup step. Verify the outcome before moving to the next module: Understand automatic rollback, disabled rollback and retained resources.
- Run the command and save its output.
- Compare it with the expected result and record differences.
- Delete the lab stack and confirm there are no leftover resources.
Production case review
Production review: make this behavior explicit in the template and change review. Confirm ownership, blast radius, rollback or retention behavior, and the evidence an operator can use during an incident. Topic: Understand automatic rollback, disabled rollback and retained resources.
Troubleshooting path
If the operation fails, capture the stack status, logical resource ID and earliest failed event. Separate template, permission, quota, service stabilization and dependency causes; fix the source, then create a fresh change set before retrying. Topic: Understand automatic rollback, disabled rollback and retained resources.
aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1Narration script
Understand automatic rollback, disabled rollback and retained resources.
The key is to record the desired state in a template, execute it through a stack, and use event evidence to verify the result.
Official learning resources
Work through the AWS User Guide and CloudFormation Workshop. This lesson emphasizes reviewable text-based labs.
Continue update rollback
Core concepts
Recover UPDATE_ROLLBACK_FAILED stacks after fixing the underlying cause.
- Check the resource reference for properties and update behavior.
- Make the relationship between template, parameters, execution identity and target environment explicit.
- Record an observable expected result and cleanup method.
Request path
Template → Validate → Change set → Review → Execute → Continue update rollback → Verify eventsKeep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.
Deployment state sequence
- Identify the requirement: Continue update rollback
- Validate the inputs and inspect the proposed resource action
- Execute in a sandbox and verify the resulting stack events
Commands and notes
aws cloudformation continue-update-rollback --stack-name app-devConfirm profile, account and Region first. Replace example names with sandbox resources.
Hands-on lab
Apply this module to a disposable sandbox stack. Record the input, command, expected CloudFormation event or result, and cleanup step. Verify the outcome before moving to the next module: Recover UPDATE_ROLLBACK_FAILED stacks after fixing the underlying cause.
- Run the command and save its output.
- Compare it with the expected result and record differences.
- Delete the lab stack and confirm there are no leftover resources.
Production case review
Production review: make this behavior explicit in the template and change review. Confirm ownership, blast radius, rollback or retention behavior, and the evidence an operator can use during an incident. Topic: Recover UPDATE_ROLLBACK_FAILED stacks after fixing the underlying cause.
Troubleshooting path
If the operation fails, capture the stack status, logical resource ID and earliest failed event. Separate template, permission, quota, service stabilization and dependency causes; fix the source, then create a fresh change set before retrying. Topic: Recover UPDATE_ROLLBACK_FAILED stacks after fixing the underlying cause.
aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1Narration script
Recover UPDATE_ROLLBACK_FAILED stacks after fixing the underlying cause.
The key is to record the desired state in a template, execute it through a stack, and use event evidence to verify the result.
Official learning resources
Work through the AWS User Guide and CloudFormation Workshop. This lesson emphasizes reviewable text-based labs.
Drift-aware change review
Core concepts
Check unmanaged changes before risky updates and reconcile safely.
- Check the resource reference for properties and update behavior.
- Make the relationship between template, parameters, execution identity and target environment explicit.
- Record an observable expected result and cleanup method.
Request path
Template → Validate → Change set → Review → Execute → Drift-aware change review → Verify eventsKeep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.
Deployment state sequence
- Identify the requirement: Drift-aware change review
- Validate the inputs and inspect the proposed resource action
- Execute in a sandbox and verify the resulting stack events
Commands and notes
aws cloudformation detect-stack-drift --stack-name app-devConfirm profile, account and Region first. Replace example names with sandbox resources.
Hands-on lab
Apply this module to a disposable sandbox stack. Record the input, command, expected CloudFormation event or result, and cleanup step. Verify the outcome before moving to the next module: Check unmanaged changes before risky updates and reconcile safely.
- Run the command and save its output.
- Compare it with the expected result and record differences.
- Delete the lab stack and confirm there are no leftover resources.
Production case review
Production review: make this behavior explicit in the template and change review. Confirm ownership, blast radius, rollback or retention behavior, and the evidence an operator can use during an incident. Topic: Check unmanaged changes before risky updates and reconcile safely.
Troubleshooting path
If the operation fails, capture the stack status, logical resource ID and earliest failed event. Separate template, permission, quota, service stabilization and dependency causes; fix the source, then create a fresh change set before retrying. Topic: Check unmanaged changes before risky updates and reconcile safely.
aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1Narration script
Check unmanaged changes before risky updates and reconcile safely.
The key is to record the desired state in a template, execute it through a stack, and use event evidence to verify the result.
Official learning resources
Work through the AWS User Guide and CloudFormation Workshop. This lesson emphasizes reviewable text-based labs.
Safe deletion and cleanup
Core concepts
Plan stack deletion, retained-resource inventory and cost cleanup.
- Check the resource reference for properties and update behavior.
- Make the relationship between template, parameters, execution identity and target environment explicit.
- Record an observable expected result and cleanup method.
Request path
Template → Validate → Change set → Review → Execute → Safe deletion and cleanup → Verify eventsKeep reviewable inputs and results at each stage; a change set does not apply proposed changes until execution.
Deployment state sequence
- Identify the requirement: Safe deletion and cleanup
- Validate the inputs and inspect the proposed resource action
- Execute in a sandbox and verify the resulting stack events
Commands and notes
aws cloudformation delete-stack --stack-name cfn-labConfirm profile, account and Region first. Replace example names with sandbox resources.
Hands-on lab
Apply this module to a disposable sandbox stack. Record the input, command, expected CloudFormation event or result, and cleanup step. Verify the outcome before moving to the next module: Plan stack deletion, retained-resource inventory and cost cleanup.
- Run the command and save its output.
- Compare it with the expected result and record differences.
- Delete the lab stack and confirm there are no leftover resources.
Production case review
Production review: make this behavior explicit in the template and change review. Confirm ownership, blast radius, rollback or retention behavior, and the evidence an operator can use during an incident. Topic: Plan stack deletion, retained-resource inventory and cost cleanup.
Troubleshooting path
If the operation fails, capture the stack status, logical resource ID and earliest failed event. Separate template, permission, quota, service stabilization and dependency causes; fix the source, then create a fresh change set before retrying. Topic: Plan stack deletion, retained-resource inventory and cost cleanup.
aws cloudformation describe-stack-events --stack-name app-dev --region us-east-1Narration script
Plan stack deletion, retained-resource inventory and cost cleanup.
The key is to record the desired state in a template, execute it through a stack, and use event evidence to verify the result.
Official learning resources
Work through the AWS User Guide and CloudFormation Workshop. This lesson emphasizes reviewable text-based labs.
Cheat sheet
Command card
aws sts get-caller-identity
aws cloudformation validate-template --template-body file://template.yaml
aws cloudformation deploy --template-file template.yaml --stack-name app-dev
aws cloudformation describe-stacks --stack-name app-dev
aws cloudformation describe-stack-events --stack-name app-dev
aws cloudformation detect-stack-drift --stack-name app-dev
aws cloudformation delete-stack --stack-name app-devBefore an update
- Confirm account, Region, profile and execution role.
- Review replacements, deletions and retention behavior in the change set.
- Check drift, backups, alarms and rollback ownership.
Capstone lab and final quiz
Lab: review and deploy a controlled stack
Open the runnable SQS capstone lab and template ↗
- Write a template with a low-risk resource and parameterize the environment name.
- Run template checks, create a change set and review resource actions.
- Execute the change set in a sandbox and inspect stack events and outputs.
- Run drift detection, then clean up resources according to retention policy.
Final quiz
Sources and version notes
CloudFormation resource properties and CLI behavior evolve. Check current AWS documentation before deployment.