Use this when drift should be corrected automatically.
Auto-remediation · Drift Management
Auto-remediation in drift management automatically applies the desired state when drift is found. Use it for well-understood settings and alert-only mode for changes that could cause outages.
1. Auto-remediation fixes drift automatically for safe settings.
2. Notify when it happens.
3. Exclude risky items.
4. Investigate repeated drift.
5. Log changes.
drift → auto-fix → notify
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Close auto-remediation only after the next detector cycle is stable Verify boundary
Verification records the drift object and field, desired revision, pre-change actual value, remediation task and direct post-change read-back. The following detector cycle must observe the same target as compliant without scheduling another change, and the affected workload or control should pass its original test. Keep exception and cooldown state visible so a suppressed detector is not mistaken for healthy convergence. A successful remediation task shows an action ran, but it does not show the detector input was correct, the target remained converged or another controller will not revert it.
Step 2 Detect false drift and remediation oscillation before repeated writes Narrow the fault
If Auto-remediation repeatedly changes the same object, compare desired and actual normalization for ordering, defaults, timestamps and platform-generated values before increasing retries. If actual state changes but the detector stays red, inspect observation freshness and cache/reconciliation lag. If the action fails, branch into authorization, target validation and dependency state using the exact remediation task ID. If two controllers alternate values, identify competing owners instead of treating each detection as an isolated drift event. Disable or gate the automatic action when the remediation cannot demonstrate a stable no-op state.
Step 3 Common mistakes Narrow the fault
- Auto-remediation without notification.
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.
- Auto-fix well-understood settings only.
- Alert-only for risky changes.
- Log every correction.
- Auto-remediation scope (safe settings only) — policy
- Enforcement runs (ApplyAndAutoCorrect, selfHeal) — mechanisms
- Notification on auto-fix — visibility
ReferenceWhy it matters1 section · depth on demand
Auto-remediation is detect, authorize, change, read back and cool down
Drift Management Auto-remediation begins with a normalized comparison between versioned desired state and observed actual state. A detector should identify the exact object/field delta and its freshness before policy decides whether automatic change is allowed. The remediation action then has its own task/result boundary, followed by target read-back and a later detector cycle. Cooldown and suppression matter because eventual consistency or delayed telemetry can make a correct remediation look like persistent drift. High-risk or ambiguous deltas should leave the automatic path rather than being forced toward compliance.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
Auto-remediation corrects drift automatically: when a system deviates from its desired state, automation restores it without waiting for a person. It keeps baselines enforced continuously and removes routine toil — but a wrong desired state or a misdetected deviation can cause outages at machine speed.
Guidelines:
| Guideline | Reason |
|---|---|
| Start with low-risk settings (NTP, banners, logging) | Mistakes are harmless |
| Limit scope per run | Contain bad remediations |
| Rate-limit and circuit-break | Stop if many systems need fixing at once (signals a wrong baseline) |
| Notify and log every remediation | Visibility and audit |
| Exclude systems under active change | Avoid fighting engineers mid-change |
| Track recurring drift | Fix the root cause instead of re-applying |
A drift that keeps returning means something keeps changing it — find that process.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Drift Management > Auto-remediation. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://developer.hashicorp.com/terraform/tutorials/state/resource-drift · confidence 94%