Skip to content
Back to skills

Terraform Module Design

ASecurity

Designs reusable Terraform modules with clear inputs and outputs, a safe state layout, and a plan review before anything is applied.

  • 3 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added November 15, 2026
ai-agentsterraformbackend

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add workspace-templates/ai-agent-templates --skill terraform-module-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Terraform Module Design?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Terraform Module Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/workspace-templates-terraform-module-design/badge)](https://www.skillsdirectory.com/skills/workspace-templates-terraform-module-design)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: terraform-module-design
description: Designs reusable Terraform modules with clear inputs and outputs, a safe state layout, and a plan review before anything is applied.
---

# Terraform module design

A module is an interface. Design the interface before the resources.

## Steps

1. State the module's purpose in one sentence and list who calls it. If you cannot, it is two modules.
2. Define inputs: typed variables with `description`, `validation` blocks for formats and ranges, and defaults only where one is safe. Prefer a few objects over many loose strings. Leave out arguments no caller needs.
3. Define outputs for every ID, ARN or endpoint another module could need, each with a `description`. Mark credentials `sensitive = true`.
4. Structure files as `main.tf`, `variables.tf`, `outputs.tf`, `versions.tf` (with `required_version` and pinned provider ranges), and an `examples/` directory that is applied in CI.
5. Use `for_each` over a map, not `count` over a list, so removing one item does not recreate the rest. Use `moved` blocks when renaming.
6. Keep state small: one state per environment and per blast radius, in a remote backend with locking. Modules never configure a backend or a provider.
7. Run `terraform fmt -check`, `terraform validate`, and `terraform plan`. Read the plan line by line.

## Rules

- Never run `terraform apply` or `destroy` unless the user asks for it in this conversation.
- Flag every `destroy` or `replace` in the plan, with the attribute that forces it.

## Report

Module interface (inputs and outputs), state layout, and the plan summary: added, changed and destroyed counts.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.