File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -23,3 +23,15 @@ resource "google_service_networking_connection" "this" {
23
23
service = " servicenetworking.googleapis.com"
24
24
reserved_peering_ranges = [google_compute_global_address . this . name ]
25
25
}
26
+
27
+ resource "google_compute_router" "this" {
28
+ name = " ${ var . namespace } -router"
29
+ network = google_compute_network. this . id
30
+ }
31
+
32
+ resource "google_compute_router_nat" "this" {
33
+ name = " ${ var . namespace } -nat"
34
+ router = google_compute_router. this . name
35
+ nat_ip_allocate_option = " AUTO_ONLY"
36
+ source_subnetwork_ip_ranges_to_nat = " ALL_SUBNETWORKS_ALL_IP_RANGES"
37
+ }
Original file line number Diff line number Diff line change @@ -2,3 +2,8 @@ variable "namespace" {
2
2
type = string
3
3
description = " The name prefix for all resources created."
4
4
}
5
+
6
+ variable "region" {
7
+ type = string
8
+ description = " The region where the router and NAT gateway will be created"
9
+ }
You can’t perform that action at this time.
0 commit comments