What I do
Generate a Terraform execution plan that shows:
- •Resources to be created
- •Resources to be modified
- •Resources to be destroyed
- •Drift detection from current state
When to use me
Use this skill when:
- •Before applying any infrastructure changes
- •To review what changes Terraform will make
- •To validate configuration changes
- •As part of CI/CD pipeline validation
Commands
bash
# Generate plan with output to terminal terraform plan # Save plan to file for later apply terraform plan -out=tfplan # Plan for destroy terraform plan -destroy # Target specific resources terraform plan -target=azurerm_resource_group.main # With variable overrides terraform plan -var="environment=prod" # Refresh-only to detect drift terraform plan -refresh-only
Reading Plan Output
- •
+Resource will be created - •
-Resource will be destroyed - •
~Resource will be updated in-place - •
-/+Resource will be destroyed and recreated - •
<=Resource will be read during apply
Best Practices
- •Always run
terraform planbeforeterraform apply - •Save plans to files for production deployments
- •Review all changes carefully, especially destroys
- •Use
-targetsparingly and only when necessary