terraform

terraform is a skill for Claude Code, Codex from SumonMSelim/agentguard. It costs 0 tokens per session (1,068 once invoked), scanned A, original, MIT.

A guide to writing and reviewing Terraform code. Terraform is a tool that describes cloud and other infrastructure in files so it can be managed consistently.

In plain words
What is it for?
Use it when creating or reviewing Terraform state storage, providers, modules, cloud resources, security settings, plans, and tests.
Why use it?
It helps protect infrastructure state and secrets, limit permissions, test changes, and avoid accidental destruction during deployments.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when creating or reviewing Terraform state storage, providers, modules, cloud resources, security settings, plans, and tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sumonmselim/agentguard/terraform
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add SumonMSelim/agentguard --skill terraform
Clone the repo
git clone --depth 1 https://github.com/SumonMSelim/agentguard

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for terraform

README.md
[![agentmods](https://agentmods.dev/badge/skills/sumonmselim/agentguard/terraform/github.svg)](https://agentmods.dev/skills/sumonmselim/agentguard/terraform)
Your own site
<a href="https://agentmods.dev/skills/sumonmselim/agentguard/terraform"><img src="https://agentmods.dev/badge/skills/sumonmselim/agentguard/terraform/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for terraform

Your own site · 80×15
<a href="https://agentmods.dev/skills/sumonmselim/agentguard/terraform"><img src="https://agentmods.dev/badge/skills/sumonmselim/agentguard/terraform.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,068 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01068
Opus 5.5 $0.00000 $0.00427
Sonnet 5.5 $0.00000 $0.00214
Haiku 4.5 $0.00000 $0.00107

Measured 1mo ago against content hash 1ac087977e2d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

terraform scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/terraform/SKILL.md · 73 lines

How it starts

The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Terraform

State

  • Remote state always. Local state for throwaway experiments only
  • State backend with locking: S3 + DynamoDB, GCS, or Terraform Cloud/HCP
  • Separate state files per environment (dev, staging, prod). Never share state across envs
  • Encrypt state at rest. Versioning on state bucket enables rollback — never delete old versions without confirming they are not needed
  • Never commit .tfstate or .tfstate.backup to git. Add to .gitignore
  • sensitive = true on all outputs containing secrets, tokens, or credentials. Limits plaintext exposure in logs and state diffs

Security

  • Least privilege for the Terraform runner. Scope to exactly what it creates
  • OIDC / Workload Identity for CI runners. No long-lived access keys
  • Secrets never in .tf files or terraform.tfvars committed to git. Pass via TF_VAR_* env vars, Vault, or secret manager at plan/apply time
  • prevent_destroy = true on critical resources (databases, buckets, KMS keys)
  • plan before every apply. Review the diff. Never auto-apply to production without human approval
  • Pin provider versions with pessimistic constraints: ~> 5.0 locks to 5.x not 6.x. Full pins for production stability
  • required_version in every root module. Prevents silent version drift across team members

Workflow

  • CI pattern: plan on PR (post as comment), apply on merge to main. Never apply from developer laptops in production
  • GitOps orchestration: Atlantis (self-hosted, PR-driven), Spacelift or env0 for team workflows, audit trails, and drift detection
  • terraform fmt -recursive and terraform validate in CI. Fail on violations
  • tflint for provider-specific lint. checkov or tfsec for security misconfigurations. Both in CI pre-apply
  • Infracost in CI to surface cost delta per PR before apply
  • Drift detection: scheduled plan runs that alert on non-empty diffs
  • terraform-docs to auto-generate module README from variables and outputs. Enforce via CI check
  • tfenv for CLI version management. Commit .terraform-version to repo

Read the full file on GitHub · 73 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 73 lines · 0 tokens per session scan A 1ac087977e2d

Subscribe to this mod's changes

terraform is a skill published in the GitHub repository SumonMSelim/agentguard (54 stars, last pushed 14d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,068 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.