mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-03 08:42:39 +00:00
Fix next_instance_zone for google_compute_route (#2856)
<!-- This change is generated by MagicModules. --> /cc @rileykarson
This commit is contained in:
parent
5845ae4d38
commit
e97fb95b36
|
@ -454,11 +454,18 @@ func expandComputeRouteNextHopGateway(v interface{}, d *schema.ResourceData, con
|
|||
}
|
||||
|
||||
func expandComputeRouteNextHopInstance(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
|
||||
f, err := parseZonalFieldValue("instances", v.(string), "project", "zone", d, config, true)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Invalid value for next_hop_instance: %s", err)
|
||||
if v == "" {
|
||||
return v, nil
|
||||
}
|
||||
return f.RelativeLink(), nil
|
||||
val, err := parseZonalFieldValue("instances", v.(string), "project", "next_hop_instance_zone", d, config, true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
nextInstance, err := config.clientCompute.Instances.Get(val.Project, val.Zone, val.Name).Do()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nextInstance.SelfLink, nil
|
||||
}
|
||||
|
||||
func expandComputeRouteNextHopIp(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user