Skip to content

Commit 5aa9f57

Browse files
authored
Properly handle diff in google_compute_route next_hop_instance field (#716)
1 parent 88a21c2 commit 5aa9f57

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

google/resource_compute_route.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ func resourceComputeRoute() *schema.Resource {
5151
},
5252

5353
"next_hop_instance": &schema.Schema{
54-
Type: schema.TypeString,
55-
Optional: true,
56-
ForceNew: true,
54+
Type: schema.TypeString,
55+
Optional: true,
56+
ForceNew: true,
57+
DiffSuppressFunc: compareSelfLinkOrResourceName,
5758
},
5859

5960
"next_hop_instance_zone": &schema.Schema{
@@ -210,7 +211,7 @@ func resourceComputeRouteRead(d *schema.ResourceData, meta interface{}) error {
210211
d.Set("network", route.Network)
211212
d.Set("priority", route.Priority)
212213
d.Set("next_hop_gateway", route.NextHopGateway)
213-
d.Set("next_hop_instance", nextHopInstanceFieldValue.Name)
214+
d.Set("next_hop_instance", nextHopInstanceFieldValue.RelativeLink())
214215
d.Set("next_hop_instance_zone", nextHopInstanceFieldValue.Zone)
215216
d.Set("next_hop_ip", route.NextHopIp)
216217
d.Set("next_hop_vpn_tunnel", route.NextHopVpnTunnel)

0 commit comments

Comments
 (0)