Terraform Zero Drift (Equilibrium State)
What is Zero Drift?
Terraform Zero Drift (Equilibrium State)
What is Zero Drift?
Zero Drift (also called the Equilibrium State) means that the Terraform configuration, the Terraform state file, and the actual cloud infrastructure are all synchronized.
In this state:
- The Terraform code in VS Code defines the desired infrastructure.
- The
terraform.tfstatefile accurately reflects the deployed resources. - The Azure resources exactly match both the Terraform configuration and the state file.
When all three are identical, Terraform detects no changes.

Terraform Zero Drift
Components
1. Terraform Configuration (VS Code)
This is where the infrastructure is defined using Terraform files.
Example files:
main.tfvariables.tfprovider.tfterraform.tf
Example:
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
}
}
}
These files describe the desired state of the infrastructure.
2. Terraform State File (terraform.tfstate)
The state file is Terraform’s database.
It stores information such as:
- Resource IDs
- Resource names
- Attributes
- Current infrastructure status
Terraform uses this file to compare the desired state with the existing infrastructure.
3. Azure Infrastructure
These are the actual cloud resources running in Azure, such as:
- Virtual Machines
- Storage Accounts
- Virtual Networks
- Resource Groups
This is the real infrastructure that users interact with.
How Terraform Checks for Drift
When you run:
terraform plan
Terraform automatically performs a state refresh (by default), reads the latest infrastructure from Azure, compares it with:
- Terraform configuration
- Terraform state file
and then generates an execution plan.
If everything matches, the output is:
No changes.
Your infrastructure matches the configuration.
This indicates the infrastructure is in a Zero Drift state.
Understanding the Commands

terraform plan
terraform plan
What it does:
- Refreshes the state (default behavior)
- Reads the current Azure infrastructure
- Compares:
- Terraform code
- State file
- Azure resources
- Shows what would change
It does not modify infrastructure.
***terraform planautomatically refreshes the state (default behavior) and then generates an execution plan.***
terraform apply
terraform apply
What it does:
- Creates an execution plan
- Displays the proposed changes
- Requests approval (unless auto-approved)
- Applies the changes to Azure
- Updates the
terraform.tfstatefile
About terraform refresh
Older documentation often states:
terraform plan = terraform refresh + terraform plan
However, this is no longer recommended.
The standalone command:
terraform refresh
is deprecated because terraform plan and terraform apply already refresh the state automatically.
In modern Terraform:
terraform plan
↓
Refresh State
↓
Compare Configuration
↓
Generate Execution Plan

Key Takeaways
- Terraform configuration defines the desired state.
terraform.tfstatestores the current known state.- Azure contains the actual infrastructure.
- When all three are synchronized, the environment is in a Zero Drift (Equilibrium State).
terraform plandetects drift without making changes.terraform applyreconciles any differences and restores the infrastructure to the desired state.
메타데이터
- post_id
- 08d77fbb0b77
- slug
- terraform-zero-drift-equilibrium-state-08d77fbb0b77
- url
- https://medium.com/@mukeshdani/terraform-zero-drift-equilibrium-state-08d77fbb0b77
- canonical_url
- https://medium.com/@mukeshdani/terraform-zero-drift-equilibrium-state-08d77fbb0b77
- author_url
- https://medium.com/@mukeshdani
- status
- ok
- fetched_at
- 2026-08-29 14:24:53