Capture Debug Logs From Terraform for the Okta Terraform Provider
Last Updated:
Overview
Administrators troubleshooting the Okta Terraform Provider must capture debug logs to view the specific events and API calls made to Okta. Prepend the Terraform command with the debug log variables to generate a local log file.
Applies To
- Okta Identity Engine (OIE)
- Okta Classic Engine
- Okta Terraform Provider
Solution
How do administrators capture debug logs from Terraform?
Prepend the Terraform command with the debug log variables and specify a destination file to capture the debug logs.
- Enter
TF_LOG=debug TF_LOG_PATH="<FILENAME>"in front of the Terraform command, replacing<FILENAME>with the desired destination file. - Run the command to append the logs to the specified file.
Review the following examples of Terraform commands with the debug variables prepended.
TF_LOG=debug TF_LOG_PATH="terraform.txt" terraform plan
TF_LOG=debug TF_LOG_PATH="terraform.txt" terraform apply
Running these commands generates a terraform.txt file containing the debug logs for the plan command followed by the apply command.
NOTE: Terraform debug logs contain sensitive information such as API (SSWS) tokens or access tokens. Redact this information before uploading the file to the Okta Support Portal.
