Skip to content

Commit

Permalink
Merge pull request #48 from modular-magician/codegen-pr-627
Browse files Browse the repository at this point in the history
deprecate address as originally intended
  • Loading branch information
chrisst authored Oct 29, 2018
2 parents ce33b2c + 5d75203 commit 181c7ed
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 22 deletions.
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

0 comments on commit 181c7ed

Please sign in to comment.