From e082fdf36aab370d55b1168487dd1bd7da6e034f Mon Sep 17 00:00:00 2001 From: Zachary Blasczyk Date: Mon, 9 Dec 2024 08:58:41 -0600 Subject: [PATCH 1/4] fix nat --- modules/networking/main.tf | 12 ++++++++++++ modules/networking/variables.tf | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/modules/networking/main.tf b/modules/networking/main.tf index e0770dc..5652219 100644 --- a/modules/networking/main.tf +++ b/modules/networking/main.tf @@ -23,3 +23,15 @@ resource "google_service_networking_connection" "this" { service = "servicenetworking.googleapis.com" reserved_peering_ranges = [google_compute_global_address.this.name] } + +resource "google_compute_router" "this" { + name = "${var.namespace}-router" + network = google_compute_network.this.id +} + +resource "google_compute_router_nat" "this" { + name = "${var.namespace}-nat" + router = google_compute_router.this.name + nat_ip_allocate_option = "AUTO_ONLY" + source_subnetwork_ip_ranges_to_nat = "ALL_SUBNETWORKS_ALL_IP_RANGES" +} diff --git a/modules/networking/variables.tf b/modules/networking/variables.tf index 3c02d91..a85249f 100644 --- a/modules/networking/variables.tf +++ b/modules/networking/variables.tf @@ -2,3 +2,8 @@ variable "namespace" { type = string description = "The name prefix for all resources created." } + +variable "region" { + type = string + description = "The region where the router and NAT gateway will be created" +} From 817ebce6239aaa28eebd51dda6bcc1a22d02bb5f Mon Sep 17 00:00:00 2001 From: Zachary Blasczyk Date: Mon, 9 Dec 2024 09:01:33 -0600 Subject: [PATCH 2/4] fix --- modules/networking/variables.tf | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/networking/variables.tf b/modules/networking/variables.tf index a85249f..50a4575 100644 --- a/modules/networking/variables.tf +++ b/modules/networking/variables.tf @@ -3,7 +3,3 @@ variable "namespace" { description = "The name prefix for all resources created." } -variable "region" { - type = string - description = "The region where the router and NAT gateway will be created" -} From ade740d6bb0e204d26168a0a5138b1593dab2e8b Mon Sep 17 00:00:00 2001 From: Zachary Blasczyk Date: Mon, 9 Dec 2024 09:01:56 -0600 Subject: [PATCH 3/4] fix --- modules/networking/variables.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/networking/variables.tf b/modules/networking/variables.tf index 50a4575..3c02d91 100644 --- a/modules/networking/variables.tf +++ b/modules/networking/variables.tf @@ -2,4 +2,3 @@ variable "namespace" { type = string description = "The name prefix for all resources created." } - From 542a8fbc1f1414b0442e00c9f44a1e7ce84484d2 Mon Sep 17 00:00:00 2001 From: Zachary Blasczyk Date: Mon, 9 Dec 2024 09:38:07 -0600 Subject: [PATCH 4/4] bump the helm chart version --- variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index ecd0bec..4df9ea0 100644 --- a/variables.tf +++ b/variables.tf @@ -59,7 +59,7 @@ variable "google_auth" { variable "chart_version" { type = string - default = "0.2.8" + default = "0.3.6" } variable "github_bot" {