i have a module that launches a vpn server. i want to modify it to launch a second, identical one in a different az/subnet. here is my code:
resource "aws_instance" "vpn_server" {
count = 2
instance_type = "t2.medium"
subnet_id = "${element(var.dmzs, count.index)}"
source_dest_check = false
}
i can easily make this work with AZs, since i have those in my
main.tf and can pass in var.azs and apply to the element to that, but my subnets are in the module itself, and i need to use those.
how can i modify by above code to have the counter iterate over two subnets? kind of like:
i dont even know if i would use "element" in this case.