Minimal demo configuration
Below is the minimal Terraform configuration used for the demo:When to enable logging
Enable Terraform logging when you need more visibility into what Terraform Core and providers are doing — for example, when:- Providers fail to match or load.
- Resources unexpectedly change or are omitted from the graph.
- API calls to providers return errors and you need the request/response context.
TRACE.
TF_LOG levels
See the official environment variables reference for Terraform logging: Terraform CLI — Environment variables.
Enable verbose logging
- On macOS / Linux (bash/zsh):
- On Windows PowerShell:
TRACE and running terraform plan, you will observe many more internal messages. The excerpts below are representative: they show Terraform’s graph transforms, provider matching, HCL source ranges, and diff decisions.
TRACE logs can include sensitive data (like provider tokens, API keys, or resource attributes). Avoid sending raw trace logs to third parties without sanitizing them first.
If you must share logs with HashiCorp or a provider, redact secrets (API keys, tokens, passwords, and any sensitive attributes) before uploading. Consider limiting logs to a file and opening it in a secure editor to mask secrets.
Disable logging when finished
When you’ve captured the necessary information, turn logging off to restore concise output.- On macOS / Linux:
- On Windows PowerShell:
terraform plan returns to the normal concise output: