python-terraform
python-terraform copied to clipboard
Provide a way to set TF_LOG and TF_LOG_PATH
https://www.terraform.io/internals/debugging
Terraform support logging to file and controlling log verbosity using environment variables. Allow them to be controlled/enabled by python.
I think you can set it if you pass is_env_vars_included=True
e.g.
export TF_LOG=trace
export TF_LOG_PATH=/path/to/log/file.log
python3 your_code.py
tf = Terraform(..., is_env_vars_included=True)
thanks about is_env_vars_included I like to include python-terraform in a python cli, and I like the user to control verbosity with a cli argument (better to say I like an already existing --verbose argument to also control the verbosity of the Terraform part)