-
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.
Add EXTERNAL_MANAGED to global forwarding rule yaml and example
- Loading branch information
Alex Ellis
committed
Jan 21, 2022
1 parent
bbd9c50
commit ab3bdbf
Showing
3 changed files
with
67 additions
and
1 deletion.
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
53 changes: 53 additions & 0 deletions
53
mmv1/templates/terraform/examples/global_forwarding_rule_external_managed.tf.erb
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,53 @@ | ||
resource "google_compute_global_forwarding_rule" "default" { | ||
provider = google-beta | ||
name = "<%= ctx[:vars]['forwarding_rule_name'] %>" | ||
target = google_compute_target_http_proxy.default.id | ||
port_range = "80" | ||
load_balancing_scheme = "EXTERNAL_MANAGED" | ||
} | ||
|
||
resource "google_compute_target_http_proxy" "default" { | ||
provider = google-beta | ||
name = "<%= ctx[:vars]['http_proxy_name'] %>" | ||
description = "a description" | ||
url_map = google_compute_url_map.default.id | ||
} | ||
|
||
resource "google_compute_url_map" "default" { | ||
provider = google-beta | ||
name = "url-map-<%= ctx[:vars]['http_proxy_name'] %>" | ||
description = "a description" | ||
default_service = google_compute_backend_service.default.id | ||
|
||
host_rule { | ||
hosts = ["mysite.com"] | ||
path_matcher = "allpaths" | ||
} | ||
|
||
path_matcher { | ||
name = "allpaths" | ||
default_service = google_compute_backend_service.default.id | ||
|
||
path_rule { | ||
paths = ["/*"] | ||
service = google_compute_backend_service.default.id | ||
} | ||
} | ||
} | ||
|
||
resource "google_compute_backend_service" "default" { | ||
provider = google-beta | ||
name = "<%= ctx[:vars]['backend_service_name'] %>" | ||
port_name = "http" | ||
protocol = "HTTP" | ||
timeout_sec = 10 | ||
load_balancing_scheme = "EXTERNAL_MANAGED" | ||
} | ||
|
||
resource "google_compute_http_health_check" "default" { | ||
provider = google-beta | ||
name = "check-<%= ctx[:vars]['backend_service_name'] %>" | ||
request_path = "/" | ||
check_interval_sec = 1 | ||
timeout_sec = 1 | ||
} |