# Terraform

> Terraform and OpenTofu best practices for variables, modules, descriptions, resources, plan, and import Use when this capability is needed.

- Skill: `tomevault-io/terraform-4` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/terraform-4`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/terraform-4/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/terraform-4

---


# Terraform

## Plan and import

- Don't run `terraform plan` directly; instead give the command and ask the user to execute it.
- NEVER run terraform import manually; use import statements instead.

## Variables

- Do not set `nullable = true` on variables; that is the default and is redundant.
- Only set `nullable = false` when the variable must not be null.
- Pass every value explicitly at the call site. Defaults and fallbacks—variable defaults, provider defaults, resource defaults, coalesce/fallback patterns—hide decisions and make behavior opaque. We hate them; use only as a last resort.

## Module structure

- Single call per concern: one module call per cohesive concern; merge related pieces into one module.

## Variables and outputs

- Remove unused outputs; keep only outputs that are referenced.
- Minimize environment config; don't parametrize values that never vary across environments.

## Descriptions

- Omit `description` unless it adds information not visible from the code; remove if unused.

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/vnord) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-16 -->

