google::compute-disk

Creates a zonal disk.

Example

google::compute-disk disk-example
    name: "disk-example"
    description: "disk-example-desc"
    zone: "us-central1-a"
    size-gb: 32
    type: "pd-standard"
    labels: {
        label-key: 'label-value'
    }
    physical-block-size-bytes: 4096
    resource-policy: $(google::compute-resource-policy example-policy-disk-alpha)
end
google::compute-disk disk-image-example
    name: "disk-image-example"
    description: "disk-image-example-desc"
    zone: "us-west1-a"
    source-image: $(google::compute-image image-example)

    source-image-encryption-key
        raw-key: "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0="
    end
end

Attributes

Attribute Description
name The name of the disk. Must be 1-63 characters long, and the first character must be a lowercase letter. All other characters must be a lowercase letter, digit, or -, except the last character, which cannot be a -. (Required)
description The description of the disk.
size-gb The size of the persistent disk, specified in GB. Values must be in the range 1 to 65536, inclusive. The size can only be increased once it has been set. If you specify this field along with sourceSnapshot, the value must not be less than the size of the snapshot.
source-snapshot The source snapshot used to create the disk. Conflicts with source-image.
disk-encryption-key subresource

The encryption key used to encrypt the disk. Only use this if you have not specified a source snapshot. If you do not provide an encryption key when creating the disk, the disk will be encrypted using an automatically generated key.

raw-key
The 256-bit encryption key, encoded in RFC 4648 base64, that protects this resource. See Encrypt disks with customer-supplied encryption keys. (Required)
source-snapshot-encryption-key subresource

The encryption key of the source snapshot. This is required if the source snapshot is protected by a customer-supplied encryption key.

raw-key
The 256-bit encryption key, encoded in RFC 4648 base64, that protects this resource. See Encrypt disks with customer-supplied encryption keys. (Required)
labels map Optional labels (key-value pairs) that can be applied to the disk. The only characters allowed are lowercase characters, international characters, numbers, -, and _. Key and value must be under 64 characters.
physical-block-size-bytes The physical block size of the disk, in bytes. Valid values are 4096 or 16384. Defaults to 4096.
resource-policy list Adds an existing resource policy to a disk which will be applied to this disk for scheduling snapshot creation.
zone The zone where the disk resides. (Required)
type The disk type used to create the disk.
source-image The source image used to create this disk. Conflicts with source-snapshot.
source-image-encryption-key subresource

The encryption key of the source image. This is required if the source image is protected by a customer-supplied encryption key.

raw-key
The 256-bit encryption key, encoded in RFC 4648 base64, that protects this resource. See Encrypt disks with customer-supplied encryption keys. (Required)

Outputs

Attribute Description
status The status of disk creation. Values can be: CREATING, RESTORING, FAILED, READY, or DELETING.
source-snapshot-id The unique ID of the snapshot used to create the disk.
self-link The fully-qualified URL linking back to the disk.
users list Links to the attached instances of the disk.
label-fingerprint The fingerprint for the labels being applied to the disk, which is updated any time the labels change.