Replace resource (modern taint) terraform
Force destroy+recreate of one resource; replaces deprecated terraform taint
terraform apply -replace='aws_instance.web'
more terraform
all 43 commands →
Surgical targeted plan
terraform plan -target='module.db.aws_db_instance.main'
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