Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate address as originally intended #48

Merged
merged 1 commit into from
Oct 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions google-beta/compute_instance_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 3 additions & 6 deletions google-beta/resource_compute_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
10 changes: 3 additions & 7 deletions google-beta/resource_compute_instance_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
},
},
},
Expand Down
3 changes: 0 additions & 3 deletions website/docs/d/datasource_compute_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 0 additions & 3 deletions website/docs/r/compute_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down