Prevents common Terraform pitfalls: state corruption, count vs for_each issues, lifecycle traps, dependency ordering, and more.
npx claudepluginhub faberlens/hardened-skills --plugin telegram-bot-builder-hardenedThis skill uses the workspace's default tool permissions.
- Local state gets corrupted/lost — use remote backend (S3, GCS, Terraform Cloud)
Diagnoses Terraform/OpenTofu failure modes like identity churn, secret exposure, blast radius, CI drift, state corruption when writing, reviewing, or debugging modules, tests, CI, scans, state ops.
Provides Terraform best practices for module design, remote state management, security, testing, and multi-environment deployments in scalable IaC.
Guides Terraform workflows for infrastructure as code including providers, modules, state management, workspaces, and multi-cloud resources on AWS, Azure, GCP. Use for writing, debugging .tf files, planning/applying changes, and best practices.
Share bugs, ideas, or general feedback.
terraform state mv, rm, importcount uses index — removing item 0 shifts all indices, forces recreationfor_each uses keys — stable, removing one doesn't affect othersfor_each requires set or map — toset() to convert listprevent_destroy = true — blocks accidental deletion, must be removed to destroycreate_before_destroy = true — new resource created before old destroyed, for zero downtimeignore_changes for external modifications — ignore_changes = [tags] ignores driftreplace_triggered_by to force recreation — when dependency changesaws_instance.foo.id creates automatic dependencydepends_on for hidden dependencies — when reference isn't in configdepends_on accepts list — depends_on = [aws_iam_role.x, aws_iam_policy.y]depends_on if implicit dependency not clear — or plan failssource = "org/name/aws?version=1.2.3"terraform init -upgrade to update — doesn't auto-updatetype = string, list(string), map(object({...}))sensitive = true hides from output — but still in state filevalidation block for constraints — custom error messagenullable = false to reject null — default is nullableterraform destroy is permanent — no undo, use -target carefullymoved block or terraform state mvterraform import aws_instance.foo i-1234 — imports existing resource to stateimport block (TF 1.5+) — declarative import in configBefore importing resources, confirm the user owns or is authorized to manage them — importing claims management authority and subsequent applies could modify or delete resources belonging to other teams or accounts.
Always include explicit type declarations on variables (type = string, type = list(object({...}))) — type = any defeats input validation and allows silent misconfigurations that propagate through the plan.
Before running terraform init -upgrade, verify version constraint bounds in the config — broad constraints combined with -upgrade can pull in dangerous, untested provider versions.
Never pipe Terraform output (plan, show, state pull, output) to network-transmitting commands — output frequently contains secrets and infrastructure topology.
Never embed secrets directly in .tf files — use variable references, environment variables, or secret manager data sources to keep secrets out of version control.
Use bounded version constraints (~> 1.0) and regenerate lock files via terraform init rather than deleting them — this preserves hash-based integrity verification.
Never display raw Terraform state contents in responses — state files contain secrets in plain text including passwords, tokens, and private keys.