From ae09a200c745f7c5c85fbbf46166edfff4e1b705 Mon Sep 17 00:00:00 2001 From: Chris Stephens Date: Fri, 26 Oct 2018 21:52:26 +0000 Subject: [PATCH] deprecate address as originally intended --- google/compute_instance_helpers.go | 5 ++--- google/resource_compute_instance.go | 9 +++------ google/resource_compute_instance_template.go | 10 +++------- .../docs/d/datasource_compute_instance.html.markdown | 3 --- website/docs/r/compute_instance.html.markdown | 3 --- 5 files changed, 8 insertions(+), 22 deletions(-) diff --git a/google/compute_instance_helpers.go b/google/compute_instance_helpers.go index 902fcb52..7ef6674d 100644 --- a/google/compute_instance_helpers.go +++ b/google/compute_instance_helpers.go @@ -48,9 +48,8 @@ func flattenAccessConfigs(accessConfigs []*computeBeta.AccessConfig) ([]map[stri natIP := "" for i, ac := range accessConfigs { flattened[i] = map[string]interface{}{ - "nat_ip": ac.NatIP, - "network_tier": ac.NetworkTier, - "assigned_nat_ip": ac.NatIP, + "nat_ip": ac.NatIP, + "network_tier": ac.NetworkTier, } if ac.SetPublicPtr { flattened[i]["public_ptr_domain_name"] = ac.PublicPtrDomainName diff --git a/google/resource_compute_instance.go b/google/resource_compute_instance.go index 0719c777..037515e7 100644 --- a/google/resource_compute_instance.go +++ b/google/resource_compute_instance.go @@ -200,13 +200,10 @@ func resourceComputeInstance() *schema.Resource { ValidateFunc: validation.StringInSlice([]string{"PREMIUM", "STANDARD"}, false), }, - // It's unclear why this field exists, as - // nat_ip can be both optional and computed. - // Consider deprecating it. "assigned_nat_ip": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Deprecated: "Use network_interface.access_config.nat_ip instead.", + Type: schema.TypeString, + Computed: true, + Removed: "Use network_interface.access_config.nat_ip instead.", }, "public_ptr_domain_name": &schema.Schema{ diff --git a/google/resource_compute_instance_template.go b/google/resource_compute_instance_template.go index b2687486..f6965818 100644 --- a/google/resource_compute_instance_template.go +++ b/google/resource_compute_instance_template.go @@ -263,14 +263,10 @@ func resourceComputeInstanceTemplate() *schema.Resource { Computed: true, ValidateFunc: validation.StringInSlice([]string{"PREMIUM", "STANDARD"}, false), }, - // Instance templates will never have an - // 'assigned NAT IP', but we need this in - // the schema to allow us to share flatten - // code with an instance, which could. "assigned_nat_ip": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Deprecated: "Use network_interface.access_config.nat_ip instead.", + Type: schema.TypeString, + Computed: true, + Removed: "Use network_interface.access_config.nat_ip instead.", }, }, }, diff --git a/website/docs/d/datasource_compute_instance.html.markdown b/website/docs/d/datasource_compute_instance.html.markdown index d3bca44d..719e05f8 100644 --- a/website/docs/d/datasource_compute_instance.html.markdown +++ b/website/docs/d/datasource_compute_instance.html.markdown @@ -92,9 +92,6 @@ This attribute has been deprecated. Use `network_interface.0.network_ip` instead * `network_interface.0.access_config.0.nat_ip` - If the instance has an access config, either the given external ip (in the `nat_ip` field) or the ephemeral (generated) ip (if you didn't provide one). -* `network_interface.0.access_config.0.assigned_nat_ip` - (Deprecated) If the instance has an access config, either the given external ip (in the `nat_ip` field) or the ephemeral (generated) ip (if you didn't provide one). -This attribute has been deprecated. Use `network_interface.0.access_config.0.nat_ip` instead. - * `attached_disk.0.disk_encryption_key_sha256` - The [RFC 4648 base64](https://tools.ietf.org/html/rfc4648#section-4) encoded SHA-256 hash of the [customer-supplied encryption key] (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects this resource. diff --git a/website/docs/r/compute_instance.html.markdown b/website/docs/r/compute_instance.html.markdown index 744b900c..ce68cdcc 100644 --- a/website/docs/r/compute_instance.html.markdown +++ b/website/docs/r/compute_instance.html.markdown @@ -295,9 +295,6 @@ This attribute has been deprecated. Use `network_interface.0.network_ip`instead. * `network_interface.0.access_config.0.nat_ip` - If the instance has an access config, either the given external ip (in the `nat_ip` field) or the ephemeral (generated) ip (if you didn't provide one). -* `network_interface.0.access_config.0.assigned_nat_ip` - (Deprecated) If the instance has an access config, either the given external ip (in the `nat_ip` field) or the ephemeral (generated) ip (if you didn't provide one). -This attribute has been deprecated. Use `network_interface.0.access_config.0.nat_ip` instead. - * `attached_disk.0.disk_encryption_key_sha256` - The [RFC 4648 base64](https://tools.ietf.org/html/rfc4648#section-4) encoded SHA-256 hash of the [customer-supplied encryption key] (https://cloud.google.com/compute/docs/disks/customer-supplied-encryption) that protects this resource.