terraform
|
Works with
--- name: terraform description: | license: MIT --- # Terraform Skill Infrastructure-as-code reference for Terraform configurations, state management, and provider patterns. ## Quick Reference ```bash # Core workflow terraform init # Initialize, download providers terraform validate # Syntax validation terraform fmt -recursive # Format HCL files terraform plan # Preview changes terraform apply # Apply changes # Inspection terraform state list # List resources in state terraform state show <resource> # Show resource details terraform graph | dot -Tsvg > graph.svg # Dependency graph # Debug TF_LOG=DEBUG terraform plan 2>debug.log ``` ## Core Workflow ``` init → validate → fmt → plan → apply ``` 1. **init**: Download providers, initialize backend 2. **validate**: Check syntax and configuration validity 3. **fmt**: Ensure consistent formatting 4. **plan**: Preview what will change (review carefully) 5. **apply**: Execute changes ## Reference Files Load on-demand based on task: | Topic | File | When to Load | |-------|------|--------------| | Troubleshooting | [troubleshooting.md](references/troubleshooting.md) | Common errors, debugging | | State | [state-management.md](references/state-management.md) | Backends, locking, operations | | Modules | [module-design.md](references/module-design.md) | Module patterns, composition | | Security | [security.md](references/security.md) | Secrets, state security | | Proxmox Gotchas | [proxmox/gotchas.md](references/proxmox/gotchas.md) | Critical provider issues, workarounds | | Proxmox Auth | [proxmox/authentication.md](references/proxmox/authentication.md) | Provider config, API tokens | | Proxmox VMs | [proxmox/vm-qemu.md](references/proxmox/vm-qemu.md) | proxmox_vm_qemu resource patterns | | Proxmox Errors | [proxmox/troubleshooting.md](references/proxmox/troubleshooting.md) | Proxmox-specific errors | | External | [external-resources.md](references/external-resources.md) | Official docs, links | ## Validation Checklist Before `terraform apply`: - [ ] `terraform init` completed successfully - [ ] `terraform validate` passes - [ ] `terraform fmt` applied - [ ] `terraform plan` reviewed (check destroy/replace operations) - [ ] Backend configured correctly (for team environments) - [ ] State locking enabled (if remote backend) - [ ] Sensitive variables marked `sensitive = true` - [ ] Provider versions pinned in `terraform.tf` - [ ] No secrets in version control - [ ] Blast radius assessed (what could break?) ## Variable Precedence (highest to lowest) 1. `-var` flag: `terraform apply -var="name=value"` 2. `-var-file` flag: `terraform apply -var-file=prod.tfvars` 3. `*.auto.tfvars` files (alphabetically) 4. `terraform.tfvars` file 5. `TF_VAR_*` environment variables 6. Variable defaults in `variables.tf`
More DevOps & Infrastructure skills
azure-ai
microsoft/azure-skills
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
appinsights-instrumentation
microsoft/azure-skills
Guidance for instrumenting webapps with Azure Application Insights. Provides telemetry patterns, SDK setup, and configuration references. WHEN: how to instrument app, App Insights SDK, telemetry patterns, what is App Insights, Application Insights guidance, instrumentation examples, APM best practices.
azure-storage
microsoft/azure-skills
Azure Storage Services including Blob Storage, File Shares, Queue Storage, Table Storage, and Data Lake. Answers questions about storage access tiers (hot, cool, cold, archive), when to use each tier, and tier comparison. Provides object storage, SMB file shares, async messaging, NoSQL key-value, and big data analytics. Includes lifecycle management. USE FOR: blob storage, file shares, queue storage, table storage, data lake, upload files, download blobs, storage accounts, access tiers, storage tiers, hot cool cold archive, storage tier comparison, when to use storage tiers, lifecycle management, Azure Storage concepts. DO NOT USE FOR: SQL databases, Cosmos DB (use azure-prepare), messaging with Event Hubs or Service Bus (use azure-messaging).

