Terraform Infrastructure as Code

Terraform Infrastructure as Code is a skill for Claude Code, Codex from bobmatnyc/mcp-skillset. It costs 36 tokens per session (5,320 once invoked), scanned A, original, MIT.

Guidance for using Terraform, a tool that describes cloud infrastructure in files so it can be created and changed consistently across environments.

In plain words
What is it for?
Use it to provision compute, storage, networks, and databases; manage development, staging, and production; build reusable modules; and automate infrastructure through CI/CD.
Why use it?
It helps replace manual cloud-console work with version-controlled, repeatable infrastructure changes and provides patterns for managing Terraform state safely.

Skill for Claude CodeCodex

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

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is helm install myapp ./charts/myapp.

Good fit Use it to provision compute, storage, networks, and databases; manage development, staging, and production; build reusable modules; and automate infrastructure through CI/CD.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/bobmatnyc/mcp-skillset
agentmods
npx agentmods add skills/bobmatnyc/mcp-skillset/terraform-infrastructure

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 as Code

README.md
[![agentmods](https://agentmods.dev/badge/skills/bobmatnyc/mcp-skillset/terraform-infrastructure/github.svg)](https://agentmods.dev/skills/bobmatnyc/mcp-skillset/terraform-infrastructure)
Your own site
<a href="https://agentmods.dev/skills/bobmatnyc/mcp-skillset/terraform-infrastructure"><img src="https://agentmods.dev/badge/skills/bobmatnyc/mcp-skillset/terraform-infrastructure/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 Infrastructure as Code

Your own site · 80×15
<a href="https://agentmods.dev/skills/bobmatnyc/mcp-skillset/terraform-infrastructure"><img src="https://agentmods.dev/badge/skills/bobmatnyc/mcp-skillset/terraform-infrastructure.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,320 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.00036 $0.05320
Opus 5 $0.00018 $0.02660
Sonnet 5 $0.00007 $0.01064
Haiku 4.5 $0.00004 $0.00532

Measured 12d ago against content hash 41af1fc5f67c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

Terraform Infrastructure as Code 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 12d 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.

docs/skill-templates/terraform-infrastructure/SKILL.md · 850 lines

How it starts

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

Terraform Infrastructure as Code

Overview

This skill provides comprehensive guidance for building production-grade infrastructure with Terraform following 2024-2025 best practices. Terraform is the industry standard for Infrastructure as Code (IaC), enabling version-controlled, reproducible, and automated cloud infrastructure management across AWS, Azure, GCP, and 100+ providers.

When to Use This Skill

Use this skill when:

  • Provisioning cloud infrastructure (compute, storage, networking, databases)
  • Managing multi-environment deployments (dev, staging, production)
  • Implementing immutable infrastructure patterns
  • Orchestrating complex multi-cloud architectures
  • Automating infrastructure changes with CI/CD pipelines
  • Creating reusable infrastructure modules for teams
  • Migrating from manual cloud console provisioning to IaC

Core Principles

1. State Management is Critical

Terraform state is the source of truth - protect it

# CORRECT: Remote state with locking
terraform {
  backend "s3" {
    bucket         = "myapp-terraform-state"
    key            = "prod/vpc/terraform.tfstate"
    region         = "us-east-1"
    encrypt        = true
    dynamodb_table = "terraform-state-lock"  # Prevents concurrent modifications

    # State versioning for recovery
    versioning = true
  }
}

# WRONG: Local state in production
# terraform {
#   backend "local" {
#     path = "terraform.tfstate"  # Never use local state in teams!
#   }
# }

State Best Practices:

  • ✅ Always use remote state backends (S3, Azure Blob, GCS, Terraform Cloud)
  • ✅ Enable state locking to prevent concurrent runs
  • ✅ Enable encryption at rest for sensitive data
  • ✅ Use versioning for state file recovery
  • ✅ Separate state files per environment and major component
  • ❌ Never commit .tfstate files to version control
  • ❌ Never share state files via email or Slack

2. Module Design for Reusability

Build composable, tested modules with clear interfaces

# modules/vpc/main.tf - Well-designed module
variable "vpc_cidr" {
  description = "CIDR block for VPC"
  type        = string
  validation {
    condition     = can(cidrhost(var.vpc_cidr, 0))
    error_message = "VPC CIDR must be valid IPv4 CIDR block"
  }
}

variable "environment" {
  description = "Environment name (dev, staging, prod)"
  type        = string
  validation {
    condition     = contains(["dev", "staging", "prod"], var.environment)
    error_message = "Environment must be dev, staging, or prod"
  }
}

variable "tags" {
  description = "Additional tags for all resources"
  type        = map(string)
  default     = {}
}

resource "aws_vpc" "main" {
  cidr_block           = var.vpc_cidr
  enable_dns_hostnames = true
  enable_dns_support   = true

  tags = merge(
    {
      Name        = "${var.environment}-vpc"
      Environment = var.environment
      ManagedBy   = "Terraform"
    },
    var.tags
  )
}

output "vpc_id" {
  description = "ID of the created VPC"
  value       = aws_vpc.main.id
}

output "vpc_cidr" {
  description = "CIDR block of the VPC"
  value       = aws_vpc.main.cidr_block
}

# Usage in root module
module "vpc" {
  source = "./modules/vpc"

  vpc_cidr    = "10.0.0.0/16"
  environment = "prod"
  tags = {
    Team    = "platform"
    Project = "myapp"
  }
}

Read the full file on GitHub · 850 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. 12d ago First seen · 850 lines · 36 tokens per session scan A 41af1fc5f67c

Subscribe to this mod's changes

Terraform Infrastructure as Code is a skill published in the GitHub repository bobmatnyc/mcp-skillset (20 stars, last pushed 6mo ago), licensed MIT. It adds 36 tokens to every session and 5,320 once invoked, about $0.0002 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-30.

Related

Other skills, from other repositories

terraform-infrastructure-as-code

Comprehensive Terraform Infrastructure as Code skill covering resources, modules, state management, workspaces, providers, and advanced patterns for cloud-agnostic infrastructure deployment.

manutej/luxor-claude-marketplace · 36 tokens

Cloud Security & Container Hardening

AWS/Azure/GCP security auditing, container and Kubernetes hardening, Infrastructure as Code scanning, and cloud compliance assessment.

Masriyan/Claude-Code-CyberSecurity-Skill · 30 tokens

terraform-iac

Terraform and OpenTofu infrastructure as code best practices - generate HCL configurations, module patterns, state management, CI/CD workflows, and cloud provider templates for AWS, GCP, Azure.

chainlesschain/chainlesschain · 41 tokens

terraform-docs

Terraform 1.15.x — configuration language, resources, variables, modules, state, backends, providers, functions.

pledgeandgrow/pledge-skills · 29 tokens

infrastructure-as-code-guardian

Universal Infrastructure as Code (IaC) agent skill for authoring, securing, and managing cloud infrastructure across Terraform, Pulumi, CloudFormation, Ansible, and Bicep. Provides cross-tool security hardening, state management best practices, cost optimization, drift detection, and CI/CD integration. Covers AWS…

JPeetz/agent-skills · 254 tokens

databricks-platform-provisioning

Provision and test Databricks workspaces. Use when the user asks to create a workspace, set up a new environment, provision infrastructure, bootstrap Databricks, test a workspace, verify a deployment, or run validation checks against a Databricks workspace. Covers Azure, AWS, and GCP.

databricks-solutions/ai-platform-kit · 69 tokens