Prompt
drift detection tool for terraform
Latest observation
Oct 25, 2026
OpenAI APIWeb search: off
If you want a drift detection tool for Terraform, here are the main options depending on what you need:
1) Built-in Terraform
terraform plan
- The standard way to detect drift.
- Run against real infrastructure:
terraform plan - If there’s drift, the plan will show changes needed to reconcile state with reality.
terraform plan -refresh-only
- Good specifically for drift detection without proposing changes to config:
terraform plan -refresh-only - Compares state to real infrastructure and updates the state view.
2) Terraform Cloud / Terraform Enterprise
- Includes drift detection in workspace runs.
- Useful if you want scheduled runs and notifications.
- Best for teams already using HCP Terraform.
3) Driftctl
- Open-source drift detection tool.
- Scans cloud infrastructure and compares it with Terraform state.
- Works well for AWS, Azure, GCP, and more.
Example:
driftctl scan --from tfstate://terraform.tfstate
4) Spacelift
- CI/CD and IaC platform with drift detection built in.
- Good if you want policy checks, scheduling, and automation.
5) env0
- Also offers drift detection and governance features for Terraform.
6) Atlantis / CI pipeline checks
- You can automate:
terraform init terraform plan -detailed-exitcode - Exit codes:
0= no drift/no changes2= changes detected1= error
Example CI pattern:
terraform plan -detailed-exitcode > plan.out
Best choice by use case
- Simple and free:
terraform plan -refresh-only - CI/CD automation:
terraform plan -detailed-exitcode - Dedicated drift tool:
driftctl - Managed team workflow: Terraform Cloud / Spacelift / env0
If you want, I can recommend the best drift detection approach for AWS/Azure/GCP, or give you a GitHub Actions example.