Skip to content
Back to skills

Senior Terraform

ASecurity

Use when designing, writing, reviewing, refactoring, or troubleshooting infrastructure as code with Terraform or OpenTofu (also Pulumi or CloudFormation concepts), including modules, providers, state and backends, workspaces, plans, drift, imports, moved blocks, variables and secrets, or policy checks.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 26, 2026
ai-agentsterraformtestingrefactoringbackend

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 26, 2026

npx -y skills add a365ngay/CogniRouter --skill senior-terraform --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Senior Terraform?

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

Security grade badge for Senior Terraform
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/a365ngay-senior-terraform/badge)](https://www.skillsdirectory.com/skills/a365ngay-senior-terraform)

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: senior-terraform
description: Use when designing, writing, reviewing, refactoring, or troubleshooting infrastructure as code with Terraform or OpenTofu (also Pulumi or CloudFormation concepts), including modules, providers, state and backends, workspaces, plans, drift, imports, moved blocks, variables and secrets, or policy checks.
---

# Senior Terraform

## Role

Change infrastructure through reviewed plans only: small modules, safe state handling, no accidental destroys, and no secrets in code or state outputs.

## Before Editing

1. Inspect Terraform/OpenTofu and provider versions, backend and state locking, module structure, environments (workspaces or directories), variable files, CI plan/apply flow, and policy tooling (tflint, tfsec/Trivy, Checkov, OPA).
2. Read the current plan for the target environment before changing code; understand what already drifts.
3. Never run `apply`, `destroy`, `state rm/mv`, or `import` against shared or production state without explicit authorization.

## Implementation Rules

- Pin `required_version` and provider versions; commit the lock file.
- Keep modules focused with typed, validated variables and documented outputs. Avoid deep module nesting and hard-coded environment values.
- Use `moved` blocks for refactors and `import` blocks for adoption so resources are not destroyed and recreated. Use `prevent_destroy` or lifecycle rules for critical data resources.
- Never commit secrets; read them from a secret manager or variables marked `sensitive`. Remember state can contain secrets: use an encrypted remote backend with locking and restricted access.
- Prefer explicit dependencies through references; use `depends_on` only when no reference exists. Avoid `count`/`for_each` key changes that recreate resources.
- Tag resources consistently for ownership and cost.

## Testing and Verification

Run `terraform fmt -check`, `validate`, the project's linters and policy checks, and `plan` for each affected environment. Read the plan: list every create, update, replace, and destroy and confirm each is intended.

## Review Checklist

- Does the plan contain any unexpected replace or destroy?
- Are versions pinned and the lock file updated deliberately?
- Are secrets kept out of code, outputs, and logs?
- Is the change applied through the normal reviewed pipeline with a rollback path?

Files in this skill

  • SKILL.md2.3 KB
  • agents/openai.yaml196 B

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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

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