Migrate the backend on init
Move state to a new backend; use -reconfigure to skip the migration and reset the backend settings
terraform init -migrate-state -backend-config=backend.hcl
- tool
- terraform43 commands
More terraform commands
-
terraform output -json | jq -r '.endpoints.value[]'Pipe machine-readable outputs to jq for scripts and other tools
-
TF_LOG=DEBUG TF_LOG_PATH=tf.log terraform planWrite provider and API debug logs to a file; TRACE is the most verbose level
-
terraform plan -var-file=prod.tfvars -out=plan.tfplanShow the changes and save the plan to a file, so CI applies exactly this plan
-
terraform apply plan.tfplanApply exactly the plan you generated before, without interactive prompts
-
terraform import module.path.resource_type.name <remote-id>Put a resource that already exists under Terraform control