AndroidManifest.xml
的值如下:
google_compute_subnetwork.subnetwork.secondary_ip_range
我不知道该如何遍历,这是行不通的:
[
{
ip_cidr_range = 10.1.0.0/16,
range_name = my-range
}
]
答案 0 :(得分:0)
count.index
的用法在本文档中:
https://www.terraform.io/docs/configuration-0-11/interpolation.html#element-list-index-
element(aws_subnet.foo.*.id, count.index)
因此您的代码可以更改为
resource "aws_security_group_rule" "sdfsdfsdf" {
count = "${length(data.google_compute_subnetwork.mysubnetwork.secondary_ip_range)}"
type = "ingress"
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["${element(data.google_compute_subnetwork.mysubnetwork.secondary_ip_range.*.ip_cidr_range, count.index)}"]
}