-
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 path_rules to RegionUrlMap (#2803)
Merged PR #2803.
- Loading branch information
1 parent
94079a3
commit 2952d0b
Showing
13 changed files
with
867 additions
and
37 deletions.
There are no files selected for viewing
Submodule ansible
updated
from 892842 to 29001a
Submodule terraform
updated
from 61092b to df454b
Submodule terraform-beta
updated
from c06f3c to a5a15b
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
104 changes: 104 additions & 0 deletions
104
templates/terraform/examples/region_url_map_l7_ilb_path.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,104 @@ | ||
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 | ||
|
||
path_rule { | ||
paths = ["/home"] | ||
route_action { | ||
cors_policy { | ||
allow_credentials = true | ||
allow_headers = ["Allowed content"] | ||
allow_methods = ["GET"] | ||
allow_origins = ["Allowed origin"] | ||
expose_headers = ["Exposed header"] | ||
max_age = 30 | ||
disabled = false | ||
} | ||
fault_injection_policy { | ||
abort { | ||
http_status = 234 | ||
percentage = 5.6 | ||
} | ||
delay { | ||
fixed_delay { | ||
seconds = 0 | ||
nanos = 50000 | ||
} | ||
percentage = 7.8 | ||
} | ||
} | ||
request_mirror_policy { | ||
backend_service = google_compute_region_backend_service.home.self_link | ||
} | ||
retry_policy { | ||
num_retries = 4 | ||
per_try_timeout { | ||
seconds = 30 | ||
} | ||
retry_conditions = ["5xx", "deadline-exceeded"] | ||
} | ||
timeout { | ||
seconds = 20 | ||
nanos = 750000000 | ||
} | ||
url_rewrite { | ||
host_rewrite = "A replacement header" | ||
path_prefix_rewrite = "A replacement path" | ||
} | ||
weighted_backend_services { | ||
backend_service = google_compute_region_backend_service.home.self_link | ||
weight = 400 | ||
header_action { | ||
request_headers_to_remove = ["RemoveMe"] | ||
request_headers_to_add { | ||
header_name = "AddMe" | ||
header_value = "MyValue" | ||
replace = true | ||
} | ||
response_headers_to_remove = ["RemoveMe"] | ||
response_headers_to_add { | ||
header_name = "AddMe" | ||
header_value = "MyValue" | ||
replace = false | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
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 | ||
} | ||
} |
73 changes: 73 additions & 0 deletions
73
templates/terraform/examples/region_url_map_l7_ilb_path_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,73 @@ | ||
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 | ||
|
||
path_rule { | ||
paths = ["/home"] | ||
route_action { | ||
retry_policy { | ||
num_retries = 4 | ||
per_try_timeout { | ||
seconds = 30 | ||
} | ||
retry_conditions = ["5xx", "deadline-exceeded"] | ||
} | ||
timeout { | ||
seconds = 20 | ||
nanos = 750000000 | ||
} | ||
url_rewrite { | ||
host_rewrite = "A replacement header" | ||
path_prefix_rewrite = "A replacement path" | ||
} | ||
weighted_backend_services { | ||
backend_service = google_compute_region_backend_service.home.self_link | ||
weight = 400 | ||
header_action { | ||
response_headers_to_add { | ||
header_name = "AddMe" | ||
header_value = "MyValue" | ||
replace = false | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
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 | ||
} | ||
} | ||
|
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
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
Oops, something went wrong.