diff --git a/google/resource_compute_instance.go b/google/resource_compute_instance.go index 9985e70e419..0719c777a7a 100644 --- a/google/resource_compute_instance.go +++ b/google/resource_compute_instance.go @@ -418,43 +418,6 @@ func resourceComputeInstance() *schema.Resource { Optional: true, }, - "network": &schema.Schema{ - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Removed: "Please use network_interface", - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "source": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "address": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "name": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "internal_address": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - - "external_address": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, - }, - }, - }, - "project": &schema.Schema{ Type: schema.TypeString, Optional: true, diff --git a/google/resource_compute_network.go b/google/resource_compute_network.go index c30054e9901..db1efeba9c8 100644 --- a/google/resource_compute_network.go +++ b/google/resource_compute_network.go @@ -54,7 +54,7 @@ func resourceComputeNetwork() *schema.Resource { Optional: true, ForceNew: true, // This needs to remain deprecated until the API is retired - Deprecated: "Please use google_compute_subnetwork resources instead.", + Removed: "Please use google_compute_subnetwork resources instead.", }, "project": &schema.Schema{ @@ -89,9 +89,6 @@ func resourceComputeNetworkCreate(d *schema.ResourceData, meta interface{}) erro // - 2.b - Custom subnet mode - auto_create_subnetworks = false & ipv4_range not set, // autoCreateSubnetworks := d.Get("auto_create_subnetworks").(bool) - if autoCreateSubnetworks && d.Get("ipv4_range").(string) != "" { - return fmt.Errorf("ipv4_range can't be set if auto_create_subnetworks is true.") - } // Build the network parameter network := &compute.Network{ @@ -107,14 +104,10 @@ func resourceComputeNetworkCreate(d *schema.ResourceData, meta interface{}) erro network.RoutingConfig = routingConfig } - if v, ok := d.GetOk("ipv4_range"); ok { - log.Printf("[DEBUG] Setting IPv4Range (%#v) for legacy network mode", v.(string)) - network.IPv4Range = v.(string) - } else { - // custom subnet mode, so make sure AutoCreateSubnetworks field is included in request otherwise - // google will create a network in legacy mode. - network.ForceSendFields = []string{"AutoCreateSubnetworks"} - } + // make sure AutoCreateSubnetworks field is included in request otherwise + // google will create a network in legacy mode. + network.ForceSendFields = []string{"AutoCreateSubnetworks"} + log.Printf("[DEBUG] Network insert request: %#v", network) op, err := config.clientCompute.Networks.Insert( project, network).Do() @@ -151,7 +144,6 @@ func resourceComputeNetworkRead(d *schema.ResourceData, meta interface{}) error d.Set("routing_mode", routingConfig.RoutingMode) d.Set("gateway_ipv4", network.GatewayIPv4) - d.Set("ipv4_range", network.IPv4Range) d.Set("self_link", network.SelfLink) d.Set("name", network.Name) d.Set("description", network.Description) diff --git a/website/docs/r/compute_network.html.markdown b/website/docs/r/compute_network.html.markdown index a77769c85c7..ce049a3cadb 100644 --- a/website/docs/r/compute_network.html.markdown +++ b/website/docs/r/compute_network.html.markdown @@ -36,10 +36,6 @@ The following arguments are supported: automatically. If set to false, a custom subnetted network will be created that can support `google_compute_subnetwork` resources. Defaults to true. -* `ipv4_range` - (Optional) If set to a CIDR block, uses the legacy VPC API with the - specified range. This API is deprecated. If set, `auto_create_subnetworks` must be - explicitly set to false. - * `routing_mode` - (Optional) Sets the network-wide routing mode for Cloud Routers to use. Accepted values are `"GLOBAL"` or `"REGIONAL"`. Defaults to `"REGIONAL"`. Refer to the [Cloud Router documentation](https://cloud.google.com/router/docs/concepts/overview#dynamic-routing-mode)