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 ofgooglecomputesnapshot` disksizegb * names: an array of `googlecomputesnapshotname *descriptions: an array ofgooglecomputesnapshotdescription *storagebytes: an array ofgooglecomputesnapshotstorage_bytes *licenses: an array ofgooglecomputesnapshotlicenses *labels: an array ofgooglecomputesnapshotlabels *labelfingerprints: an array ofgooglecomputesnapshot` labelfingerprint * source_disks: an array of google_compute_snapshot sourcedisk * zones: an array of `googlecomputesnapshotzone *snapshotencryptionkeys: an array ofgooglecomputesnapshot` snapshotencryptionkey * `sourcediskencryptionkeys: an array ofgooglecomputesnapshot` 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.