Skip to content

googleComputeDisk

Get information about a Google Compute Persistent disks.

the official documentation and its API.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const dataGoogleComputeDiskPersistentBootDisk =
  new google.dataGoogleComputeDisk.DataGoogleComputeDisk(
    this,
    "persistent-boot-disk",
    {
      name: "persistent-boot-disk",
      project: "example",
    }
  );
new google.computeInstance.ComputeInstance(this, "default", {
  boot_disk: [
    {
      auto_delete: false,
      source: dataGoogleComputeDiskPersistentBootDisk.selfLink,
    },
  ],
});

Argument Reference

The following arguments are supported:

  • name - (Required) The name of a specific disk.

  • zone - (Optional) A reference to the zone where the disk resides.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format projects/{{project}}/zones/{{zone}}/disks/{{name}}

  • labelFingerprint - The fingerprint used for optimistic locking of this resource. Used internally during updates.

  • creationTimestamp - Creation timestamp in RFC3339 text format.

  • lastAttachTimestamp - Last attach timestamp in RFC3339 text format.

  • lastDetachTimestamp - Last detach timestamp in RFC3339 text format.

  • users - Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance

  • sourceImageId - 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.

  • sourceSnapshotId - 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.

  • description - The optional description of this resource.

  • labels - A map of labels applied to this disk.

  • size - Size of the persistent disk, specified in GB.

  • physicalBlockSizeBytes - Physical block size of the persistent disk, in bytes.

  • type - URL of the disk type resource describing which disk type to use to create the disk.

  • image - The image from which to initialize this disk.

  • zone - A reference to the zone where the disk resides.

  • sourceImageEncryptionKey - The customer-supplied encryption key of the source image.

  • snapshot - The source snapshot used to create this disk.

  • sourceSnapshotEncryptionKey - (Optional) The customer-supplied encryption key of the source snapshot.

  • selfLink - The URI of the created resource.