-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add route_rules to RegionUrlMap #2807
Merged
modular-magician
merged 3 commits into
GoogleCloudPlatform:master
from
tysen:regionurlmap-route
Dec 10, 2019
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spacing again