Skip to content
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 path_rules to RegionUrlMap #5122

Merged
merged 1 commit into from
Dec 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions google/resource_compute_url_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ less than one second are represented with a 0 'seconds' field and a positive
"retry_conditions": {
Type: schema.TypeList,
Optional: true,
Description: `Specfies one or more conditions when this retry rule applies. Valid values are:
Description: `Specifies one or more conditions when this retry rule applies. Valid values are:
- 5xx: Loadbalancer will attempt a retry if the backend service responds with
any 5xx response code, or if the backend service does not respond at all,
example: disconnects, reset, read timeout, connection failure, and refused
Expand Down Expand Up @@ -611,6 +611,16 @@ HttpRouteAction.`,
Description: `The default BackendService resource. Before
forwarding the request to backendService, the loadbalancer applies any relevant
headerActions specified as part of this backendServiceWeight.`,
},
"weight": {
Type: schema.TypeInt,
Required: true,
Description: `Specifies the fraction of traffic sent to backendService, computed as weight /
(sum of all weightedBackendService weights in routeAction) . The selection of a
backend service is determined only for new traffic. Once a user's request has
been directed to a backendService, subsequent requests will be sent to the same
backendService as determined by the BackendService's session affinity policy.
The value must be between 0 and 1000`,
},
"header_action": {
Type: schema.TypeList,
Expand Down Expand Up @@ -695,16 +705,6 @@ prior to sending the response back to the client.`,
},
},
},
"weight": {
Type: schema.TypeInt,
Optional: true,
Description: `Specifies the fraction of traffic sent to backendService, computed as weight /
(sum of all weightedBackendService weights in routeAction) . The selection of a
backend service is determined only for new traffic. Once a user's request has
been directed to a backendService, subsequent requests will be sent to the same
backendService as determined by the BackendService's session affinity policy.
The value must be between 0 and 1000`,
},
},
},
},
Expand Down
38 changes: 19 additions & 19 deletions google/resource_compute_url_map_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func testAccComputeUrlMap_urlMapTrafficDirectorRouteExample(context map[string]i
resource "google_compute_url_map" "urlmap" {
name = "urlmap%{random_suffix}"
description = "a description"
default_service = "${google_compute_backend_service.home.self_link}"
default_service = google_compute_backend_service.home.self_link

host_rule {
hosts = ["mysite.com"]
Expand All @@ -164,7 +164,7 @@ resource "google_compute_url_map" "urlmap" {

path_matcher {
name = "allpaths"
default_service = "${google_compute_backend_service.home.self_link}"
default_service = google_compute_backend_service.home.self_link

route_rules {
priority = 1
Expand Down Expand Up @@ -213,7 +213,7 @@ resource "google_compute_url_map" "urlmap" {
}

test {
service = "${google_compute_backend_service.home.self_link}"
service = google_compute_backend_service.home.self_link
host = "hi.com"
path = "/home"
}
Expand All @@ -225,7 +225,7 @@ resource "google_compute_backend_service" "home" {
protocol = "HTTP"
timeout_sec = 10

health_checks = ["${google_compute_health_check.default.self_link}"]
health_checks = [google_compute_health_check.default.self_link]
load_balancing_scheme = "INTERNAL_SELF_MANAGED"
}

Expand Down Expand Up @@ -267,7 +267,7 @@ func testAccComputeUrlMap_urlMapTrafficDirectorRoutePartialExample(context map[s
resource "google_compute_url_map" "urlmap" {
name = "urlmap%{random_suffix}"
description = "a description"
default_service = "${google_compute_backend_service.home.self_link}"
default_service = google_compute_backend_service.home.self_link

host_rule {
hosts = ["mysite.com"]
Expand All @@ -276,7 +276,7 @@ resource "google_compute_url_map" "urlmap" {

path_matcher {
name = "allpaths"
default_service = "${google_compute_backend_service.home.self_link}"
default_service = google_compute_backend_service.home.self_link

route_rules {
priority = 1
Expand All @@ -296,7 +296,7 @@ resource "google_compute_url_map" "urlmap" {
}

test {
service = "${google_compute_backend_service.home.self_link}"
service = google_compute_backend_service.home.self_link
host = "hi.com"
path = "/home"
}
Expand All @@ -308,7 +308,7 @@ resource "google_compute_backend_service" "home" {
protocol = "HTTP"
timeout_sec = 10

health_checks = ["${google_compute_health_check.default.self_link}"]
health_checks = [google_compute_health_check.default.self_link]
load_balancing_scheme = "INTERNAL_SELF_MANAGED"
}

Expand Down Expand Up @@ -350,7 +350,7 @@ func testAccComputeUrlMap_urlMapTrafficDirectorPathExample(context map[string]in
resource "google_compute_url_map" "urlmap" {
name = "urlmap%{random_suffix}"
description = "a description"
default_service = "${google_compute_backend_service.home.self_link}"
default_service = google_compute_backend_service.home.self_link

host_rule {
hosts = ["mysite.com"]
Expand All @@ -359,7 +359,7 @@ resource "google_compute_url_map" "urlmap" {

path_matcher {
name = "allpaths"
default_service = "${google_compute_backend_service.home.self_link}"
default_service = google_compute_backend_service.home.self_link

path_rule {
paths = ["/home"]
Expand Down Expand Up @@ -388,7 +388,7 @@ resource "google_compute_url_map" "urlmap" {
}
}
request_mirror_policy {
backend_service = "${google_compute_backend_service.home.self_link}"
backend_service = google_compute_backend_service.home.self_link
}
retry_policy {
num_retries = 4
Expand All @@ -406,7 +406,7 @@ resource "google_compute_url_map" "urlmap" {
path_prefix_rewrite = "A replacement path"
}
weighted_backend_services {
backend_service = "${google_compute_backend_service.home.self_link}"
backend_service = google_compute_backend_service.home.self_link
weight = 400
header_action {
request_headers_to_remove = ["RemoveMe"]
Expand All @@ -428,7 +428,7 @@ resource "google_compute_url_map" "urlmap" {
}

test {
service = "${google_compute_backend_service.home.self_link}"
service = google_compute_backend_service.home.self_link
host = "hi.com"
path = "/home"
}
Expand All @@ -440,7 +440,7 @@ resource "google_compute_backend_service" "home" {
protocol = "HTTP"
timeout_sec = 10

health_checks = ["${google_compute_health_check.default.self_link}"]
health_checks = [google_compute_health_check.default.self_link]
load_balancing_scheme = "INTERNAL_SELF_MANAGED"
}

Expand Down Expand Up @@ -482,7 +482,7 @@ func testAccComputeUrlMap_urlMapTrafficDirectorPathPartialExample(context map[st
resource "google_compute_url_map" "urlmap" {
name = "urlmap%{random_suffix}"
description = "a description"
default_service = "${google_compute_backend_service.home.self_link}"
default_service = google_compute_backend_service.home.self_link

host_rule {
hosts = ["mysite.com"]
Expand All @@ -491,7 +491,7 @@ resource "google_compute_url_map" "urlmap" {

path_matcher {
name = "allpaths"
default_service = "${google_compute_backend_service.home.self_link}"
default_service = google_compute_backend_service.home.self_link

path_rule {
paths = ["/home"]
Expand All @@ -507,7 +507,7 @@ resource "google_compute_url_map" "urlmap" {
disabled = false
}
weighted_backend_services {
backend_service = "${google_compute_backend_service.home.self_link}"
backend_service = google_compute_backend_service.home.self_link
weight = 400
header_action {
request_headers_to_remove = ["RemoveMe"]
Expand All @@ -529,7 +529,7 @@ resource "google_compute_url_map" "urlmap" {
}

test {
service = "${google_compute_backend_service.home.self_link}"
service = google_compute_backend_service.home.self_link
host = "hi.com"
path = "/home"
}
Expand All @@ -541,7 +541,7 @@ resource "google_compute_backend_service" "home" {
protocol = "HTTP"
timeout_sec = 10

health_checks = ["${google_compute_health_check.default.self_link}"]
health_checks = [google_compute_health_check.default.self_link]
load_balancing_scheme = "INTERNAL_SELF_MANAGED"
}

Expand Down
Loading