Skip to content

Commit

Permalink
FIX: conditionally render nat and router based on network creation. (#…
Browse files Browse the repository at this point in the history
…769)

* deployed partner mainnet node, added fixes for partner code

* added logging to backend service from LB

* swapped role binding for non-authoritive member

* swapped echo command for secret creation to printf to avoid newline

* FIX: Conditionally render router and nat for networking
  • Loading branch information
kmaus-near authored Jul 30, 2024
1 parent 401ba83 commit 3ebca41
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions infra/partner-mainnet/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,18 @@ module "vpc" {
}

resource "google_compute_router" "router" {
count = var.create_network ? 1 : 0
name = "default"
network = var.network
project = var.project_id
region = var.region
}

resource "google_compute_router_nat" "nat" {
name = "nat"
router = google_compute_router.router.name
region = var.region
nat_ip_allocate_option = "AUTO_ONLY"
count = var.create_network ? 1 : 0
name = "nat"
router = google_compute_router.router[count.index].name
region = var.region
nat_ip_allocate_option = "AUTO_ONLY"
source_subnetwork_ip_ranges_to_nat = "ALL_SUBNETWORKS_ALL_IP_RANGES"
}

0 comments on commit 3ebca41

Please sign in to comment.