Migrate backend on init terraform
Move state to a new backend; use -reconfigure to skip migration and reset
terraform init -migrate-state -backend-config=backend.hcl
more terraform
all 43 commands →
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
Apply a saved plan
terraform apply plan.tfplan
Import existing resource
terraform import module.path.resource_type.name <remote-id>