Stacks, change sets and drift
A stack has a lifecycle
A stack is the deployed management boundary for resources described by a template. Creation, update and deletion are separate operations. The stack records logical-to-physical resource identity and emits events as operations proceed. A template in Git does not modify the stack by itself. For the archive example, changing a tag may update the existing bucket; changing some properties may replace it. Review the exact resource property documentation instead of assuming every update is in-place.
Review a change set before execution
A change set previews proposed additions, modifications and removals. For a modification, inspect whether replacement is True, False or Conditional in the reported change. Example (fictional): Archive — Modify — Replacement: False for a tag update; Archive — Modify — Replacement: True for a change of explicit bucket name. Neither is a live result. A change set is not deployment approval; even with predeployment checks, permissions or runtime constraints can still prevent success. Review the target account/Region, execution role, resource costs and recovery plan; execution is a separate authorized operation.
Detect unmanaged changes
Drift means actual resource configuration differs from what the deployed template and parameter values expect. For example, an operator disables bucket versioning outside CloudFormation. Ordinary drift detection compares supported, explicitly specified properties. It does not inspect every property, every resource or every nested stack automatically. Newer drift-aware change sets can compare actual, previously deployed and desired states for supported resource types; check limitations. If drift is intentional, reconcile it with the template and review a new change set. If unintended, restore the approved state safely. An empty drift report is not a complete security audit.
Nested stacks, StackSets and import
A nested stack is managed as a resource in a parent stack; use it to split a large application template into reusable parts. A StackSet coordinates stack instances across selected accounts and Regions, with separate permission and rollout controls. Do not confuse these with resource import: import brings an eligible existing resource under stack management instead of creating it anew. Verify support, identity, required retention policy and ownership; importing does not prove that the declared properties match reality. Run drift detection where supported after import.
Practice: choose a review decision
A fictional preview lists a tag update with no replacement and a separate bucket replacement. Approve neither blindly: first validate target scope and permissions, then block the replacement until a verified backup, migration and recovery plan exists. If a change set shows Conditional replacement for a data-bearing resource, treat uncertainty as a review blocker. Compare the preview against the last approved template and the observed state; record the reason for your decision.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Stacks, change sets and drift — knowledge check
Review a fictional infrastructure change without deploying AWS resources.
A reviewed template in Git has not been submitted to AWS. What happened to the stack?
A change set reports Conditional replacement for a data-bearing bucket. What is the next step?
An operator suspended bucket versioning directly. The deployed template explicitly says Enabled. What does this illustrate?
Which feature coordinates stack instances across selected accounts and Regions?
What should happen after importing a supported existing resource?