What I do
Apply Terraform configuration to create, update, or delete Azure resources:
- •Execute the planned changes
- •Update the state file
- •Output resource information
When to use me
Use this skill when:
- •Ready to provision infrastructure after reviewing plan
- •Deploying new resources to Azure
- •Updating existing infrastructure
- •Running automated deployments
Commands
bash
# Interactive apply (prompts for confirmation) terraform apply # Apply a saved plan (no confirmation needed) terraform apply tfplan # Auto-approve (use with caution) terraform apply -auto-approve # Target specific resources terraform apply -target=azurerm_resource_group.main # With variable overrides terraform apply -var="environment=prod" # Replace a specific resource terraform apply -replace=azurerm_virtual_machine.main
Safety Guidelines
- •Always review the plan first - Never blind apply
- •Use saved plans in production -
terraform plan -out=tfplan && terraform apply tfplan - •Avoid -auto-approve in production - Manual confirmation prevents accidents
- •Check state after apply - Run
terraform showto verify - •Have backups - Ensure state file is backed up before major changes
Common Issues
- •Resource already exists: Import with
terraform import - •Timeout errors: Check Azure resource provisioning times
- •Permission denied: Verify Azure RBAC permissions
- •State lock: Another process may be running, or lock needs manual release