Skip to content

Commit

Permalink
provider/google: Write the raw disk encryption key in the state file …
Browse files Browse the repository at this point in the history
…to avoid diffs on plan (#12068)
  • Loading branch information
danawillow authored and stack72 committed Feb 20, 2017
1 parent f23279f commit f5e5128
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions builtin/providers/google/resource_compute_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -794,13 +794,14 @@ func resourceComputeInstanceRead(d *schema.ResourceData, meta interface{}) error
disks := make([]map[string]interface{}, 0, 1)
for i, disk := range instance.Disks {
di := map[string]interface{}{
"disk": d.Get(fmt.Sprintf("disk.%d.disk", i)),
"image": d.Get(fmt.Sprintf("disk.%d.image", i)),
"type": d.Get(fmt.Sprintf("disk.%d.type", i)),
"scratch": d.Get(fmt.Sprintf("disk.%d.scratch", i)),
"auto_delete": d.Get(fmt.Sprintf("disk.%d.auto_delete", i)),
"size": d.Get(fmt.Sprintf("disk.%d.size", i)),
"device_name": d.Get(fmt.Sprintf("disk.%d.device_name", i)),
"disk": d.Get(fmt.Sprintf("disk.%d.disk", i)),
"image": d.Get(fmt.Sprintf("disk.%d.image", i)),
"type": d.Get(fmt.Sprintf("disk.%d.type", i)),
"scratch": d.Get(fmt.Sprintf("disk.%d.scratch", i)),
"auto_delete": d.Get(fmt.Sprintf("disk.%d.auto_delete", i)),
"size": d.Get(fmt.Sprintf("disk.%d.size", i)),
"device_name": d.Get(fmt.Sprintf("disk.%d.device_name", i)),
"disk_encryption_key_raw": d.Get(fmt.Sprintf("disk.%d.disk_encryption_key_raw", i)),
}
if disk.DiskEncryptionKey != nil && disk.DiskEncryptionKey.Sha256 != "" {
di["disk_encryption_key_sha256"] = disk.DiskEncryptionKey.Sha256
Expand Down

0 comments on commit f5e5128

Please sign in to comment.