forked from pierront/but3-iac
bonus nat
This commit is contained in:
@@ -79,3 +79,23 @@ resource "google_compute_firewall" "database_firewall" {
|
|||||||
ports = ["3306"]
|
ports = ["3306"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "google_compute_router" "nat_router" {
|
||||||
|
name = "${var.project_name}-nat-router"
|
||||||
|
region = var.region
|
||||||
|
network = google_compute_network.vpc.id
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "google_compute_router_nat" "nat_config" {
|
||||||
|
name = "${var.project_name}-cloud-nat"
|
||||||
|
router = google_compute_router.nat_router.name
|
||||||
|
region = var.region
|
||||||
|
|
||||||
|
nat_ip_allocate_option = "AUTO_ONLY"
|
||||||
|
source_subnetwork_ip_ranges_to_nat = "ALL_SUBNETWORKS_ALL_IP_RANGES"
|
||||||
|
|
||||||
|
log_config {
|
||||||
|
enable = true
|
||||||
|
filter = "ALL"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user