Skip to content

Commit

Permalink
Properly handle diff in google_compute_route next_hop_instance field (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rosbo authored Nov 10, 2017
1 parent 88a21c2 commit 5aa9f57
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions google/resource_compute_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5aa9f57

Please sign in to comment.