Problem
You want to get support on a Terraform template issue and want to have detailed log files available to make troubleshooting easier.
Cause
Terraform does not save TRACE
level log files by default.
Solution
To enable Terraform logs you must configure the TF_LOG
and TF_LOG_PATH
environment variables before running the terraform init
, terraform plan
, and terraform apply
commands.
Depending on your environment the setup of these variables may be different. For example this format is used for a bash console:
export TF_LOG="TRACE"
export TF_LOG_PATH="tmp/terraform.log"
After logging has been enabled, reproduce the issue and then download the log file from the log path.
You can review the Terraform log file to troubleshoot the issue. If you need additional help, open a support ticket and attach the log file to the ticket.
For more information, review the Debugging Terraform documentation.