如何调试 terraform

Tom*_*Tom 1 terraform terraform-modules

我试图测试运行我公司的 terraform 模块。

\n

然后运行 ​​terraform apply 出现以下错误。

\n
\xe2\x95\xb7\n\xe2\x94\x82 Error: Missing required argument\n\xe2\x94\x82\n\xe2\x94\x82 The argument "domain" is required, but was not set.\n\n
Run Code Online (Sandbox Code Playgroud)\n

我搜索了所有项目文件夹,包括文件夹中的文件.terraform,但找不到该变量。

\n

我如何知道哪个 terraform 脚本给出了该错误?

\n

BMW*_*BMW 7

  1. 如果需要在 terraform 中启用调试,请TF_LOG=debug在 Linux 中的正常 terraform 命令之前添加,例如
TF_LOG=debug terraform plan
Run Code Online (Sandbox Code Playgroud)
  1. 对于您的问题,您错过了提供变量值。尝试
terraform plan -var domain=xxxx
Run Code Online (Sandbox Code Playgroud)