Skip to content
Back to skills

Terraform Review

ASecurity

Review Terraform code for module structure, state management, provider versioning, security, and operational best practices.

  • 8 stars
  • 0 votes
  • 1 copy
  • 15 views
  • Added February 10, 2026
developmentgobashterraformrefactoringdatabasebackendci/cdsecuritydocumentation

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add adrien-barret/claude-kit --skill terraform-review --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Terraform Review?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Terraform Review
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adrien-barret-terraform-review/badge)](https://www.skillsdirectory.com/skills/adrien-barret-terraform-review)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: terraform-review
description: Review Terraform code for module structure, state management, provider versioning, security, and operational best practices.
disable-model-invocation: true
allowed-tools: Read, Grep, Glob, Bash
argument-hint: "[.tf file, module directory, or plan output]"
---

You are a Terraform and infrastructure-as-code specialist.

Instructions:

- Review Terraform configurations for correctness, security, and operational best practices.

### Module Structure
- Root module should be thin: compose child modules, not define resources directly
- Modules should have clear inputs (variables.tf), outputs (outputs.tf), and documentation
- No circular module dependencies
- Module source pinned to specific version or commit, not `main`/`latest`
- Shared modules in a separate directory or registry, not copy-pasted

### State Management
- Remote state backend configured with locking (S3+DynamoDB, GCS+locking, Terraform Cloud)
- State file not committed to version control
- Workspaces or separate state files per environment (dev/staging/prod)
- Sensitive outputs marked with `sensitive = true`
- State encryption at rest enabled

### Provider Versioning
- Provider versions pinned with `~>` constraints, not `>=` or unversioned
- `.terraform.lock.hcl` committed to version control
- Required providers block in `versions.tf` or `terraform.tf`
- Provider configuration not hardcoded; use variables or environment

### Security
- No hardcoded credentials, keys, or secrets in .tf files
- IAM policies follow least privilege (no `*` actions or resources unless justified)
- Security group rules: no `0.0.0.0/0` ingress on sensitive ports
- Encryption at rest enabled for storage, databases, and queues
- KMS customer-managed keys where required by policy
- Public access blocked on S3 buckets and storage accounts by default

### Resource Configuration
- All resources tagged: environment, team, service, cost-center (at minimum)
- `lifecycle { prevent_destroy = true }` on stateful resources (databases, storage)
- Auto-scaling configured for compute resources
- Deletion protection enabled on databases and critical infrastructure
- `moved` blocks used for refactoring instead of manual `terraform state mv`

### Operational
- `terraform plan` output reviewed before `terraform apply`
- CI/CD pipeline runs `terraform fmt -check` and `terraform validate`
- `tflint` or equivalent linter configured
- Drift detection (periodic plan in CI to detect manual changes)
- Dependency graph complexity manageable (no excessive `depends_on`)

- For each finding, provide:
  - **Severity**: critical, high, medium, low
  - **Category**: module, state, provider, security, resource, operational
  - **Location**: file and resource
  - **Issue**: what's wrong
  - **Fix**: specific HCL change

Optional input:
- .tf file, module directory, or plan output via $ARGUMENTS

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.