"Just update the stack and see what happens." Not in production. In Part 1 we saw that CloudFormation works out how to reach the state you describe. That includes deciding that a changed property can only be applied by replacing a resource. For a database, replacement means a new instance and, unless you planned for it, the old one is deleted. Change sets let you see that before it happens.
Change sets: a preview
A change set is a preview of an update. You submit a new template or new parameter values, and CloudFormation compares them with the current stack. Nothing changes yet. The change set lists each resource it would:
- Add, Modify or Remove, with a before-and-after view of the properties;
- and for modifications, a Replacement value:
True,FalseorConditional.
Replacement: True on a database, a queue with messages in it, or anything with state is the line to stop and think about.
When a change set is created, CloudFormation also runs pre-deployment validation for common failure causes such as invalid property syntax and resource name conflicts. If the preview looks right, you execute it; if not, you delete it and nothing happened. Validation lowers the risk of a failed update, but it does not guarantee success.
Drift
Drift is the difference between what the stack expects and what really exists. It appears when someone changes a resource outside CloudFormation: opening a port in the console during an incident, or editing a function setting by hand.
Drift detection compares each supported resource in the stack with its live configuration and marks it IN_SYNC, MODIFIED or DELETED (or NOT_CHECKED when it cannot be compared). Running it regularly, or on a schedule, tells you when reality and code have split.
Fixing drift
Since November 2025, drift-aware change sets make a three-way comparison: your new template, the last deployed template, and the actual state of your resources. They show exactly how drift will be handled and can bring drifted resources back in line with the template. There are limits: they do not replace resources to fix drift in immutable properties, and for write-only values such as passwords they compare against the last deployed values.
A common mistake is fixing drift in the console again. Either put the manual change into the template, or let a drift-aware change set revert it, so the code stays the truth.
Where AI fits
When an assistant edits your template, it can produce a change that looks small in the code but replaces a resource. The change set is your review step: read every Replacement: True and every Remove before you execute. AI can help here too, by summarising a long change set, but the decision to execute stays with a person.
Quick recap
- Preview every update with a change set; nothing changes until you execute.
- Watch for drift, and fix it in the template or with a drift-aware change set.
- Read replacements and removals before you execute, especially for AI-made edits.