google_compute_disks resource
Syntax
A google_compute_disks is used to test a Google Disk resource
Beta Resource
This resource has beta fields available. To retrieve these fields, include beta: true in the constructor for the resource.
Examples
most_recent_image = google_compute_image(project: 'debian-cloud', name: 'debian-10-buster-v20191014')
describe google_compute_disks(project: 'chef-gcp-inspec', zone: 'zone') do
it { should exist }
its('names') { should include 'inspec-snapshot-disk' }
its('source_images') { should include most_recent_image.self_link }
end
Properties
Properties that can be accessed from the google_compute_disks resource:
See google_compute_disk for more detailed information.
label_fingerprints: an array ofgoogle_compute_disklabel_fingerprintcreation_timestamps: an array ofgoogle_compute_diskcreation_timestampdescriptions: an array ofgoogle_compute_diskdescriptionids: an array ofgoogle_compute_diskidlast_attach_timestamps: an array ofgoogle_compute_disklast_attach_timestamplast_detach_timestamps: an array ofgoogle_compute_disklast_detach_timestamplabels: an array ofgoogle_compute_disklabelslicenses: an array ofgoogle_compute_disklicensesnames: an array ofgoogle_compute_disknamesize_gbs: an array ofgoogle_compute_disksize_gbusers: an array ofgoogle_compute_diskusersphysical_block_size_bytes: an array ofgoogle_compute_diskphysical_block_size_bytesinterfaces: (Beta only) an array ofgoogle_compute_diskinterfacetypes: an array ofgoogle_compute_disktypesource_images: an array ofgoogle_compute_disksource_imageresource_policies: (Beta only) an array ofgoogle_compute_diskresource_policiesmulti_writers: (Beta only) an array ofgoogle_compute_diskmulti_writerzones: an array ofgoogle_compute_diskzonesource_image_encryption_keys: an array ofgoogle_compute_disksource_image_encryption_keysource_image_ids: an array ofgoogle_compute_disksource_image_iddisk_encryption_keys: an array ofgoogle_compute_diskdisk_encryption_keysource_snapshots: an array ofgoogle_compute_disksource_snapshotsource_snapshot_encryption_keys: an array ofgoogle_compute_disksource_snapshot_encryption_keysource_snapshot_ids: an array ofgoogle_compute_disksource_snapshot_id
Filter criteria
This resource supports all of the above properties as filter criteria, which can be used
with where as a block or a method.
GCP permissions
Ensure the Compute Engine API is enabled for the current project.