From 60ea73f2becc61a516308553de7183002b2e2072 Mon Sep 17 00:00:00 2001 From: Chris Stephens Date: Wed, 16 Jan 2019 03:22:50 +0000 Subject: [PATCH] Make Disk KMS features GA Signed-off-by: Modular Magician --- docs/resources/google_compute_disk.md | 6 ++++++ .../google/compute/property/disk_disk_encryption_key.rb | 3 +++ .../compute/property/disk_source_image_encryption_key.rb | 3 +++ .../compute/property/disk_source_snapshot_encryption_key.rb | 3 +++ 4 files changed, 15 insertions(+) diff --git a/docs/resources/google_compute_disk.md b/docs/resources/google_compute_disk.md index 7092047a7..f1a0a8f7e 100644 --- a/docs/resources/google_compute_disk.md +++ b/docs/resources/google_compute_disk.md @@ -69,6 +69,8 @@ Properties that can be accessed from the `google_compute_disk` resource: * `sha256`: The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. + * `kmsKeyName`: The name of the encryption key that is stored in Google Cloud KMS. + * `source_image_id`: The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used. * `disk_encryption_key`: Encrypts the disk using a customer-supplied encryption key. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an image, or to attach the disk to a virtual machine). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. @@ -77,12 +79,16 @@ Properties that can be accessed from the `google_compute_disk` resource: * `sha256`: The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. + * `kmsKeyName`: The name of the encryption key that is stored in Google Cloud KMS. + * `source_snapshot`: The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: * `https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot` * `projects/project/global/snapshots/snapshot` * `global/snapshots/snapshot` * `source_snapshot_encryption_key`: The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. * `rawKey`: Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. + * `kmsKeyName`: The name of the encryption key that is stored in Google Cloud KMS. + * `sha256`: The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. * `source_snapshot_id`: The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used. diff --git a/libraries/google/compute/property/disk_disk_encryption_key.rb b/libraries/google/compute/property/disk_disk_encryption_key.rb index f18445276..1ecbecdbd 100644 --- a/libraries/google/compute/property/disk_disk_encryption_key.rb +++ b/libraries/google/compute/property/disk_disk_encryption_key.rb @@ -21,10 +21,13 @@ class DiskDiskencryptionkey attr_reader :sha256 + attr_reader :kms_key_name + def initialize(args = nil) return if args.nil? @raw_key = args['rawKey'] @sha256 = args['sha256'] + @kms_key_name = args['kmsKeyName'] end end end diff --git a/libraries/google/compute/property/disk_source_image_encryption_key.rb b/libraries/google/compute/property/disk_source_image_encryption_key.rb index febe97235..94a627cc3 100644 --- a/libraries/google/compute/property/disk_source_image_encryption_key.rb +++ b/libraries/google/compute/property/disk_source_image_encryption_key.rb @@ -21,10 +21,13 @@ class DiskSourceimageencryptionkey attr_reader :sha256 + attr_reader :kms_key_name + def initialize(args = nil) return if args.nil? @raw_key = args['rawKey'] @sha256 = args['sha256'] + @kms_key_name = args['kmsKeyName'] end end end diff --git a/libraries/google/compute/property/disk_source_snapshot_encryption_key.rb b/libraries/google/compute/property/disk_source_snapshot_encryption_key.rb index a37e92c29..1c447719b 100644 --- a/libraries/google/compute/property/disk_source_snapshot_encryption_key.rb +++ b/libraries/google/compute/property/disk_source_snapshot_encryption_key.rb @@ -19,11 +19,14 @@ module Property class DiskSourcesnapshotencryptionkey attr_reader :raw_key + attr_reader :kms_key_name + attr_reader :sha256 def initialize(args = nil) return if args.nil? @raw_key = args['rawKey'] + @kms_key_name = args['kmsKeyName'] @sha256 = args['sha256'] end end