From f47d1353d84aab80f04e81668300fb3e2bcc4e49 Mon Sep 17 00:00:00 2001 From: The Magician Date: Mon, 22 Apr 2019 11:11:24 -0700 Subject: [PATCH] Allow BackendService backends.group to ref multiple resource types (#3463) Signed-off-by: Modular Magician --- google/resource_compute_backend_service.go | 6 +---- .../r/compute_backend_service.html.markdown | 24 +++++++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/google/resource_compute_backend_service.go b/google/resource_compute_backend_service.go index 515ea6de..0412764b 100644 --- a/google/resource_compute_backend_service.go +++ b/google/resource_compute_backend_service.go @@ -1219,11 +1219,7 @@ func expandComputeBackendServiceBackendDescription(v interface{}, d TerraformRes } func expandComputeBackendServiceBackendGroup(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { - f, err := parseZonalFieldValue("instanceGroups", v.(string), "project", "zone", d, config, true) - if err != nil { - return nil, fmt.Errorf("Invalid value for group: %s", err) - } - return f.RelativeLink(), nil + return v, nil } func expandComputeBackendServiceBackendMaxConnections(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { diff --git a/website/docs/r/compute_backend_service.html.markdown b/website/docs/r/compute_backend_service.html.markdown index 32b8426d..0ea43993 100644 --- a/website/docs/r/compute_backend_service.html.markdown +++ b/website/docs/r/compute_backend_service.html.markdown @@ -179,14 +179,24 @@ The `backend` block supports: * `group` - (Optional) - This instance group defines the list of instances that serve - traffic. Member virtual machine instances from each instance - group must live in the same zone as the instance group itself. - No two backends in a backend service are allowed to use same - Instance Group resource. + The fully-qualified URL of an Instance Group or Network Endpoint + Group resource. In case of instance group this defines the list + of instances that serve traffic. Member virtual machine + instances from each instance group must live in the same zone as + the instance group itself. No two backends in a backend service + are allowed to use same Instance Group resource. + For Network Endpoint Groups this defines list of endpoints. All + endpoints of Network Endpoint Group must be hosted on instances + located in the same zone as the Network Endpoint Group. + Backend service can not contain mix of Instance Group and + Network Endpoint Group backends. + Note that you must specify an Instance Group or Network Endpoint + Group resource using the fully-qualified URL, rather than a + partial URL. When the BackendService has load balancing scheme INTERNAL, the - instance group must be in a zone within the same region as the - BackendService. + instance group must be within the same region as the + BackendService. Network Endpoint Groups are not supported for + INTERNAL load balancing scheme. * `max_connections` - (Optional)