【发布时间】:2019-11-05 02:10:07
【问题描述】:
我正在从 terraform 0.11.4 升级到 0.12.2。我已经按照this guide 整理了大部分内容,但我似乎找不到以下列表表达式的解决方案。
variable "subnetIds" {
type = "list"
}
resource "aws_lb" "main" {
name = "myload-balancer"
subnets = ["${var.subnetIds}"] # <-- problem row
security_groups = ["${var.securityGroupIds}"]
}
错误信息是:
on main.tf line 10, in resource "aws_lb" "main":
10: subnets = ["${var.subnetIds}"]
Inappropriate value for attribute "subnets": element 0: string required.
如果我删除括号 [] 我会收到以下错误:
on main.tf line 10, in resource "aws_lb" "main":
10: subnets = "${var.subnetIds}"
Inappropriate value for attribute "subnets": incorrect set element type:
string required.
使用 terraform 0.12+ 为资源 aws_lb 表达 subnets 的正确方法是什么?
【问题讨论】:
标签: terraform terraform-provider-aws