terraform 查找问题 [英] Issue with terraform lookup

查看:19
本文介绍了terraform 查找问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

This is what I'm getting when I run terraform plan, It used to work earlier with previous version, So basically concat is returning list instead of string.

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

I'm using compiled version of terraform

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

推荐答案

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

Check the CHANGELOG (always a good idea with Terraform before upgrading versions as they are constantly developing and frequently make non-backwards-compatible changes.)

0.7(未发布)

向后不兼容/注意:

[...]

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

[...]

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

这篇关于terraform 查找问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆