From e0c3223cee866ec785fbf5afbb0cfd076fb2ab48 Mon Sep 17 00:00:00 2001 From: Pierre Guinoiseau Date: Thu, 31 Aug 2023 22:51:57 +1200 Subject: [PATCH] chore: add a subnet in the NAT example --- examples/nat/main.tf | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/examples/nat/main.tf b/examples/nat/main.tf index 8e8363a..f8a86c6 100644 --- a/examples/nat/main.tf +++ b/examples/nat/main.tf @@ -21,7 +21,21 @@ module "vpc" { project_id = var.project_id network_name = "test-network" routing_mode = "GLOBAL" - subnets = [] + subnets = [ + { + subnet_name = "test-subnet-01" + subnet_ip = "10.10.10.0/24" + subnet_region = "us-central1" + } + ] + secondary_ranges = { + test-subnet-01 = [ + { + range_name = "test-subnet-01-secondary-01" + ip_cidr_range = "192.168.64.0/24" + }, + ] + } } @@ -35,7 +49,15 @@ module "cloud_router" { region = "us-central1" nats = [{ - name = "my-nat-gateway" + name = "my-nat-gateway" + source_subnetwork_ip_ranges_to_nat = "LIST_OF_SUBNETWORKS" + subnetworks = [ + { + name = module.vpc.subnets["us-central1/test-subnet-01"].id + source_ip_ranges_to_nat = ["PRIMARY_IP_RANGE", "LIST_OF_SECONDARY_IP_RANGES"] + secondary_ip_range_names = module.vpc.subnets["us-central1/test-subnet-01"].secondary_ip_range[*].range_name + } + ] }] } # [END cloudnat_simple_create]