Terraform configuration writing, module development, state management, and multi-cloud infrastructure provisioning. Use when asked to write Terraform code, create a reusable Terraform module, manage Terraform state (local, S3, Terraform Cloud), import existing infrastructure, set up workspaces for multi-environment management, or troubleshoot a Terraform plan or apply error.
User language explicitly matches trigger phrases such as write Terraform, Terraform module, terraform plan error.
The requested work fits this skill's lane: Terraform HCL writing, module development, state management, workspace strategy, import.
The task stays inside this skill's boundary and avoids adjacent areas called out as out of scope: Cloud service selection (use cloud specialist for that context); application code.
Write variables.tf with all configurable parameters; outputs.tf with service URL and ARN
Result: Complete Terraform module directory passing terraform validate
Troubleshooting
"Error: Error acquiring the state lock"
Cause: Previous run crashed holding DynamoDB lock
Fix: terraform force-unlock <LOCK_ID> - verify no other apply is running first
Plan shows unexpected resource destroy
Cause: Resource name changed, moved to a module, or provider upgrade changed resource behavior
Fix: Use terraform state mv to rename in state; or use moved {} block (Terraform 1.1+)