terraform-review

Review Terraform plans and HCL for destructive changes, state hygiene, and security misconfigurations.

15|3|Updated Jul 9, 2026
One-click install
npx skills add https://github.com/kiurakku/cursor-kit-for-ai --skill terraform-review-kiurakku
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: terraform-review
Source: https://github.com/kiurakku/cursor-kit-for-ai/tree/main/plugins/devops/skills/terraform-review
Command: npx skills add https://github.com/kiurakku/cursor-kit-for-ai --skill terraform-review-kiurakku

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Terraform changes that look safe in a diff can destroy databases, recreate stateful resources, or expose infrastructure publicly. This Skill reviews the actual plan output and HCL configuration to catch destructive actions, state mismanagement, and security gaps before terraform apply runs. ## Core Features & Use Cases - Plan Triage: Classifies every resource action (create, update, replace, destroy) and flags -/+ replacements on stateful resources like databases and volumes as blockers. - State & Safety Checks: Verifies remote backends with locking, prevent_destroy lifecycle rules, moved blocks instead of renames, and for_each over index-shifting count. - Security Audit: Detects secrets in .tf/.tfvars, open 0.0.0.0/0 security group ingress, wildcard IAM policies, and unintended public endpoints. - Use Case: Before merging an infrastructure PR, run the review against terraform plan -detailed-exitcode output and receive a verdict (safe to apply / apply with care / do not apply) with a blocker table listing each risky resource and its fix. ## Quick Start Review my Terraform plan output and the changed .tf files, and tell me whether it is safe to apply with any blockers listed.

Frequently Asked Questions about terraform-review

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review a Terraform plan before applying?▼

Run terraform plan -detailed-exitcode and triage every resource action by symbol: + create, ~ update, -/+ replace, and - destroy. Treat any destroy or replacement on stateful resources like databases and volumes as a blocker until explicitly justified.

How to prevent Terraform from destroying a database?▼

Add lifecycle { prevent_destroy = true } to databases, stateful volumes, and DNS zones, and enable deletion_protection on RDS or CloudSQL resources. Also check plan output for -/+ replacement lines, which indicate destroy-and-recreate even without an explicit delete.

Why does Terraform want to destroy and recreate my resource?▼

Certain attribute changes force replacement, marked with '# forces replacement' in the plan. Renaming a resource in HCL also triggers destroy-and-create; use moved {} blocks or terraform state mv to rename without recreation.

Should I use count or for_each in Terraform modules?▼

Prefer for_each with stable keys over count. Count indexes shift when list elements are reordered or removed, causing Terraform to churn or recreate unrelated resources.

What Terraform security issues should I check in code review?▼

Check for secrets in .tf, .tfvars, or non-sensitive outputs, security groups with 0.0.0.0/0 ingress beyond public 80/443, IAM policies with wildcard actions, and any resource with an unintended public IP or endpoint.

When is Terraform overkill for infrastructure?▼

For single-VPS projects, a simple setup script often beats a module tree. Terraform pays off when you manage multiple environments, need remote state with locking, or provision managed cloud resources like Kubernetes clusters.