agentleFS
NikoxkxNikoxkx/Agent-Skills/skills/devops/terraform-module-builder/SKILL.md

terraform-module-builder

Skill1 starsChanged 5 months agoApache-2.0View on GitHub

Creates reusable Terraform modules for cloud infrastructure. Use when provisioning AWS, GCP, or Azure resources with Infrastructure as Code.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Only expose what consumers need.

    line 52
  2. Very specific:

    Existing resources: Use terraform import guidance.

    line 74

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Overview

Builds well-structured, reusable Terraform modules following best practices: main.tf, variables.tf (with validation), outputs.tf, versions.tf, remote state backend configuration, and a complete example module for a common pattern (VPC + EC2 + S3 bucket, or equivalent on other clouds).

When to Use This Skill

  • Provisioning or refactoring cloud infrastructure as code.
  • Creating reusable components that multiple teams or projects will use.
  • The user says "Terraform", "IaC", "provision AWS", "create VPC", etc.

Prerequisites

  • Terraform >= 1.5 installed.
  • Cloud provider credentials configured (AWS profile, GCP application default, Azure CLI).
  • Remote state backend (S3 + DynamoDB for AWS, GCS for GCP, etc.).

Steps

  1. Module structure:
    modules/vpc/
      main.tf
      variables.tf
      outputs.tf
      versions.tf
  2. variables.tf:
    • Descriptive descriptions.
    • type constraints.
    • default where safe.
    • validation blocks for important vars.
  3. main.tf:
    • Resources with consistent naming (use local.name or var.name prefix).
    • Data sources.
    • Locals for computed values.
  4. outputs.tf:
    • Only expose what consumers need.
    • Sensitive outputs marked.
  5. State & backend:
    • Recommend remote backend from day one.
    • Provide backend.tf example (commented for module, required in root).
  6. Complete example:
    • A full root module that uses the VPC module + creates an EC2 instance + S3 bucket with proper IAM.
  7. Output:
    • All module files.
    • Example usage in a root main.tf.
    • terraform init/plan/apply commands.
    • State migration notes.

Examples

A complete, reusable vpc module for AWS (with public/private subnets, NAT, route tables, security groups) plus a root example that provisions a small web server behind it and an S3 bucket is included.

Edge Cases & Error Handling

  • Existing resources: Use terraform import guidance.
  • Multi-region / multi-account: Show workspace or provider alias patterns.
  • Drift detection: Regular terraform plan in CI.

Verification

  1. terraform init.
  2. terraform plan — clean plan.
  3. terraform apply — resources created.
  4. terraform destroy — cleans up.
  5. Module can be called from another repo with source = "git::..." or Terraform Registry.
  6. Success: Infrastructure is reproducible, state is remote and locked, variables are validated, and the module is easy to reuse.

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.