| name | terraform |
| description | Plan, apply, and manage infrastructure with Terraform. Use when tasks mention terraform commands, HCL configuration, provider setup, state management, or workspace operations. |
| license | MIT |
| metadata | {"author":"greedychipmunk","version":"1.0"} |
Terraform
Intent Router
| Request | Reference | Load When |
|---|
| Install tool, first-time setup, tfenv | resources/install-and-setup.md | User needs to install Terraform or manage versions |
| Provider config, variables, backends | resources/configuration.md | User needs provider blocks, variable files, or backend setup |
| CLI commands, workflows | resources/command-cookbook.md | User needs init/plan/apply/destroy patterns or state commands |
| State management, remote backends | resources/state-and-backends.md | User asks about state files, locking, or remote backends |
Quick Start
terraform init
terraform plan
terraform apply
terraform destroy
Core Command Tracks
- Initialize:
terraform init — downloads providers, sets up backend
- Validate & format:
terraform validate, terraform fmt -recursive
- Preview:
terraform plan [-out=tfplan] — no changes made
- Apply:
terraform apply [tfplan] — creates/updates resources
- Inspect state:
terraform state list, terraform state show <resource>
- Workspaces:
terraform workspace list, terraform workspace select <name>
Safety Guardrails
- Always run
terraform plan before terraform apply — review the diff carefully.
terraform destroy is irreversible — confirm resource list before proceeding.
- Never commit
terraform.tfstate or .tfvars files containing secrets to version control.
- Use
-target sparingly; it can leave state inconsistent.
- Enable state locking on remote backends to prevent concurrent modifications.
terraform state list
terraform state show aws_instance.web
Workflow
- Write or edit
.tf configuration files.
- Run
terraform fmt to normalize formatting.
- Run
terraform validate to catch syntax errors.
- Run
terraform plan and review the proposed changes.
- Run
terraform apply only after reviewing the plan.
- Commit updated
terraform.lock.hcl but never terraform.tfstate.
Related Skills
- pulumi — IaC using general-purpose languages (TypeScript, Python, Go, C#)
- ansible — configuration management and agentless automation
References