-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding next_hop_ilb attribute to compute route resource (#2215)
Merged PR #2215.
- Loading branch information
1 parent
32756c9
commit d481725
Showing
3 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
resource "google_compute_network" "default" { | ||
provider = "google-beta" | ||
name = "<%= ctx[:vars]['network_name'] %>" | ||
auto_create_subnetworks = false | ||
} | ||
|
||
resource "google_compute_subnetwork" "default" { | ||
provider = "google-beta" | ||
name = "<%= ctx[:vars]['subnet_name'] %>" | ||
ip_cidr_range = "10.0.1.0/24" | ||
region = "us-central1" | ||
network = "${google_compute_network.default.self_link}" | ||
} | ||
|
||
resource "google_compute_health_check" "hc" { | ||
provider = "google-beta" | ||
name = "<%= ctx[:vars]['health_check_name'] %>" | ||
check_interval_sec = 1 | ||
timeout_sec = 1 | ||
|
||
tcp_health_check { | ||
port = "80" | ||
} | ||
} | ||
|
||
resource "google_compute_region_backend_service" "backend" { | ||
provider = "google-beta" | ||
name = "<%= ctx[:vars]['backend_name'] %>" | ||
region = "us-central1" | ||
health_checks = ["${google_compute_health_check.hc.self_link}"] | ||
} | ||
|
||
resource "google_compute_forwarding_rule" "default" { | ||
provider = "google-beta" | ||
name = "<%= ctx[:vars]['forwarding_rule_name'] %>" | ||
region = "us-central1" | ||
|
||
load_balancing_scheme = "INTERNAL" | ||
backend_service = "${google_compute_region_backend_service.backend.self_link}" | ||
all_ports = true | ||
network = "${google_compute_network.default.name}" | ||
subnetwork = "${google_compute_subnetwork.default.name}" | ||
} | ||
|
||
resource "google_compute_route" "<%= ctx[:primary_resource_id] %>" { | ||
provider = "google-beta" | ||
name = "<%= ctx[:vars]['route_name'] %>" | ||
dest_range = "0.0.0.0/0" | ||
network = "${google_compute_network.default.name}" | ||
next_hop_ilb = "${google_compute_forwarding_rule.default.self_link}" | ||
priority = 2000 | ||
} |