Definition

What Is Infrastructure Drift?

Infrastructure drift is the gap between what your Terraform or OpenTofu files declare and what actually exists in AWS, Azure, GCP, or OCI. Here is what causes it, why it matters, and how teams classify it.

Infrastructure drift · reference

Infrastructure drift is the difference between declared infrastructure (what your Terraform or OpenTofu configuration says should exist) and live infrastructure (what the cloud APIs report right now).

If the code says a bucket is private and the console shows it as public, that is drift. If someone created a security group by hand and it never appeared in a module, that is also drift — just a different kind.

Drift is not a Terraform bug. Clouds are mutable. People, autoscalers, support tickets, and other pipelines all write to the same accounts.

What usually causes it

Most production drift comes from a short list of sources:

  • ClickOps. A break-glass change in the AWS, Azure, or GCP console that never made it back into a pull request.
  • A second writer. A Helm chart, a cloud-native controller, or another team's pipeline mutating the same resource.
  • Provider defaults. A new default encryption flag or a computed attribute that the last apply never pinned.
  • State that is stale. A plan run without a refresh, or a workspace that no longer owns the resource.
  • Expected elasticity. Node counts, replica counts, and some load-balancer attributes that the platform is supposed to change.

The first four need a decision. The last one needs a rule so it stops flooding the report.

Why teams care

Drift is cheap when it is a missing tag. It is expensive when it is:

  • an ingress rule that opened the network,
  • an IAM trust policy edited during an incident,
  • a database parameter that no longer matches the module,
  • a DNS record that still works — until the next apply overwrites it.

The operational cost is not only the misconfiguration. It is the loss of confidence: if terraform apply might clobber a silent console fix, people stop applying, and the repo stops being the source of truth.

Three kinds of drift worth naming

KindWhat you seeTypical response
Configuration driftA managed resource's attributes differ from codeReconcile to code, or update code to match reality
Unmanaged resourcesLive objects with no address in stateImport, delete, or explicitly accept
Expected driftAutoscaling, vendor-managed fieldsIgnore with a documented exception

If a report only says “drift found,” reviewers will ignore it. If it says “security-critical configuration drift on this security group,” they can act.

What drift is not

  • A failed apply is an error, not drift.
  • A plan that wants to create a new environment is a change request, not drift.
  • Cost variance is a billing signal. It often follows drift (an oversized instance) but it is not the same thing.

What to do once you can name it

Scan with how to detect Terraform drift. Decide import, reconcile, or accept with the drift triage playbook.

If you want that scan and decision on connected clouds, use drift detection.

FAQ

Is all infrastructure drift a problem?

No. Autoscaling, provider-managed fields, and some operational patches create expected drift. The risk is unclassified drift — when a security group, IAM policy, or DNS record changes and nobody can say whether it was intended.

What is the difference between configuration drift and state drift?

Configuration drift is live cloud settings that no longer match declared code. State drift is when Terraform or OpenTofu state is stale, incomplete, or out of sync with both the code and the cloud. You usually have to refresh state before you can trust a configuration diff.

Does terraform plan detect all drift?

A refreshed plan catches resources Terraform manages. It will not see unmanaged console resources, resources created by another pipeline, or attributes the provider marks as computed. Teams that need a full picture also compare against cloud inventory.

Platform evaluation

See OrchesTerra on your infrastructure

Request access to generate architecture from a repository, review the plan, and run governed reconciliation across AWS, Azure, GCP, and OCI.