terraform-patterns

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

A set of conventions for Terraform, a tool that describes cloud infrastructure in code, including reusable modules and separate staging and production settings.

In plain words
What is it for?
Writing Terraform, structuring modules, reviewing infrastructure changes, managing remote state, and debugging plan or apply failures.
Why use it?
It keeps infrastructure consistent across environments and makes changes easier to review, lock, and recover safely.

Skill for Claude CodeCodex

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

Good fit Writing Terraform, structuring modules, reviewing infrastructure changes, managing remote state, and debugging plan or apply failures.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sawrus/agent-guides/terraform-patterns
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-patterns
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-patterns

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/sawrus/agent-guides/terraform-patterns"><img src="https://agentmods.dev/badge/skills/sawrus/agent-guides/terraform-patterns.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 518 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.00000 $0.00518
Opus 5 $0.00000 $0.00259
Sonnet 5 $0.00000 $0.00104
Haiku 4.5 $0.00000 $0.00052

Measured 6d ago against content hash 3367580313d7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

terraform-patterns 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 6d 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.

areas/software/platform/skills/terraform-patterns/SKILL.md · 76 lines

What it actually says

Skill: Terraform Patterns

When to load

When writing new Terraform, reviewing IaC PRs, designing module structure, or debugging plan/apply failures.

Module Structure

terraform/
├── modules/
│   ├── vpc/
│   ├── eks-cluster/
│   ├── rds-postgres/
│   └── static-site/
└── environments/
    ├── staging/
    │   ├── main.tf
    │   ├── variables.tf
    │   └── terraform.tfvars
    └── production/
        ├── main.tf
        ├── variables.tf
        └── terraform.tfvars

Rule: Modules must be generic. Environment-specific values live in tfvars, never hardcoded in modules.

Resource Naming

resource "aws_s3_bucket" "this" {
  bucket = "${var.project}-${var.environment}-assets-${random_id.suffix.hex}"
  tags = merge(var.common_tags, { Name = "${var.project}-${var.environment}-assets" })
}

Remote State (Mandatory)

terraform {
  backend "s3" {
    bucket         = "my-company-terraform-state"
    key            = "${var.project}/${var.environment}/terraform.tfstate"
    region         = "us-east-1"
    encrypt        = true
    kms_key_id     = "arn:aws:kms:us-east-1:123456789:key/..."
    dynamodb_table = "terraform-state-lock"
  }
}

IAM Least Privilege

# ✅ Scoped policy
resource "aws_iam_policy" "app_s3_read" {
  policy = jsonencode({
    Statement = [{
      Effect   = "Allow"
      Action   = ["s3:GetObject", "s3:ListBucket"]
      Resource = [aws_s3_bucket.assets.arn, "${aws_s3_bucket.assets.arn}/*"]
    }]
  })
}
# ❌ Never: Action = ["s3:*"], Resource = ["*"]

Anti-Patterns

Anti-pattern Fix
count for module variants Use for_each with meaningful keys
Hardcoded AMI IDs Use data "aws_ami" with filters
terraform_remote_state across all envs Use SSM Parameter Store for cross-stack values
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. 6d ago First seen · 76 lines · 0 tokens per session scan A 3367580313d7

Subscribe to this mod's changes

terraform-patterns is a skill published in the GitHub repository sawrus/agent-guides (17 stars, last pushed 10d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 518 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-09-03.