运行 通过 sops 执行文件进行地形规划

Running terraform plan through sops exec-file

我有一个加密的 providers.tfvars.json,所以 运行:

sops exec-file provider.tfvars.json 'terraform plan -var-file={} -out terraform.todo'

我希望 terraform 能正常工作,但我从 terraform 收到错误消息:

Error: Argument or block definition required

解密 providers.tfvars.json,运行 terraform plan -var-file=provider.tfvars.json -out terraform.todo 有效

我试过sops exec-file --no-fifo没用。

有什么想法吗?

已在 sops 版本中修复3.7.0 with PR #761

Terraform 需要 var 文件的文件扩展名,sops 没有提供。