- CloudFormation drift detection for StackSets
- How stack instance divergence is reported across accounts and regions
- Correcting drift and validating compliance
Step 1 — Start drift detection on the StackSet
- Open the AWS CloudFormation console and select your StackSet.
- From the Actions menu choose Detect drift.
- The console will request and begin the detection. Depending on the number of stack instances (across accounts and regions), detection may take several minutes.
Detect drift at the StackSet level compares the StackSet template configuration against each stack instance managed by that StackSet. Results are reported at both the StackSet and stack instance levels across accounts and regions.

Step 2 — Simulate drift with an out-of-band change
To simulate a drift scenario, make a manual edit to one of the S3 buckets that is not reflected in the StackSet template:- Open the bucket in the S3 console.
- Go to Properties → Tags.
- Add a tag that is not part of the StackSet template (for example, Key: developer, Value: Arno).
- Save the changes.
Step 3 — Re-run drift detection on the StackSet
- Return to the CloudFormation StackSets console.
- Select the StackSet, open Actions, and choose Detect drift again.
- Wait for the detection job to complete, then refresh the StackSet view.

Step 4 — Revert the change and confirm IN_SYNC
To resolve the detected drift:- Remove the extra tag you added to the S3 bucket so it matches the template again.
- In the StackSet console, run Detect drift from Actions and wait for completion.
- After the detection finishes, verify that both the stack instance and the StackSet status have returned to IN_SYNC.
Drift detection is read-only and only identifies differences. To remediate drift at scale, use StackSet operations such as Update StackSet or targeted stack instance operations to bring instances back into compliance with the template.
Drift status quick reference
| Drift status | Meaning | Suggested action |
|---|---|---|
| IN_SYNC | Live resources match the CloudFormation template | No action required |
| DRIFTED | One or more resources in a stack instance differ from the template | Investigate and reconcile (manual or StackSet update) |
| NOT_CHECKED | Detection has not been run for the StackSet or instance | Run Detect drift from the console or API |