turbot/gcp

steampipe plugin install gcpsteampipe plugin install gcp
On This Page
Get Involved

Table: gcp_compute_disk

Compute Engine manages the physical disks and the data distribution to ensure redundancy and optimal performance. Persistent disks are located independently from virtual machine (VM) instances, so it can detach or move persistent disks to keep data even after deletion of instances.

Examples

Basic info

select
name,
id,
size_gb as disk_size_in_gb,
type_name,
zone_name,
region_name,
location_type
from
gcp_compute_disk;

List disks encrypted with Google-managed key

select
name,
id,
zone_name,
disk_encryption_key_type
from
gcp_compute_disk
where
disk_encryption_key_type = 'Google managed';

List disks that are not in use

select
name,
id,
users
from
gcp_compute_disk
where
users is null;

List regional disks

select
name,
region_name
from
gcp_compute_disk
where
location_type = 'REGIONAL';

Count the number of disks per availability zone

select
zone_name,
count(*)
from
gcp_compute_disk
group by
zone_name
order by
count desc;

List disks ordered by size

select
name,
size_gb
from
gcp_compute_disk
order by
size_gb desc;

.inspect gcp_compute_disk

GCP Compute Disk

NameTypeDescription
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
creation_timestamptimestamp without time zoneTimestamp when the disk was created.
descriptiontextAn optional description of this resource. Provide this property when you create the resource.
disk_encryption_keyjsonbSpecifies the encryption configuration used to encrypt stored data.
disk_encryption_key_typetextThe type of encryption key used to encrypt storage data. Valid values are Google managed | Customer managed | Customer supplied.
guest_os_featuresjsonbA list of features to enable on the guest operating system. Applicable only for bootable images.
iam_policyjsonbAn Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`.
idbigintThe unique identifier for the resource. This identifier is defined by the server.
kindtextType of the resource. Always compute#disk for disks.
labelsjsonbA map of labels assigned to bucket
last_attach_timestamptimestamp without time zoneTimestamp when the disk was last attached.
last_detach_timestamptimestamp without time zoneTimestamp when the disk was last detached.
license_codesjsonbInteger license codes indicating which licenses are attached to this disk.
licensesjsonbA list of publicly visible licenses.
locationtextThe GCP multi-region, region, or zone in which the resource is located.
location_typetextLocation type where the disk resides.
nametextName of the resource.
physical_block_size_bytesbigintPhysical block size of the persistent disk, in bytes. If not present in a request, a default value is used.
projecttextThe GCP Project in which the resource is located.
regiontextURL of the region where the disk resides. Only applicable for regional resources.
region_nametextName of the region where the disk resides. Only applicable for regional resources.
replica_zonesjsonbURLs of the zones where the disk should be replicated to. Only applicable for regional resources.
resource_policiesjsonbResource policies applied to this disk for automatic snapshot creations.
self_linktextServer-defined fully-qualified URL for this resource.
size_gbdouble precisionSize, in GB, of the persistent disk.
source_disktextThe source disk used to create this disk. You can provide this as a partial or full URL to the resource.
source_disk_idtextThe unique ID of the disk used to create this disk. This value identifies the exact disk that was used to create this persistent disk.
source_imagetextThe source image used to create this disk. If the source image is deleted, this field will not be set.
source_image_encryption_keytextThe customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key.
source_image_idtextThe ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk.
source_snapshottextThe source snapshot used to create this disk.
source_snapshot_encryption_keytextThe customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key.
source_snapshot_idtextThe unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk.
statustextThe status of disk creation. CREATING: Disk is provisioning. RESTORING: Source data is being copied into the disk. FAILED: Disk creation failed. READY: Disk is ready for use. DELETING: Disk is deleting.
tagsjsonbA map of tags for the resource.
titletextTitle of the resource.
typetextURL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk. For example: projects/project/zones/zone/diskTypes/pd-standard or pd-ssd
type_nametextType of the disk. For example: pd-standard or pd-ssd
usersjsonbLinks to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance
zonetextURL of the zone where the disk resides.
zone_nametextThe zone name in which the disk resides.