Ресурс google_compute_disks
Синтаксис
Используется google_compute_disks для проверки ресурса Google Disk.
Ресурс Beta
Этот ресурс имеет доступные поля beta. Чтобы получить доступ к этим полям, включите beta: true в конструктор ресурса.
Примеры
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
Свойства
Свойства, к которым можно получить доступ из ресурса google_compute_disks:
Для получения дополнительной информации см. ресурс google_compute_disk.
label_fingerprints- массив
google_compute_disklabel_fingerprint creation_timestamps- массив
google_compute_diskcreation_timestamp descriptions- массив
google_compute_diskdescription ids- массив
google_compute_diskid last_attach_timestamps- массив
google_compute_disklast_attach_timestamp last_detach_timestamps- массив
google_compute_disklast_detach_timestamp labels- массив
google_compute_disklabels licenses- массив
google_compute_disklicenses names- массив
google_compute_diskname size_gbs- массив
google_compute_disksize_gb users- массив
google_compute_diskusers physical_block_size_bytes- массив
google_compute_diskphysical_block_size_bytes types- массив
google_compute_disktype source_images- массив
google_compute_disksource_image resource_policies- (Только Beta) массив
google_compute_diskresource_policies zones- массив
google_compute_diskzone source_image_encryption_keys- массив
google_compute_disksource_image_encryption_key source_image_ids- массив
google_compute_disksource_image_id disk_encryption_keys- массив
google_compute_diskdisk_encryption_key source_snapshots- массив
google_compute_disksource_snapshot source_snapshot_encryption_keys- массив
google_compute_disksource_snapshot_encryption_key source_snapshot_ids- массив
google_compute_disksource_snapshot_id
Критерии фильтрации
Этот ресурс поддерживает все вышеперечисленные свойства в качестве критериев фильтрации, которые могут быть использованы с where как блоком, так и методом.
Разрешения GCP
Убедитесь, что для текущего проекта включен API Compute Engine по адресу Compute Engine API.
© 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/