-
Notifications
You must be signed in to change notification settings - Fork 0
/
nat.tf
26 lines (20 loc) · 848 Bytes
/
nat.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_router_nat
resource "google_compute_router_nat" "nat" {
name = local.values.nat.name
router = google_compute_router.router.name
region = local.values.vpc.region
source_subnetwork_ip_ranges_to_nat = "LIST_OF_SUBNETWORKS"
nat_ip_allocate_option = "MANUAL_ONLY"
subnetwork {
name = google_compute_subnetwork.private.id
source_ip_ranges_to_nat = ["ALL_IP_RANGES"]
}
nat_ips = [google_compute_address.nat.self_link]
}
# https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_address
resource "google_compute_address" "nat" {
name = local.values.nat.name
address_type = "EXTERNAL"
network_tier = "PREMIUM"
depends_on = [google_project_service.compute]
}