amazon-web-services - Terraform 从 0.11 升级到 0.12 出现错误连接函数中“lists”参数的值无效
问题描述
我正在将我们的代码从Terraform 0.11升级到0.12.29。
我在 TF 0.11 上运行的旧代码
我的.tf:
data "templ_file" "dep" {
template = "$${input}"
vars {
input = "${join(",", var.abc)}"
}
}
其中abc
定义为:
variable "abc" {
default = []
type = list
}
将 my.tf更新为 TF 0.12.29 的以下内容:
...
vars = {
input = join(",", var.abc)
}
但我收到此错误:
Error: Invalid function argument
on ../modules/x/y/my.tf line 6, in data "templ_file" "dep":
6: input = join(",", var.abc)
|----------------
| var.abc is list of list of dynamic with 1 element
Invalid value for "lists" parameter: incorrect list element type: string
required.
我还看到了这篇文章:https ://github.com/hashicorp/terraform/issues/20705建议使用concat
或flatten
但我无法使其工作。我是 terraform 的新手,所以这可能是一个简单的问题,但我无法使其正常工作。
解决方案
推荐阅读
- css - CSS Grid,有网格项的图像填充高度吗?
- c# - 在 sitefinity 版本 8.2 迁移后,页面重定向不保留 URL 的查询字符串部分?[asp.net/C#]
- java - 什么是实现以下问题的解决方案的最简单和最简洁的方法
- php - 根据当前登录用户获取表详细信息
- javascript - jquery fileupload.js this._on 不是函数错误
- php - Angular 模式表单 - 使用 PHP 和 Mysql 插入数据
- python - 使用 python/pandas 为 A 列中的每个唯一记录获取 B 列中的唯一值
- python - Scikit train_test_split 按索引
- sql - Oracle - 从 varchar2 列中提取用于比较的数字
- paypal - 在给定电子邮件的情况下创建付款链接