zero gravitySOLUTIONS
← All insightsARCHITECTURE / ARCHITECTURE DECISION GUIDE

Review infrastructure drift before the next deployment.

QUICK ANSWER

Detect drift without assuming every difference should be overwritten. Establish its cause and owner, choose whether to adopt, revert, or redesign, and inspect the resulting resource changes before execution.

Inside this article 5 sections

Review infrastructure drift by comparing declared configuration, recorded management state, and the resources that actually exist. Classify each difference before reconciling it. An emergency change may be necessary and approved, while a harmless-looking default can conceal an unmanaged operating dependency.

The review should produce a controlled decision about which state becomes authoritative. Running a deployment immediately after detecting drift can undo a repair or replace a resource before the team understands why it differs.

Distinguish three views of the system

Declared configuration describes the intended resources in code or templates. Management state records how the tool associates that declaration with remote objects. Actual state is what the provider currently reports. These views can diverge for different reasons and require different remedies.

Consider an illustrative production database whose connection setting was raised during an incident. The application recovered, but the declaration still contains the previous value. A later deployment may restore the old setting and recreate the problem. The correct next action is to understand the repair and its capacity consequence, not automatically label it unauthorized.

Another difference might be a manually created security rule with no owner. It requires investigation and a decision about removal or adoption. Treating both examples as the same “drift count” hides the business risk.

Original drift disposition ledger
Observed differenceEvidence neededPossible disposition
Database setting changedIncident decision and measured capacity effectAdopt through reviewed configuration or replace with a safer remedy
Extra network ruleOwner, source, intended consumer, current usageRemove, narrow, or bring under management
Resource missingDeletion event and dependent workload stateRecover deliberately; inspect replacement side effects
Property not checkedTool support and independent provider readRecord an evidence gap, not a clean result
Detection finds differences. Disposition establishes what should happen and who owns that decision.

Collect evidence without applying a repair

Use the provider's read APIs and the infrastructure tool's planning or detection features. Confirm the target account, Region, workspace, stack, and execution identity before collecting results. A clean report from the wrong environment is worse than no report because it creates false confidence.

Terraform's refresh-only planning mode can show how state would change to reflect remote objects. Applying that plan updates management records; it does not rewrite the configuration to adopt the remote change. A later normal plan can still propose changes needed to match the declaration.

CloudFormation drift detection compares supported resource properties with expected values. Its coverage has limits, including properties not explicitly declared and nested stacks that require their own detection. A NOT_CHECKED result is an inspection gap, not evidence that the resource matches.

Keep the detection time and tool versions with the report. Infrastructure can change while a review is in progress, so the evidence is a snapshot. Avoid executing arbitrary project hooks or unfamiliar external data sources under broad credentials merely because a command is described as planning.

Connect the difference to its cause

Use change records, cloud audit events, incident notes, and resource tags to find the responsible action. Distinguish a human repair, an automated controller, a provider default, and a competing infrastructure manager. The appropriate fix depends on which actor will act again.

If an autoscaler owns desired capacity, repeatedly forcing the value from another controller can create a cycle. Define ownership of the dynamic field rather than treating every adjustment as drift to eliminate. If two repositories manage the same resource, resolve that conflict before attempting repeated reconciliation.

When no owner can be found, preserve the uncertainty and investigate the consumer impact. Do not invent a reason to make the ledger complete. A temporary access rule may still support a recovery tool that the team has forgotten to document.

Choose whether to adopt, revert, or redesign

Adopt the remote state when the change is necessary, understood, and appropriate for ongoing operation. Update the declaration through review, verify the resulting plan, and document why the previous setting was insufficient. Import unmanaged resources only when their lifecycle and dependencies are understood.

Revert when the difference is unwanted and the consequences of restoration are known. Check whether the operation updates in place or replaces a resource. Data stores, identifiers consumed by other systems, and networking changes need an explicit recovery path.

Redesign when the difference reveals a flawed ownership model. An emergency manual scaling change may point to missing capacity controls. A recurring security exception may point to an unsuitable network boundary. The incident-driven review guide helps connect these patterns to durable improvements.

Check the intended observation scope with the resource owner. A parameter managed by an autoscaler or another approved controller may be expected to vary. Documenting that ownership is stronger than suppressing every future difference without explaining which system remains authoritative.

Reconcile in a bounded order

Sequence changes by dependency and impact. Establish the intended owner first, update declarations or management records as appropriate, inspect the final resource plan, and then execute through the normal controlled path. Do not mix unrelated drift repairs into a large deployment that becomes difficult to diagnose.

Verify the application behavior after reconciliation. A configuration diff can be resolved while the product becomes slower or a background worker loses access. Use a representative customer workflow and a targeted check for the original incident condition.

Retain the before-and-after evidence and close the emergency-change record. The documentation sufficiency guide helps keep the resulting operating instructions usable. Technical consulting can turn drift findings into an owned reconciliation plan before the next deployment turns an unexplained difference into an outage.

FROM INSIGHT TO ACTIONSoftware development consulting

Turn drift findings into a controlled reconciliation decision.

We can inspect detection coverage, trace emergency changes, and define an owned repair sequence with application-level verification.

Explore technical consultingDiscuss your challenge

Start with your goals.
We’ll work through the next step together.