Properly handle diff in google_compute_route next_hop_instance field (#716)

This commit is contained in:
Vincent Roseberry 2017-11-10 10:57:53 -08:00 committed by GitHub
parent 88a21c2304
commit 5aa9f574ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,9 +51,10 @@ func resourceComputeRoute() *schema.Resource {
},
"next_hop_instance": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Type: schema.TypeString,
Optional: true,
ForceNew: true,
DiffSuppressFunc: compareSelfLinkOrResourceName,
},
"next_hop_instance_zone": &schema.Schema{
@ -210,7 +211,7 @@ func resourceComputeRouteRead(d *schema.ResourceData, meta interface{}) error {
d.Set("network", route.Network)
d.Set("priority", route.Priority)
d.Set("next_hop_gateway", route.NextHopGateway)
d.Set("next_hop_instance", nextHopInstanceFieldValue.Name)
d.Set("next_hop_instance", nextHopInstanceFieldValue.RelativeLink())
d.Set("next_hop_instance_zone", nextHopInstanceFieldValue.Zone)
d.Set("next_hop_ip", route.NextHopIp)
d.Set("next_hop_vpn_tunnel", route.NextHopVpnTunnel)