Skip to content

Commit

Permalink
Add new submodule for service-networking
Browse files Browse the repository at this point in the history
  • Loading branch information
q2w committed Aug 6, 2024
1 parent 2e75f03 commit 344c0d3
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions modules/service-networking/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
resource "google_compute_global_address" "private_ip_address" {
name = "private-ip-address"
purpose = "VPC_PEERING"
address_type = "INTERNAL"
prefix_length = 16
network = google_compute_network.peering_network.id
}

resource "google_service_networking_connection" "default" {
network = google_compute_network.peering_network.id
service = "servicenetworking.googleapis.com"
reserved_peering_ranges = [google_compute_global_address.private_ip_address.name]
}

resource "google_compute_network_peering_routes_config" "peering_routes" {
peering = google_service_networking_connection.default.peering
network = google_compute_network.peering_network.name
import_custom_routes = true
export_custom_routes = true
}

resource "google_service_networking_peered_dns_domain" "default" {
name = "example-com"
network = google_compute_network.peering_network.name
dns_suffix = "example.com."
service = "servicenetworking.googleapis.com"
}
Empty file.
Empty file.
Empty file.

0 comments on commit 344c0d3

Please sign in to comment.