provider/google: Mark next_hop_network as read only.

This commit is contained in:
Lars Wander 2016-03-10 13:57:26 -05:00
parent 01b3e215d7
commit f8784df82b
2 changed files with 3 additions and 16 deletions

View File

@ -60,8 +60,7 @@ func resourceComputeRoute() *schema.Resource {
"next_hop_network": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Computed: true,
},
"next_hop_vpn_tunnel": &schema.Schema{
@ -103,7 +102,7 @@ func resourceComputeRouteCreate(d *schema.ResourceData, meta interface{}) error
}
// Next hop data
var nextHopInstance, nextHopIp, nextHopNetwork, nextHopGateway,
var nextHopInstance, nextHopIp, nextHopGateway,
nextHopVpnTunnel string
if v, ok := d.GetOk("next_hop_ip"); ok {
nextHopIp = v.(string)
@ -125,15 +124,6 @@ func resourceComputeRouteCreate(d *schema.ResourceData, meta interface{}) error
nextHopInstance = nextInstance.SelfLink
}
if v, ok := d.GetOk("next_hop_network"); ok {
nextNetwork, err := config.clientCompute.Networks.Get(
config.Project, v.(string)).Do()
if err != nil {
return fmt.Errorf("Error reading network: %s", err)
}
nextHopNetwork = nextNetwork.SelfLink
}
// Tags
var tags []string
@ -152,7 +142,6 @@ func resourceComputeRouteCreate(d *schema.ResourceData, meta interface{}) error
NextHopInstance: nextHopInstance,
NextHopVpnTunnel: nextHopVpnTunnel,
NextHopIp: nextHopIp,
NextHopNetwork: nextHopNetwork,
NextHopGateway: nextHopGateway,
Priority: int64(d.Get("priority").(int)),
Tags: tags,
@ -192,6 +181,7 @@ func resourceComputeRouteRead(d *schema.ResourceData, meta interface{}) error {
return fmt.Errorf("Error reading route: %#v", err)
}
d.Set("next_hop_network", route.NextHopNetwork)
d.Set("self_link", route.SelfLink)
return nil

View File

@ -51,9 +51,6 @@ The following arguments are supported:
* `next_hop_gateway` - (Optional) The name of the internet gateway to route
to if this route is matched.
* `next_hop_network` - (Optional) The name of the network to route to if this
route is matched.
* `next_hop_vpn_gateway` - (Optional) The name of the VPN to route to if this
route is matched.