Skip to content

Commit

Permalink
chore: add a subnet in the NAT example
Browse files Browse the repository at this point in the history
  • Loading branch information
peikk0 committed Aug 31, 2023
1 parent ea52554 commit e0c3223
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions examples/nat/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
]
}
}


Expand All @@ -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]

0 comments on commit e0c3223

Please sign in to comment.