Skip to content

Instantly share code, notes, and snippets.

@Simonx123
Forked from Callonski/NAT_gateway.tf
Created September 7, 2020 00:58
Show Gist options
  • Save Simonx123/87f2de9207bc154142911c8c106d65e6 to your computer and use it in GitHub Desktop.
Save Simonx123/87f2de9207bc154142911c8c106d65e6 to your computer and use it in GitHub Desktop.
resource "google_compute_router_nat" "elastic-nat" {
name = "elastic-router-nat"
router = google_compute_router.elastic-router.name
region = var.region
nat_ip_allocate_option = "AUTO_ONLY"
source_subnetwork_ip_ranges_to_nat = "LIST_OF_SUBNETWORKS"
subnetwork {
name = google_compute_subnetwork.my-elastic-subnet.namesource_ip_ranges_to_nat = ["ALL_IP_RANGES"]
}
log_config {
enable = true
filter = "ALL"
}
}
resource "google_compute_router" "elastic-router" {
name = "elastic-router"
region = var.region
network = google_compute_network.my-elastic.network.self_link
bgp {
asn = 64514
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment