我正在从tf 11升级到tf 12,我遇到了这个问题。以前在tf 11中可以使用,现在在tf 12中可以使用。有人可以帮我解决这个问题吗?
data "aws_subnet_ids" "private" {
vpc_id = data.aws_ssm_parameter.vpc_id.value
tags = {
tier = "private"
}
}
data "aws_subnet" "private" {
count = length(data.aws_subnet_ids.private.ids)
id = data.aws_subnet_ids.private.ids[count.index]
}
27: id = data.aws_subnet_ids.private.ids[count.index]
|----------------
| count.index is 0
| data.aws_subnet_ids.private.ids is set of string with 3 elements
This value does not have any indices.
答案 0 :(得分:0)
此问题已解决
data "aws_subnet" "private" {
for_each = data.aws_subnet_ids.private.ids
id = each.value
}