title | platform |
---|---|
About the google_compute_image Resource |
gcp |
Use the google_compute_image
InSpec audit resource to test properties of a single GCP compute image. This resource will attempt to retrieve a project custom image then image from a family before giving up.
A google_compute_image
resource block declares the tests for a single GCP compute image by project and name.
describe google_compute_image(project: 'chef-inspec-gcp', name: 'image-1') do
it { should exist }
its('name') { should eq 'image-1' }
end
The following examples show how to use this InSpec audit resource.
describe google_compute_image(project: 'chef-inspec-gcp', location: 'europe-west2', name: 'compute-address') do
its('status') { should eq "READY" }
end
describe google_compute_image(project: 'chef-inspec-gcp', name: 'ubuntu') do
its('family') { should match "ubuntu" }
end
archive_size_bytes
,creation_timestamp
,description
,disk_size_gb
,family
,guest_os_features
,id
,kind
,label_fingerprint
,licenses
,name
,raw_disk
,source_type
,status
Ensure the Compute Engine API is enabled for the project where the resource is located.