Syntax
A google_compute_snapshots
is used to test a Google Snapshot resource
Beta Resource
This resource has beta fields available. To retrieve these fields, include beta: true
in the constructor for the resource
Examples
describe google_compute_snapshots(project: 'chef-gcp-inspec') do
its('count') { should be >= 1 }
end
describe.one do
google_compute_snapshots(project: 'chef-gcp-inspec').names do |snapshot_name|
describe google_compute_snapshot(project: 'chef-gcp-inspec', name: snapshot_name) do
its('source_disk') { should match 'inspec-snapshot-disk' }
end
end
end
Properties
Properties that can be accessed from the google_compute_snapshots
resource:
See googlecomputesnapshot.md for more detailed information
* creation_timestamps
: an array of google_compute_snapshot
creationtimestamp
* ids
: an array of `googlecomputesnapshotid
*
disksizegbs: an array of
googlecomputesnapshot` disksizegb
* names
: an array of `googlecomputesnapshotname
*
descriptions: an array of
googlecomputesnapshotdescription
*
storagebytes: an array of
googlecomputesnapshotstorage_bytes
*
licenses: an array of
googlecomputesnapshotlicenses
*
labels: an array of
googlecomputesnapshotlabels
*
labelfingerprints: an array of
googlecomputesnapshot` labelfingerprint
* source_disks
: an array of google_compute_snapshot
sourcedisk
* zones
: an array of `googlecomputesnapshotzone
*
snapshotencryptionkeys: an array of
googlecomputesnapshot` snapshotencryptionkey
* `sourcediskencryptionkeys: an array of
googlecomputesnapshot` sourcediskencryption_key
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.