Terraform JSON "At 1:1: illegal char" 错误
Terraform JSON "At 1:1: illegal char" error
尝试使用 JSON 运行 terraform init
时,我不断收到错误消息:
There are some problems with the configuration, described below.
The Terraform configuration must be valid before initialization so that
Terraform can determine which modules and providers need to be installed.
Error: Error parsing C:\terraform\terraform.tf.json: At 1:1: illegal char
JSON 有效,HCF 版本按预期工作。怎么了?
我正在为自己回答这个问题,因为它花了一些时间才算出来。
JSON 文件是 BOM 格式的 UTF8 文件,我假设 1:1 处的非法字符是 BOM 本身。一旦我将内容保存为没有 BOM 的普通文件,terraform 就会按预期工作。
尝试使用 JSON 运行 terraform init
时,我不断收到错误消息:
There are some problems with the configuration, described below.
The Terraform configuration must be valid before initialization so that
Terraform can determine which modules and providers need to be installed.
Error: Error parsing C:\terraform\terraform.tf.json: At 1:1: illegal char
JSON 有效,HCF 版本按预期工作。怎么了?
我正在为自己回答这个问题,因为它花了一些时间才算出来。
JSON 文件是 BOM 格式的 UTF8 文件,我假设 1:1 处的非法字符是 BOM 本身。一旦我将内容保存为没有 BOM 的普通文件,terraform 就会按预期工作。