title | platform |
---|---|
About the google_compute_zone Resource |
gcp |
Use the google_compute_zone
InSpec audit resource to test properties of a single GCP compute zone.
A google_compute_zone
resource block declares the tests for a single GCP zone by project and name.
describe google_compute_zone(project: 'chef-inspec-gcp', zone: 'us-east1-b') do
its('name') { should match 'us-east1-b' }
end
The following examples show how to use this InSpec audit resource.
describe google_compute_zone(project: 'chef-inspec-gcp', zone: 'us-east1-b') do
it { should exist }
end
describe google_compute_zone(project: 'chef-inspec-gcp', zone: 'us-east1-b') do
its('status') { should eq 'UP' }
# or equivalently
it { should be_up }
end
describe google_compute_zone(project: 'chef-inspec-gcp', zone: 'us-east1-b') do
its('available_cpu_platforms') { should include "Intel Skylake" }
end
available_cpu_platforms
,creation_timestamp
,description
,id
,kind
,name
,region
,status
,region_name
Ensure the Compute Engine API is enabled for the project where the resource is located.