diff --git a/main.tf b/main.tf index 93777b29..522d16df 100644 --- a/main.tf +++ b/main.tf @@ -99,6 +99,6 @@ resource "google_compute_firewall" "default-hc" { allow { protocol = "tcp" - ports = ["${element(split(",", element(var.backend_params, count.index)), 2)}"] + ports = ["${element(split(",", element(split("|", join("", list(join("|", var.backend_params), replace(format("%*s", length(var.backend_params), ""), " ", "|")))), count.index)), 2)}"] } }