-
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 route_rules to RegionUrlMap (#2807)
Merged PR #2807.
- Loading branch information
1 parent
2952d0b
commit 732ba39
Showing
10 changed files
with
1,064 additions
and
5 deletions.
There are no files selected for viewing
Submodule ansible
updated
from 29001a to 6bc2d2
Submodule inspec
updated
2 files
+2 −0 | docs/resources/google_compute_url_map.md | |
+3 −0 | libraries/google/compute/property/urlmap_path_matchers_route_rules.rb |
Submodule terraform
updated
from df454b to 6c8ef6
Submodule terraform-beta
updated
from a5a15b to 7743e4
Large diffs are not rendered by default.
Oops, something went wrong.
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
85 changes: 85 additions & 0 deletions
85
templates/terraform/examples/region_url_map_l7_ilb_route.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,85 @@ | ||
resource "google_compute_region_url_map" "<%= ctx[:primary_resource_id] %>" { | ||
provider = "google-beta" | ||
name = "<%= ctx[:vars]['region_url_map_name'] %>" | ||
description = "a description" | ||
default_service = google_compute_region_backend_service.home.self_link | ||
|
||
host_rule { | ||
hosts = ["mysite.com"] | ||
path_matcher = "allpaths" | ||
} | ||
|
||
path_matcher { | ||
name = "allpaths" | ||
default_service = google_compute_region_backend_service.home.self_link | ||
|
||
route_rules { | ||
priority = 1 | ||
header_action { | ||
request_headers_to_remove = ["RemoveMe2"] | ||
request_headers_to_add { | ||
header_name = "AddSomethingElse" | ||
header_value = "MyOtherValue" | ||
replace = true | ||
} | ||
response_headers_to_remove = ["RemoveMe3"] | ||
response_headers_to_add { | ||
header_name = "AddMe" | ||
header_value = "MyValue" | ||
replace = false | ||
} | ||
} | ||
match_rules { | ||
full_path_match = "a full path" | ||
header_matches { | ||
header_name = "someheader" | ||
exact_match = "match this exactly" | ||
invert_match = true | ||
} | ||
ignore_case = true | ||
metadata_filters { | ||
filter_match_criteria = "MATCH_ANY" | ||
filter_labels { | ||
name = "PLANET" | ||
value = "MARS" | ||
} | ||
} | ||
query_parameter_matches { | ||
name = "a query parameter" | ||
present_match = true | ||
} | ||
} | ||
url_redirect { | ||
host_redirect = "A host" | ||
https_redirect = false | ||
path_redirect = "some/path" | ||
redirect_response_code = "TEMPORARY_REDIRECT" | ||
strip_query = true | ||
} | ||
} | ||
} | ||
|
||
test { | ||
service = google_compute_region_backend_service.home.self_link | ||
host = "hi.com" | ||
path = "/home" | ||
} | ||
} | ||
|
||
resource "google_compute_region_backend_service" "home" { | ||
provider = "google-beta" | ||
name = "<%= ctx[:vars]['home_region_backend_service_name'] %>" | ||
protocol = "HTTP" | ||
timeout_sec = 10 | ||
|
||
health_checks = [google_compute_region_health_check.default.self_link] | ||
load_balancing_scheme = "INTERNAL_MANAGED" | ||
} | ||
|
||
resource "google_compute_region_health_check" "default" { | ||
provider = "google-beta" | ||
name = "<%= ctx[:vars]['region_health_check_name'] %>" | ||
http_health_check { | ||
port = 80 | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
templates/terraform/examples/region_url_map_l7_ilb_route_partial.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,61 @@ | ||
resource "google_compute_region_url_map" "<%= ctx[:primary_resource_id] %>" { | ||
provider = "google-beta" | ||
name = "<%= ctx[:vars]['region_url_map_name'] %>" | ||
description = "a description" | ||
default_service = google_compute_region_backend_service.home.self_link | ||
|
||
host_rule { | ||
hosts = ["mysite.com"] | ||
path_matcher = "allpaths" | ||
} | ||
|
||
path_matcher { | ||
name = "allpaths" | ||
default_service = google_compute_region_backend_service.home.self_link | ||
|
||
route_rules { | ||
priority = 1 | ||
service = google_compute_region_backend_service.home.self_link | ||
header_action { | ||
request_headers_to_remove = ["RemoveMe2"] | ||
} | ||
match_rules { | ||
full_path_match = "a full path" | ||
header_matches { | ||
header_name = "someheader" | ||
exact_match = "match this exactly" | ||
invert_match = true | ||
} | ||
query_parameter_matches { | ||
name = "a query parameter" | ||
present_match = true | ||
} | ||
} | ||
} | ||
} | ||
|
||
test { | ||
service = google_compute_region_backend_service.home.self_link | ||
host = "hi.com" | ||
path = "/home" | ||
} | ||
} | ||
|
||
resource "google_compute_region_backend_service" "home" { | ||
provider = "google-beta" | ||
name = "<%= ctx[:vars]['home_region_backend_service_name'] %>" | ||
protocol = "HTTP" | ||
timeout_sec = 10 | ||
|
||
health_checks = [google_compute_region_health_check.default.self_link] | ||
load_balancing_scheme = "INTERNAL_MANAGED" | ||
} | ||
|
||
resource "google_compute_region_health_check" "default" { | ||
provider = "google-beta" | ||
name = "<%= ctx[:vars]['region_health_check_name'] %>" | ||
http_health_check { | ||
port = 80 | ||
} | ||
} | ||
|
Oops, something went wrong.