Drift detection is read-only — it does not modify or reconcile resources. To restore alignment you must update the stack (via CloudFormation) or manually change the live resource to match the template.
Example template used in this demo
The sample CloudFormation template below creates an S3 bucket and assigns a single tagAuthor: Arno:
How drift detection works (console workflow)
To run drift detection from the CloudFormation console:- Open the CloudFormation console and select the stack you want to inspect.
- From the stack’s top-right Stack actions menu choose View drift results.
- On the Drift Results page click Detect stack drift.
NOT_CHECKED and resource-level statuses will also show NOT_CHECKED until detection runs.
After initiating detection, CloudFormation performs read-only checks against the live resources. You will get a notification that drift detection was initiated for your stack.

Example detection outcomes
After the check completes, the stack and resource statuses are updated. If the live resources match the template, you will seeIN_SYNC:
Author: Arno tag. That change causes a drift because the live resource no longer matches the template.
Re-running drift detection will report the stack as DRIFTED and the S3 resource as MODIFIED because the tags differ from what’s declared in the template.
To bring the stack back in sync, update the live resource so it matches the template — for example, add the Author: Arno tag back to the bucket (key and value must match exactly), then run drift detection again. Once the live resource matches the template, statuses return to IN_SYNC.

Common statuses and meanings
CLI and SDK options
You can also run drift detection programmatically:-
AWS CLI:
aws cloudformation detect-stack-drift --stack-name <STACK_NAME>
See the AWS CLI docs: https://docs.aws.amazon.com/cli/latest/reference/cloudformation/detect-stack-drift.html -
AWS SDKs: Use the CloudFormation API
DetectStackDriftand related API calls. See https://aws.amazon.com/tools/
Best practices and limitations
Not all CloudFormation resource properties are supported by drift detection. Always consult the CloudFormation documentation for the specific resource to confirm which properties are detectable. Relying solely on drift detection for compliance can miss unsupported property changes.
- Run drift detection regularly for critical stacks to catch out-of-band changes.
- Combine drift detection with change-control processes and IAM controls to limit direct edits to resources created by CloudFormation.
- Remediation requires either updating the template (if the change is intended) or updating the live resource to match the template.
Summary — key points
- CloudFormation drift detection compares the template’s desired state with live resource properties that CloudFormation can inspect.
- Run detection from the console (Stack actions → View drift results → Detect stack drift), via the AWS CLI, or through AWS SDKs.
- Results include a stack-level status (
NOT_CHECKED,IN_SYNC,DRIFTED) and per-resource statuses (IN_SYNC,MODIFIED,DELETED, etc.). - Drift detection is read-only — remediation must be done manually or by updating the stack/template.
Links and references
- AWS CloudFormation
- AWS CLI — Detect stack drift: https://docs.aws.amazon.com/cli/latest/reference/cloudformation/detect-stack-drift.html
- AWS CloudFormation API / SDKs: https://aws.amazon.com/tools/