variable "rules" {
default = {
a = "200,false,tcp,allow,0.0.0.0/0,23,23"
b = "100,true,tcp,allow,0.0.0.0/0,1024,65535"
}
}
resource "aws_network_acl_rule" "bar" {
network_acl_id = "<id>"
rule_number = "${split(",",element(values(var.rules),count.index))[0]}"
egress = "${split(",",element(values(var.rules),count.index))[1]}"
protocol = "${split(",",element(values(var.rules),count.index))[2]}"
rule_action = "${split(",",element(values(var.rules),count.index))[3]}"
cidr_block = "${split(",",element(values(var.rules),count.index))[4]}"
from_port = "${split(",",element(values(var.rules),count.index))[5]}"
to_port = "${split(",",element(values(var.rules),count.index))[6]}"
count = "${length(values(var.rules))}"
}expected "}" but found "["--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/3f4a60cd-11f4-44d9-9705-02a981856728%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
variable "rules" {
default = {
"a" = "200,false,tcp,allow,0.0.0.0/0,23,23"
"b" = "100,true,tcp,allow,0.0.0.0/0,1024,65535"
}
}
resource "aws_network_acl_rule" "bar" {
count = "${length(var.rules)}"
network_acl_id = "${aws_network_acl.bar.id}"
rule_number = "${element(split(",",element(values(var.rules),count.index)),0)}"
egress = "${element(split(",",element(values(var.rules),count.index)),1)}"
protocol = "${element(split(",",element(values(var.rules),count.index)),2)}"
rule_action = "${element(split(",",element(values(var.rules),count.index)),3)}"
cidr_block = "${element(split(",",element(values(var.rules),count.index)),4)}"
from_port = "${element(split(",",element(values(var.rules),count.index)),5)}"
to_port = "${element(split(",",element(values(var.rules),count.index)),6)}" To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.