Playbooks for Terraform
Note: these are provided as internal reference documents. You should rarely need to use this and please reach out to the distribution team or ask in the #dev-ops channel before performing these steps.
To debug some more involved terraform problems you may need to directly modify the state file.
TF_DEBUGenvironment variable with
DEBUGlogs enabled to locate a possible source of the issue.
terraform state pullto examine the statefile locally.
If possible, use
terraform state rm/
terraform state mv X Yto make the necessary state modifications. Otherwise, manually edit the state file and run
terraform state pushto update the remote state.
- In cases where a corrupted state has been pushed, you can pull a previous object version with gsutil
File bugs as appropriate, statefile modification should typically not be necessary