Allow BackendService backends.group to ref multiple resource types (#3463)

Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
The Magician 2019-04-22 11:11:24 -07:00 committed by Riley Karson
parent 55bbc252a9
commit f47d1353d8
2 changed files with 18 additions and 12 deletions

View File

@ -1219,11 +1219,7 @@ func expandComputeBackendServiceBackendDescription(v interface{}, d TerraformRes
} }
func expandComputeBackendServiceBackendGroup(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { func expandComputeBackendServiceBackendGroup(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
f, err := parseZonalFieldValue("instanceGroups", v.(string), "project", "zone", d, config, true) return v, nil
if err != nil {
return nil, fmt.Errorf("Invalid value for group: %s", err)
}
return f.RelativeLink(), nil
} }
func expandComputeBackendServiceBackendMaxConnections(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { func expandComputeBackendServiceBackendMaxConnections(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {

View File

@ -179,14 +179,24 @@ The `backend` block supports:
* `group` - * `group` -
(Optional) (Optional)
This instance group defines the list of instances that serve The fully-qualified URL of an Instance Group or Network Endpoint
traffic. Member virtual machine instances from each instance Group resource. In case of instance group this defines the list
group must live in the same zone as the instance group itself. of instances that serve traffic. Member virtual machine
No two backends in a backend service are allowed to use same instances from each instance group must live in the same zone as
Instance Group resource. 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 When the BackendService has load balancing scheme INTERNAL, the
instance group must be in a zone within the same region as the instance group must be within the same region as the
BackendService. BackendService. Network Endpoint Groups are not supported for
INTERNAL load balancing scheme.
* `max_connections` - * `max_connections` -
(Optional) (Optional)