为什么我在Terraform中出现random_id b64属性错误?

时间:2020-10-09 05:19:40

标签: terraform terraform-provider-random

我尚未对自己的Terraform脚本进行任何更改,并且部署开始失败,并显示如下错误:

2020/10/09 05:00:42 [DEBUG] Using modified User-Agent: Terraform/0.12.26 TFE/v202007-2
Error: Unsupported attribute
  on .terraform/modules/rds.rds/main.tf line 3, in locals:
   3:   master_password      = var.password == "" ? random_id.master_password.b64 : var.password
This object has no argument, nested block, or exported attribute named "b64".

1 个答案:

答案 0 :(得分:8)

根据版本v3.0.0的变更日志:

https://github.com/hashicorp/terraform-provider-random/blob/master/CHANGELOG.md#300-october-09-2020

删除不推荐使用的b64属性

Terraform有帮助地建议:

The following providers do not have any version constraints in configuration,
so the latest version was installed.
To prevent automatic upgrades to new major versions that may contain breaking
changes, it is recommended to add version = "..." constraints to the
corresponding provider blocks in configuration, with the constraint strings
suggested below.
* provider.null: version = "~> 3.0"
* provider.random: version = "~> 3.0"
* provider.template: version = "~> 2.2"
* provider.tfe: version = "~> 0.22"

该错误的直接解决方案是通过向required_providers的{​​{1}}块中添加terraform来回退随机提供程序

main.tf