deprecate address as originally intended

This commit is contained in:
Chris Stephens 2018-10-26 21:52:26 +00:00 committed by Nathan McKinley
parent d0215dfbeb
commit ae09a200c7
5 changed files with 8 additions and 22 deletions

View File

@ -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

View File

@ -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{

View File

@ -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.",
},
},
},

View File

@ -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.

View File

@ -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.