Set instance zone in net vpc route to avoid recreation (#90)

This commit is contained in:
Ludovico Magnocavallo
2020-06-07 18:06:15 +02:00
committed by GitHub
parent 7f49615c1d
commit cf79c65d3b
3 changed files with 17 additions and 14 deletions

View File

@@ -64,7 +64,7 @@ locals {
}
subnets = {
for subnet in var.subnets :
"${subnet.region}/${subnet.name}" => subnet
"${subnet.region}/${subnet.name}" => subnet
}
}
@@ -184,6 +184,8 @@ resource "google_compute_route" "instance" {
priority = each.value.priority
tags = each.value.tags
next_hop_instance = each.value.next_hop
# not setting the instance zone will trigger a refresh
next_hop_instance_zone = regex("zones/([^/]+)/", each.value.next_hop)[0]
}
resource "google_compute_route" "ip" {