Provided sourcedisk_encryption_key_raw when creating a snapshot of a customer's self encrypted disk

This commit is contained in:
Thomas Poindessous 2017-03-13 12:25:11 +01:00
parent 446a2cd6e9
commit e14e4c7b9c

View File

@ -102,6 +102,11 @@ func resourceComputeSnapshotCreate(d *schema.ResourceData, meta interface{}) err
snapshot.SnapshotEncryptionKey.RawKey = v.(string)
}
if v, ok := d.GetOk("sourcedisk_encryption_key_raw"); ok {
snapshot.SourceDiskEncryptionKey = &compute.CustomerEncryptionKey{}
snapshot.SourceDiskEncryptionKey.RawKey = v.(string)
}
op, err := config.clientCompute.Disks.CreateSnapshot(
project, d.Get("zone").(string), disk, snapshot).Do()
if err != nil {