A google_compute_disks is used to test a Google Disk resource
This resource has beta fields available. To retrieve these fields, include beta: true in the constructor for the resource
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 that can be accessed from the google_compute_disks resource:
See the google_compute_disk resource for more information.
label_fingerprintsgoogle_compute_disk label_fingerprintcreation_timestampsgoogle_compute_disk creation_timestampdescriptionsgoogle_compute_disk descriptionidsgoogle_compute_disk idlast_attach_timestampsgoogle_compute_disk last_attach_timestamplast_detach_timestampsgoogle_compute_disk last_detach_timestamplabelsgoogle_compute_disk labelslicensesgoogle_compute_disk licensesnamesgoogle_compute_disk namesize_gbsgoogle_compute_disk size_gbusersgoogle_compute_disk usersphysical_block_size_bytesgoogle_compute_disk physical_block_size_bytestypesgoogle_compute_disk typesource_imagesgoogle_compute_disk source_imageresource_policiesgoogle_compute_disk resource_policieszonesgoogle_compute_disk zonesource_image_encryption_keysgoogle_compute_disk source_image_encryption_keysource_image_idsgoogle_compute_disk source_image_iddisk_encryption_keysgoogle_compute_disk disk_encryption_keysource_snapshotsgoogle_compute_disk source_snapshotsource_snapshot_encryption_keysgoogle_compute_disk source_snapshot_encryption_keysource_snapshot_idsgoogle_compute_disk source_snapshot_idThis resource supports all of the above properties as filter criteria, which can be used with where as a block or a method.
Ensure the Compute Engine API is enabled for the current project.
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/google_compute_disks/