terraform-modules

terraform-modules is a skill for Claude Code, Codex from sawrus/agent-guides. It costs 55 tokens per session (678 once invoked), scanned A, original, MIT.

A guide to designing reusable Terraform modules, which are packaged groups of infrastructure definitions. It covers module inputs and outputs, repeated resources, cloud data sources, remote state, testing, and safe interfaces.

In plain words
What is it for?
Use it to create or review Terraform modules, define validated variables and outputs, choose between repeated-resource patterns, use remote state, write Terratest checks, and investigate plan or apply failures.
Why use it?
It helps keep infrastructure code consistent and reusable while limiting what each module exposes. Validation and testing can catch configuration mistakes before deployment.

Skill for Claude CodeCodex

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

Good fit Use it to create or review Terraform modules, define validated variables and outputs, choose between repeated-resource patterns, use remote state, write Terratest checks, and investigate plan or apply failures.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sawrus/agent-guides/terraform-modules
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 sawrus/agent-guides --skill terraform-modules
Clone the repo
git clone --depth 1 https://github.com/sawrus/agent-guides

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-modules

README.md
[![agentmods](https://agentmods.dev/badge/skills/sawrus/agent-guides/terraform-modules/github.svg)](https://agentmods.dev/skills/sawrus/agent-guides/terraform-modules)
Your own site
<a href="https://agentmods.dev/skills/sawrus/agent-guides/terraform-modules"><img src="https://agentmods.dev/badge/skills/sawrus/agent-guides/terraform-modules/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-modules

Your own site · 80×15
<a href="https://agentmods.dev/skills/sawrus/agent-guides/terraform-modules"><img src="https://agentmods.dev/badge/skills/sawrus/agent-guides/terraform-modules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 678 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00055 $0.00678
Opus 5.5 $0.00022 $0.00271
Sonnet 5.5 $0.00011 $0.00136
Haiku 4.5 $0.00006 $0.00068

Measured today against content hash 6cf20c8293d8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

terraform-modules 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 today.

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.

areas/devops/infrastructure/skills/terraform-modules/SKILL.md · 61 lines

How it starts

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

Terraform module: change safely

1. Read the module and its callers

  1. Open variables.tf, outputs.tf, versions.tf, and main.tf of the module.
  2. Find every caller: grep -rn 'source *= *".*<module-name>' --include=*.tf .
  3. If the module is published with a version (registry or git tag), check which versions the callers pin.

2. Change the interface

  1. Give every new variable a type, a description, and a validation block when the value has a fixed form.
  2. Give a new variable a default only if every caller can use it. A variable without a default is a breaking change for callers.
  3. Mark secrets sensitive = true in variables and outputs.
  4. Do not rename or delete a variable or an output that a caller uses. Add the new one, keep the old one with a deprecation note in its description, and remove it in a later major version.
  5. Pin providers in versions.tf with required_providers and a ~> constraint, and set required_version.

3. Rename or move resources without destroy

A changed resource address makes Terraform destroy and recreate the resource. Add a moved block instead:

moved {
  from = aws_s3_bucket.this
  to   = aws_s3_bucket.logs
}
  • Moving a resource into a child module: from = aws_s3_bucket.logs, to = module.logs.aws_s3_bucket.this.
  • Moving between state files needs terraform state mv or removed + import blocks. Ask the user first; it writes state.

4. Check

terraform fmt -recursive -check
terraform init -backend=false && terraform validate
tflint --recursive
terraform test            # if the module has tests/*.tftest.hcl
  1. Add or update a tests/<name>.tftest.hcl with command = plan for each new input combination.
  2. Run terraform plan in one caller environment. The plan must show no destroy or forces replacement line that the task did not ask for. Look for # forces replacement in the output.
  3. If the plan replaces a stateful resource (database, bucket, volume), stop and tell the user.

Read the full file on GitHub · 61 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. today Changed · -109 lines · +33 tokens per session 6cf20c8293d8
  2. 1mo ago First seen · 170 lines · 22 tokens per session scan A 3a80903dc737

Subscribe to this mod's changes

terraform-modules is a skill published in the GitHub repository sawrus/agent-guides (19 stars, last pushed today), licensed MIT. It adds 55 tokens to every session and 678 once invoked, about $0.0002 per session on Opus 5.5. 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.