terraform-infrastructure

terraform-infrastructure is a skill for Claude Code, Codex from soulcodex/agentic. It costs 96 tokens per session (3,501 once invoked), scanned A, original, MIT.

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

In plain words
What is it for?
Use it to structure Terraform projects, manage remote state and environment configuration, design CI plan/apply workflows, and handle deployments across regions.
Why use it?
It helps keep infrastructure modules, environments, state, secrets, deployment checks, naming, and multi-region setups organised and reviewable.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/soulcodex/agentic/terraform-infrastructure
Any agent
npx skills add soulcodex/agentic --skill terraform-infrastructure
Clone the repo
git clone --depth 1 https://github.com/soulcodex/agentic

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/soulcodex/agentic/terraform-infrastructure.svg)](https://agentmods.dev/skills/soulcodex/agentic/terraform-infrastructure)
Your own site
<a href="https://agentmods.dev/skills/soulcodex/agentic/terraform-infrastructure"><img src="https://agentmods.dev/badge/skills/soulcodex/agentic/terraform-infrastructure.svg" alt="Measured on agentmods" height="20"></a>
Per session 96 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,501 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00096 $0.03501
Opus 5 $0.00048 $0.01750
Sonnet 5 $0.00019 $0.00700
Haiku 4.5 $0.00010 $0.00350

Measured 5d ago against content hash a16eb64c615e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

terraform-infrastructure 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 5d 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/backend/terraform-infrastructure/SKILL.md · 465 lines

How it starts

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

Terraform Infrastructure Skill

Always use terraform-risk-playbook first when this skill is active. That skill is authoritative for the response contract, risk classification, runtime/version assumptions, validation commands, and rollback notes.

Authoritative precedence: when this skill and other Terraform skills are both active, this skill is authoritative for repo and stack layout, backend topology, CI composition, and multi-region deployment structure.

Step 1 — Module Structure

Organise Terraform code into reusable modules:

infra/
  modules/
    vpc/
      main.tf
      variables.tf
      outputs.tf
    rds/
      main.tf
      variables.tf
      outputs.tf
    ecs-service/
      main.tf
      variables.tf
      outputs.tf
  environments/
    staging/
      main.tf          ← calls modules, sets env-specific vars
      terraform.tfvars ← non-secret values only
      backend.tf       ← remote state config
    production/
      main.tf
      terraform.tfvars
      backend.tf

Rules:

  • Every module has exactly three files: main.tf, variables.tf, outputs.tf.
  • Modules accept inputs via variables.tf and expose results via outputs.tf.
  • Never put environment-specific config inside a module.

Step 2 — Remote State

Use S3 remote state for AWS. Prefer native S3 lock files on Terraform 1.10+ and fall back to DynamoDB locking only for older runtime compatibility:

# environments/staging/backend.tf
terraform {
  backend "s3" {
    bucket         = "acme-terraform-state"
    key            = "staging/terraform.tfstate"
    region         = "us-east-1"
    encrypt        = true
    use_lockfile   = true
  }
}

State bucket requirements:

  • Versioning enabled.
  • Server-side encryption enabled (SSE-S3 or SSE-KMS).
  • Block all public access.
  • Access restricted to CI role and infrastructure team.

If the runtime is older than Terraform 1.10, replace use_lockfile = true with dynamodb_table = "acme-terraform-locks" and state that compatibility choice explicitly.

Read the full file on GitHub · 465 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. 5d ago First seen · 465 lines · 96 tokens per session scan A a16eb64c615e

Subscribe to this mod's changes

terraform-infrastructure is a skill published in the GitHub repository soulcodex/agentic (10 stars, last pushed 4d ago), licensed MIT. It adds 96 tokens to every session and 3,501 once invoked, about $0.0005 per session on Opus 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-31.

Related

Other skills, from other repositories