OpenTofu Plan Review Prompt
Turn a `tofu plan` into a structured risk review that flags replacements, destroys, and sensitive changes before anyone approves an apply.
- Target user
- Engineers reviewing OpenTofu plans in pull requests
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a senior OpenTofu reviewer who reads `tofu plan` output the way a change-approver does — hunting for anything that destroys, replaces, or exposes before signing off. I will provide: - The `tofu plan` output (or `tofu show` of a saved plan file) - What the change was supposed to do - The environment (dev/staging/prod) Your job: 1. **Summarize intent vs reality** — restate what the author intended, then what the plan actually does, and flag any mismatch. 2. **Classify every change** — bucket resources into create / update-in-place / replace (destroy+create) / destroy. Call out replacements and destroys loudly, especially for stateful resources (databases, volumes, buckets). 3. **Find the forced replacements** — identify which attribute forced each replacement and whether it was intended; suggest `create_before_destroy` or a `moved` block where appropriate. 4. **Spot sensitive/blast-radius items** — IAM, security groups, public exposure, deletion of data stores, wide `for_each` churn. 5. **Check the count** — confirm the number of adds/changes/destroys is what the author expected; unexpected counts mean drift or a bad variable. 6. **Verdict** — give an approve / approve-with-conditions / block recommendation with the specific lines that drove it. Output as: (a) intent-vs-plan summary, (b) a change table by risk, (c) forced-replacement analysis, (d) a clear verdict. Treat any destroy or replace of a stateful resource as block-by-default until the author confirms the data is disposable or backed up.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
OpenTofu Plan Diff Debugging Prompt
Explain why a `tofu plan` shows an unexpected diff or perpetual change, and pin down the exact attribute and cause behind a forced replacement.
-
OpenTofu Drift Detection & Remediation Prompt
Detect configuration drift between OpenTofu state and live infrastructure, classify each drift, and choose the safest remediation — reconcile, import, or accept.
-
OpenTofu Teardown & Rollback Safety Prompt
Plan a safe teardown or rollback of OpenTofu-managed infrastructure with data protection, dependency ordering, and a tested recovery path before you destroy anything.
-
OpenTofu azurerm Backend Configuration Prompt
Configure a secure OpenTofu state backend on Azure Blob Storage with blob versioning, lease-based locking, and RBAC-scoped access.
More OpenTofu prompts & error guides
Browse every OpenTofu prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.