Surgical targeted plan terraform
Limit plan to one address; note: -target is an escape hatch, can mask drift
terraform plan -target='module.db.aws_db_instance.main'
more terraform
all 43 commands →
Refresh-only plan (detect drift)
terraform plan -refresh-only
Migrate backend on init
terraform init -migrate-state -backend-config=backend.hcl
Query outputs with jq
terraform output -json | jq -r '.endpoints.value[]'
Trace plan with TF_LOG
TF_LOG=DEBUG TF_LOG_PATH=tf.log terraform plan
Plan with var file
terraform plan -var-file=prod.tfvars -out=plan.tfplan