Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Drift Management

Direct answer

Drift management compares the actual state of systems with the desired state in code, reports differences and fixes them automatically or manually, keeping configuration consistent over time.

When to use this

Use this when systems drift away from their declared configuration.

First 30 seconds

1. Drift management: detect, report, remediate, prevent.

2. Decide what auto-remediates.

3. Find who/what causes drift.

4. Restrict manual changes.

5. Track trends.

Operational verification

desired vs actual → drift → report → remediate → prevent

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Terraform / declarative automation current
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformTerraform / declarative automation current · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when systems drift away from their declared configuration.
What next?3 suggested next steps
Child topics (this level)8
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Target-state verification ladder Verify boundary

Drift Management uses a strict target-state ladder for desired/observed state comparison and reconciliation: request accepted → job/task succeeded → target object changed → effective runtime state confirmed → original workload verified.

Step 2 Verification path Verify boundary

Verify drift management with controlled, reversible experiments. Establish a converged baseline and run the detector until it reports no unexpected change. Make one bounded out-of-band change to an owned property and confirm the detector reports the precise resource/property without mutating it. Classify the difference, then exercise the chosen path: reconcile it back, adopt it into declared intent/state, or create a time-bounded exception. Re-run detection and independently query the target to show the final state matches the chosen policy. Also test a change to an unmanaged/computed property to ensure noise is not reported as actionable drift. Record configuration revision, state/workspace ID, provider version, target identity, diff and decision so future comparisons are meaningful.

Step 3 Where it fails Narrow the fault

The main boundaries are declared intent, state store/controller knowledge, provider/API read semantics and actual target state. A difference can originate from manual change, another controller, stale/failed refresh, provider normalization, eventual consistency or true policy violation. Do not apply automatically until the owner and difference class are known. A refresh-only operation updates state representation and is not the same as reconciling infrastructure; conversely, a normal plan may propose destructive reconciliation when the real issue is outdated configuration. Preserve state backups and original diffs before adoption. If the detector itself cannot read a resource, classify that as visibility failure rather than “no drift.” Re-run the same detector and service read-back after corrective action.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Drill down

Subtopics

Go one level deeper into this subject.

Subtopic Configuration Drift

Configuration drift is the gradual divergence of systems from their intended configuration through manual fixes, ad hoc changes and partial runs, leading to inconsistent and fragile environments.

Subtopic Desired State

Desired state in drift management is the authoritative definition of how systems should be, kept in Git or a source of truth, against which actual state is measured.

Subtopic Actual State

Actual state is the real, current configuration of a system as observed by reading it, which drift management compares with the desired state to find differences.

Subtopic Drift Detection

Drift detection in drift management runs scheduled comparisons — terraform plan, Ansible check mode, GitOps diff, config backups compared in Git — and flags any differences.

Subtopic Drift Reporting

Drift reporting summarizes which systems drifted, what changed, when and how often, so teams can fix root causes such as people bypassing automation.

Subtopic Auto-remediation

Auto-remediation in drift management automatically applies the desired state when drift is found.

Subtopic Manual Remediation

Manual remediation is when an engineer reviews detected drift and decides whether to revert it or update the desired state, appropriate when an automatic fix might cause harm.

Subtopic Compliance Drift

Compliance drift is when systems that once passed compliance checks fall out of compliance through changes or new requirements, tracked as a trend so it is fixed before an audit.

Key points
  • Drift comes from manual changes, failed runs or other tools.
  • Detect first, then decide: fix the system or update the code.
  • Report drift trends to find root causes.
Key checks
  • Drift reports per system — visibility
  • Remediation policy (auto vs manual) — decision
  • Drift sources analysis — prevention
ReferenceWhy it matters1 section · depth on demand

In depth

Drift management detects, reports and resolves differences between intended and actual configuration over time. It keeps automated environments trustworthy, because automation assumes systems are in the state it last left them.

ActivityExample
DetectScheduled dry runs, config diffs
ClassifyExpected, emergency fix, unauthorised
ResolveRevert, or update desired state
PreventRestrict manual access, enforce via pipeline

Track drift volume per team and system; repeated drift points to processes that bypass automation.

ReferenceImportant terms & boundaries1 section · depth on demand

Mechanics

Drift Management compares at least three things: declared intent, automation/controller state, and actual remote system state. In tools such as Terraform, refresh updates the controller’s view of remote objects before planning, so a plan can expose both out-of-band changes and configuration changes. Not every difference is unwanted drift: an approved emergency change, an autoscaled attribute, provider-computed field or another controller’s owned property may be legitimate. Effective drift management therefore depends on ownership metadata and normalization rules as much as on diff detection. A system that automatically overwrites every difference can destroy authorized changes; a system that merely refreshes state can silently adopt unauthorized changes. The core technical decision is whether to reconcile actual state to desired intent, adopt actual state into intent/state, or record an explicit exception.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Lifecycle

Run drift detection on a defined cadence and from the same reviewed configuration, provider/module versions and credentials used for enforcement. Track ownership at resource/property level where multiple controllers or humans can legitimately change the same system. Define an exception lifecycle with owner, rationale, expiry and revalidation so ignores do not become permanent blind spots. When drift is found, preserve the original diff and associated change/audit records before remediation. For stateful IaC tools, protect state storage, locking and backups because state corruption can masquerade as drift. Provider upgrades and schema changes should trigger baseline review. Repeated drift on the same field is usually a design/ownership conflict that should be resolved at source, not an invitation to increase remediation frequency.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docTerraform / declarative automation current current

Authoritative/upstream documentation reviewed for bounded claims in > Drift Management. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://developer.hashicorp.com/terraform/tutorials/state/resource-drift · confidence 94%
Embedded reference data

Quick lookup tables

→ Drift Management · operational reference

Context-specific ownership, verification, output and failure-boundary lookup for → Drift Management.

LayerDrift Management operational reference
Runtime/ownershipTerraform / declarative automation current · identify controller/worker/target ownership before mutation
Persistent intentVersioned configuration/playbook/workflow with explicit dependencies and least-privilege identity
Verificationterraform plan -refresh-only -detailed-exitcode; terraform plan -detailed-exitcode
Expected interpretationThe workflow distinguishes actual remote state from recorded state and desired configuration, classifies authorized vs unauthorized divergence, and chooses adopt/reconcile/ignore deliberately.
Recovery boundaryPreserve correlation IDs + pre-state, then verify target/service independently after remediation
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

Drift output should separate “remote object changed,” “controller state changed,” and “desired configuration changed.” Preserve stable resource addresses/IDs and property-level before/after values, not only a generic changed count. Terraform refresh-only and normal plans communicate different intents, so label them explicitly in audit records. For scheduled detection, aggregate counts by owner/system while retaining links to the exact diff. Sensitive values should be redacted or hashed; their existence/change can still be reported. A clean detector run should also state coverage and skipped/unknown resources so absence of findings is not mistaken for complete coverage. After remediation, store the follow-up clean plan/diff together with an independent target query as closure evidence.

Confirmation

Confirm action

Continue?