【问题标题】:Issue with terraform lookupterraform 查找问题
【发布时间】:2016-11-17 10:23:13
【问题描述】:

这是我在运行 terraform plan 时得到的,它曾经在早期版本中工作过,所以基本上 concat 是返回列表而不是字符串。

Errors:

* At column 3, line 1: lookup: argument 2 should be type string, got type list in:

${lookup(var.az, concat("zone", count.index + 1))}

我正在使用编译版的 terraform

$ terraform --version
Terraform v0.7.0-dev (854c9bd488dfdb12303ec47e42d6de8fc17e40a5)

【问题讨论】:

    标签: amazon-web-services terraform


    【解决方案1】:

    检查CHANGELOG(在升级版本之前使用 Terraform 总是一个好主意,因为它们在不断开发并经常进行非向后兼容的更改。)

    0.7(未发布)

    向后不兼容/注意:

    [...]

    • concat() 插值函数不能再用于连接字符串。

    [...]

    • 您现在可以使用语法 var.map["key"] 或 查找函数而不是 var.map.key。

    【讨论】:

      猜你喜欢
      • 2022-06-28
      • 2019-01-08
      • 2011-08-31
      • 2010-09-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多