Back to course

Debugging Terraform (TF_LOG)

Infrastructure as Code (Terraform & OpenTofu Mastery)

When Things Go Wrong

If a command is failing and you don't know why, you can enable verbose logging.

bash export TF_LOG=DEBUG tofu apply

This will show you every raw API request and response between OpenTofu and the Cloud Provider. (Remember to unset it afterward, as it's very noisy).