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 b62f978f1b
commit 64b67436ab
1 changed files with 5 additions and 0 deletions

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 {