diff --git a/google/compute_region_backend_service.go b/google/compute_region_backend_service.go index f2e329b44..96c51c40a 100644 --- a/google/compute_region_backend_service.go +++ b/google/compute_region_backend_service.go @@ -192,6 +192,12 @@ func GetComputeRegionBackendServiceApiObject(d TerraformResourceData, config *Co } else if v, ok := d.GetOkExists("timeout_sec"); !isEmptyValue(reflect.ValueOf(timeoutSecProp)) && (ok || !reflect.DeepEqual(v, timeoutSecProp)) { obj["timeoutSec"] = timeoutSecProp } + networkProp, err := expandComputeRegionBackendServiceNetwork(d.Get("network"), d, config) + if err != nil { + return nil, err + } else if v, ok := d.GetOkExists("network"); !isEmptyValue(reflect.ValueOf(networkProp)) && (ok || !reflect.DeepEqual(v, networkProp)) { + obj["network"] = networkProp + } regionProp, err := expandComputeRegionBackendServiceRegion(d.Get("region"), d, config) if err != nil { return nil, err @@ -426,6 +432,14 @@ func expandComputeRegionBackendServiceTimeoutSec(v interface{}, d TerraformResou return v, nil } +func expandComputeRegionBackendServiceNetwork(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { + f, err := parseGlobalFieldValue("networks", v.(string), "project", d, config, true) + if err != nil { + return nil, fmt.Errorf("Invalid value for network: %s", err) + } + return f.RelativeLink(), nil +} + func expandComputeRegionBackendServiceRegion(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { f, err := parseGlobalFieldValue("regions", v.(string), "project", d, config, true) if err != nil {