terraform-expert

Manage Terraform infrastructure-as-code governance and state workflows.

11|Updated Mar 12, 2023
One-click install
npx skills add https://github.com/i9wa4/dotfiles --skill terraform-expert-i9wa4
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-expert
Source: https://github.com/i9wa4/dotfiles/tree/main/dot.config/claude/skills/terraform-expert
Command: npx skills add https://github.com/i9wa4/dotfiles --skill terraform-expert-i9wa4

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides an in-depth guide to Terraform, covering CLI workflows, modules, state management, backends, expressions, and best practices for production-grade infrastructure as code.

Core Features & Use Cases

  • CLI workflows: Init, plan, apply, destroy and targeting.
  • State management: Remote backends and locking; team collaboration.
  • Modules & reuse: Module usage, sources, and best practices.
  • Data sources & expressions: Query and transform infrastructure data.

Quick Start

Run: terraform init; terraform plan; terraform apply

Frequently Asked Questions about terraform-expert

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

FAQPage Schema
How do I manage Terraform state in a team environment?

Terraform state management requires remote backends with locking to prevent concurrent modifications. Configure a remote backend (S3, Azure Storage, Terraform Cloud) and enable state locking so multiple team members can safely collaborate without corrupting infrastructure definitions or causing apply conflicts.

What's the best way to organize Terraform modules for reusability?

Structure modules with clear input variables, outputs, and a single responsibility. Use local paths or remote sources (Git, registries) to reference modules across projects. Follow naming conventions and document variables to make modules discoverable and composable across infrastructure codebases.

How do I safely handle sensitive data like database passwords in Terraform?

Use sensitive input variables marked with `sensitive = true`, store secrets in external vaults (AWS Secrets Manager, HashiCorp Vault), and avoid committing `.tfvars` files to version control. Terraform masks sensitive outputs and prevents accidental exposure in logs and state files.

What's the difference between terraform plan and terraform apply?

Terraform plan previews changes without modifying infrastructure, showing add, update, and delete operations. Terraform apply executes the planned changes and updates state. Plan acts as a safety checkpoint; review it before apply to catch unintended modifications.

Can I use data sources to query existing infrastructure in Terraform?

Data sources fetch information about existing resources without managing them. They query infrastructure details (VPCs, AMIs, DNS records) and pass that data to your configuration, enabling Terraform to reference external resources and build dynamic infrastructure definitions.

Why does Terraform use state files and what happens if they get corrupted?

State files track resource metadata and enable Terraform to detect changes and calculate diffs. Corruption or loss breaks the mapping between configuration and real resources, causing Terraform to lose track of infrastructure. Use remote backends with versioning and locking to prevent corruption and enable recovery.