infra-terraform-infrastructure-as-code

Design and validate Terraform infrastructure configurations with version pinning and plan review.

Updated Mar 22, 2026
One-click install
npx skills add https://github.com/FernanSuoza/AIDD-project-bootstrap --skill infra-terraform-infrastructure-as-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: infra-terraform-infrastructure-as-code
Source: https://github.com/FernanSuoza/AIDD-project-bootstrap/tree/main/templates/skills/infra-terraform-infrastructure-as-code
Command: npx skills add https://github.com/FernanSuoza/AIDD-project-bootstrap --skill infra-terraform-infrastructure-as-code

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enable safe, reviewable, and reproducible Terraform infrastructure changes by enforcing version pinning, remote state discipline, validation, and plan review so teams avoid accidental destructive changes and drift.

Core Features & Use Cases

  • Version Pinning & Lock Files: Encourage required_providers constraints and commit .terraform.lock.hcl to ensure reproducible provider selection.
  • Backend & State Discipline: Recommend remote state backends with locking (S3+DynamoDB, Terraform Cloud, Azure Storage) and document migration procedures.
  • Module & Workspace Guidance: Help decide when to implement reusable modules versus environment roots or overlays and provide naming and output contract guidance.
  • Plan Review Workflow: Produce reviewable plans (terraform plan -out=tfplan), human-readable plan inspection, and require approval before apply.
  • Validation & Safeguards: Run terraform fmt, init, validate, and plan; flag destructive changes and require escalation for production or state/backend creation.

Quick Start

Run the infra-terraform-infrastructure-as-code skill to prepare, validate, and produce a reviewable terraform plan for the specified root and environment.

Frequently Asked Questions about infra-terraform-infrastructure-as-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a reviewable Terraform plan to prevent accidental destructive changes?

To create a reviewable Terraform plan, generate a plan file using the `terraform plan -out=tfplan` command, inspect the human-readable output, and require explicit approval before applying. This workflow flags destructive changes and escalates production risks.

Why do I need to commit the .terraform.lock.hcl file in infrastructure as code?

Committing the `.terraform.lock.hcl` file ensures reproducible provider selection across your infrastructure as code workflow. It pins provider versions defined in `required_providers`, preventing unexpected behavior from automatic provider upgrades during routine plan execution.

What is the best way to configure remote state and locking for Terraform?

The best way to configure remote state is using a backend with locking, such as S3 with DynamoDB, Terraform Cloud, or Azure Storage. This discipline prevents state corruption during concurrent modifications and documents migration procedures.

When should I use reusable Terraform modules versus environment roots or overlays?

Use reusable Terraform modules when multiple environments share identical infrastructure components, and use environment roots or overlays when configurations require environment-specific variations. This guidance includes establishing clear naming conventions and output contracts.

Does Terraform validation require running fmt, init, and plan before applying changes?

Yes, Terraform validation requires running `terraform fmt`, `init`, and `validate` before applying changes. These commands ensure proper formatting, initialize required providers, and validate infrastructure configurations against syntax and type requirements.