Skip to content

Instantly share code, notes, and snippets.

@Callonski
Last active September 7, 2020 00:58
Show Gist options
  • Save Callonski/26359f17f6f9573a2ca27d86a81fe5d0 to your computer and use it in GitHub Desktop.
Save Callonski/26359f17f6f9573a2ca27d86a81fe5d0 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