From 6a4af1c823fa6c0911043f48bfdcccb9accb4532 Mon Sep 17 00:00:00 2001 From: Ty Larrabee Date: Mon, 9 Dec 2019 22:07:54 +0000 Subject: [PATCH] Add path_rules to RegionUrlMap Signed-off-by: Modular Magician --- google/resource_compute_url_map.go | 22 +++++----- ...resource_compute_url_map_generated_test.go | 38 ++++++++--------- website/docs/r/compute_url_map.html.markdown | 42 +++++++++---------- 3 files changed, 51 insertions(+), 51 deletions(-) diff --git a/google/resource_compute_url_map.go b/google/resource_compute_url_map.go index 97409b37d1d..90e7e6cc0e0 100644 --- a/google/resource_compute_url_map.go +++ b/google/resource_compute_url_map.go @@ -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 @@ -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, @@ -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`, - }, }, }, }, diff --git a/google/resource_compute_url_map_generated_test.go b/google/resource_compute_url_map_generated_test.go index f3074865a4e..abf3be2900d 100644 --- a/google/resource_compute_url_map_generated_test.go +++ b/google/resource_compute_url_map_generated_test.go @@ -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"] @@ -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 @@ -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" } @@ -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" } @@ -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"] @@ -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 @@ -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" } @@ -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" } @@ -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"] @@ -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"] @@ -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 @@ -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"] @@ -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" } @@ -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" } @@ -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"] @@ -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"] @@ -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"] @@ -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" } @@ -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" } diff --git a/website/docs/r/compute_url_map.html.markdown b/website/docs/r/compute_url_map.html.markdown index 04cf7ce1c29..090d574d021 100644 --- a/website/docs/r/compute_url_map.html.markdown +++ b/website/docs/r/compute_url_map.html.markdown @@ -126,7 +126,7 @@ resource "google_storage_bucket" "static" { resource "google_compute_url_map" "urlmap" { name = "urlmap" 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"] @@ -135,7 +135,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 @@ -184,7 +184,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" } @@ -196,7 +196,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" } @@ -219,7 +219,7 @@ resource "google_compute_health_check" "default" { resource "google_compute_url_map" "urlmap" { name = "urlmap" 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"] @@ -228,7 +228,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 @@ -248,7 +248,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" } @@ -260,7 +260,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" } @@ -283,7 +283,7 @@ resource "google_compute_health_check" "default" { resource "google_compute_url_map" "urlmap" { name = "urlmap" 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"] @@ -292,7 +292,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"] @@ -321,7 +321,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 @@ -339,7 +339,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"] @@ -361,7 +361,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" } @@ -373,7 +373,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" } @@ -396,7 +396,7 @@ resource "google_compute_health_check" "default" { resource "google_compute_url_map" "urlmap" { name = "urlmap" 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"] @@ -405,7 +405,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"] @@ -421,7 +421,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"] @@ -443,7 +443,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" } @@ -455,7 +455,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" } @@ -875,7 +875,7 @@ The `retry_policy` block supports: * `retry_conditions` - (Optional) - Specfies one or more conditions when this retry rule applies. Valid values are: + 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 @@ -953,7 +953,7 @@ The `weighted_backend_services` block supports: headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. Structure is documented below. * `weight` - - (Optional) + (Required) 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