Terraform Plan & Drift Explorer
Paste terraform show -json: drift, replacement reasons, attribute diffs and risky deletes.
How it works
Paste the JSON of a saved plan (`terraform show -json tfplan`) or the `terraform plan -json` stream. You get counts per action, every resource change with Terraform's own reason (tainted, cannot update, removed from config…), attribute-level before/after diffs with sensitive values masked and "known after apply" marked, the drift Terraform detected outside of Terraform during refresh, and risk flags for deleting or replacing databases, buckets and other stateful resources or for opening access.
- Reads the documented Terraform JSON plan format: resource_changes[].change.actions (["delete","create"] = destroy-then-create replacement, ["create","delete"] = create_before_destroy), action_reason, replace_paths, previous_address (moved), importing; resource_drift[] for changes made outside Terraform; output_changes.
- Attribute diffs flatten before/after into dotted paths; after_unknown marks values "known after apply"; any path covered by before_sensitive/after_sensitive is replaced by "(sensitive value)" and never shown.
- Drift: before = last state, after = refreshed real-world value. If the same address has an update planned, applying reverts the drift; a no-op plan means the configuration already matches (or ignore_changes).
- Risk: delete/replace of a stateful type (databases, buckets, volumes, queues, keys, secrets, DNS zones…) is critical; other deletes high; other replacements medium; updates that open 0.0.0.0/0, grant "*" principals/actions, disable deletion protection, encryption, backups or S3 public-access blocks are high; force_destroy / skip_final_snapshot on deletion escalate.
- The plan -json stream contains actions and reasons but no attribute values, so attribute diffs and value-based checks need the show -json form.
Use this tool in an app
These free programs for your browser have this tool built in, next to everything else the task needs.
-
Opsdeck Developer & ops workbench
One deck for CI failures, cron, traces, k8s events, API diffs, query plans and Terraform.
Related tools
- Kubernetes Event Explorer – Paste kubectl events and get a timeline, reason taxonomy and likely root causes per workload.
- API Explorer of Explorers – Search 2,500+ public APIs or summarise any OpenAPI spec: servers, auth, endpoints, changes.
How to use the Terraform Plan & Drift Explorer
Read a Terraform plan JSON safely: what gets created, changed, replaced or destroyed, what drifted outside Terraform, and which changes are risky.
What it is for
terraform plan output is long, and the line that matters — -/+ destroy and then create replacement on your production database — scrolls past between a hundred tag updates. Drift is easy to miss too: someone opens a port in the console, and the plan quietly reverts it, or doesn't.
Paste the JSON of a saved plan (terraform plan -out=tfplan && terraform show -json tfplan) or the terraform plan -json stream. You get the following:
- Counts per action
- Every resource change with Terraform's own reason (cannot update in place, removed from config, for_each key gone…)
- Attribute-level before/after diffs, with sensitive values masked and "known after apply" marked
- The drift Terraform detected during refresh, and what applying will do about it
- Risk flags for deleting or replacing stateful resources and for opening access
It reads the plan. It doesn't run Terraform, see your state backend or know your business context. A "critical" replacement of a throwaway test database is fine. Judge each flag yourself.
Worked example
The first built-in example is an AWS plan from Terraform 1.9.5.
Plan: 1 to add, 2 to change, 1 to replace, 1 to destroy; 2 resources drifted outside Terraform; 3 high-risk changes, e.g. aws_db_instance.main (replace (destroy then create)).
| Resource | Action | Risk | Why |
|---|---|---|---|
| aws_db_instance.main | replace (delete, then create) | critical | storage_encrypted false → true forces replacement; the instance and its data are destroyed |
| aws_s3_bucket.logs | delete | critical | resource block removed from config; force_destroy = true deletes all objects too |
| aws_iam_role_policy.ci | update | high | policy goes from s3:PutObject on one bucket to "Action": "*", "Resource": "*" |
| aws_security_group.web | update | medium | changes network exposure |
| module.cdn.aws_cloudfront_distribution.this | move | none | moved from aws_cloudfront_distribution.cdn |
Drift: someone added an SSH rule (port 22 from 203.0.113.7/32) to aws_security_group.web outside Terraform. Applying this plan reverts it. The cost-center tag added to aws_s3_bucket.assets already matches the configuration, so only state is updated.
Turning on encryption looks like a harmless one-line change. In this plan it destroys the production database. Snapshot and restore it to an encrypted copy instead, or use a migration path.
How to read the result
- Counts — create, update, delete, replace, move, import, drift, plus the critical/high totals.
- Changes — action, Terraform's reason in plain English, risk and risk reasons, and
replacePaths(the attributes that force replacement). - Drift — what changed outside Terraform and the interpretation: the plan reverts it, or the config already matches, or no change is planned.
- Attribute diffs — dotted paths with before/after.
(known after apply)is a value computed during apply.(sensitive value)is never shown. - Outputs — output values that will change, e.g. a database endpoint other systems depend on.
Tips and common mistakes
- Use
terraform show -json tfplan, not the-jsonstream. The stream has actions and reasons but no attribute values, so diffs and value-based checks (like"*"policies or0.0.0.0/0) are missing. The tool warns you when this happens. ["delete","create"]destroys first. If you see it on anything stateful, considercreate_before_destroyor a data migration before applying.- "Removed from configuration" deletions often come from a refactor. Use a
movedblock (it shows as move) instead of deleting and recreating. - Drift that the plan reverts may be someone's emergency fix. Ask before applying, then put the change in code.
force_destroyandskip_final_snapshotturn a deletion from recoverable into permanent.
FAQ
Is it safe to paste a plan that contains secrets?
Values that Terraform marks as sensitive are replaced by "(sensitive value)" and never shown. Non-sensitive values, including some IDs and endpoints, are displayed, so redact the file if your plan contains unmarked secrets.
What's the difference between drift and a planned change?
Drift is what changed in the real world since the last apply, found during refresh. A planned change is what Terraform will do on apply. They can cancel out, or one can revert the other.
Why is replacing an instance "medium" but replacing a database "critical"?
Stateful types such as databases, buckets, volumes, queues, keys, secrets and DNS zones lose data when destroyed. Other replacements usually only cause downtime.
Does it support other clouds?
Yes. It reads Terraform's provider-neutral plan format. Risk rules match stateful resource types across providers, as the GCP example with google_sql_database_instance shows.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://terraformdriftexplorer.usefulweb.site/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://terraformdriftexplorer.usefulweb.site/mcp· tool nameterraform_drift_explorer
Example request
curl -s -X POST https://terraformdriftexplorer.usefulweb.site/api/v1/calculate \
-H 'content-type: application/json' \
-d '{…see OpenAPI examples…}'