Course contentsShow
← Cloud and Infrastructure
Lesson 878 of 2,98916. AWS CloudFormationFree lesson

Stack Updates and Change Sets

Understand how to update existing stacks and use change sets to preview changes before applying them.

Stack Updates and Change Sets

What You'll Learn

You'll learn how to safely modify your existing CloudFormation stacks and preview changes before they take effect.

Understanding Stack Updates

When your infrastructure needs change, you don't create a new stack from scratch—you update the existing one. Think of it like editing a document: you modify what needs changing while keeping everything else intact.

When you update a stack, CloudFormation compares your new template with the current stack and determines what needs to be added, modified, or removed. Some updates happen with no disruption, while others might require resource replacement (like changing an EC2 instance type).

What Are Change Sets?

A change set is like a "preview" or "diff" of your proposed changes. Before applying updates, you can create a change set to see exactly what CloudFormation will do:

  • Which resources will be added, modified, or deleted
  • Whether changes require replacement (causing downtime)
  • The specific attributes that will change

This is crucial for production environments where surprises can be costly.

The Safe Update Workflow

  1. Modify your template with the desired changes
  2. Create a change set to preview the impact
  3. Review the change set carefully for unexpected modifications or replacements
  4. Execute the change set if everything looks correct, or discard it if not

Change sets let you answer "what if?" questions without risking your live infrastructure. They're especially valuable when multiple team members review changes before deployment.

When Updates Happen

Stack updates occur when you modify resources, add new ones, or change parameters you've already set. CloudFormation intelligently handles dependencies and update order.

Key Takeaway: Change sets provide a safety net for stack updates, letting you preview and validate infrastructure changes before applying them to production.