有什么方法可以跟踪 terraform.exe 对提供者进行的 REST 调用吗?

Is there any way to trace the REST calls that terraform.exe makes to the provider?

我来自 azurerm 提供商背景,我希望 terraform.exe 在我们调用 terraform planterraform apply

时进行 Azure ARM REST 调用

我知道我可以使用 wireshark 之类的工具进行网络跟踪,但我希望应该有更精简的解决方案。

terraform 是否提供 REST 调用跟踪,以便我知道它使用的是哪个确切的提供程序(aws 或 azurerm)REST API?

运行 您的 Terraform TF_LOG 环境变量设置为 TRACE(或者 DEBUG 就足够了吗?)。

在Linux我做:

TF_LOG=TRACE terraform apply

我猜你正在使用 Windows,所以这样的方法可能会起作用:

set TF_LOG=TRACE
terraform.exe apply