Also know, can you debug Terraform?
Terraform has detailed logs which can be enabled by setting the TF_LOG environment variable to any value. This will cause detailed logs to appear on stderr. You can set TF_LOG to one of the log levels TRACE , DEBUG , INFO , WARN or ERROR to change the verbosity of the logs.
Secondly, how do I troubleshoot Terraform errors? Troubleshoot Terraform
- Prerequisites.
- Review the Terraform troubleshooting model.
- Clone the GitHub example repository.
- Format the configuration.
- Correct a variable interpolation error.
- Validate your configuration.
- Correct a cycle error.
- Correct a for_each error.
Also to know, how do I run a debug in Terraform?
Summary
- Make sure the main.go supports running the plugin in debug mode.
- Compile the plugin without optimisations.
- Run the plugin directly inside the debugger as if it were any other Go program.
- Export an environment variable to the Terraform Core process to instruct it to use the existing plugin instance.
- Debug!
What happens when you run Terraform plan?
The terraform plan command creates an execution plan. Reading the current state of any already-existing remote objects to make sure that the Terraform state is up-to-date. Comparing the current configuration to the prior state and noting any differences.