| title | platform |
|---|---|
About the google_compute_zones resource |
gcp |
A google_compute_zones is used to test a Google Zone resource
This resource has beta fields available. To retrieve these fields, include beta: true in the constructor for the resource
google_compute_zones(project: 'chef-gcp-inspec').zone_names.each do |zone_name|
describe google_compute_zone(project: 'chef-gcp-inspec', name: zone_name) do
it { should exist }
it { should be_up }
end
end
describe google_compute_zones(project: 'chef-inspec-gcp') do
its('count') { should be <= 100}
end
describe google_compute_zones(project: 'chef-inspec-gcp') do
its('zone_ids.count') { should cmp 9 }
end
describe google_compute_zones(project: 'chef-inspec-gcp') do
its('zone_names') { should include "us-east1-b" }
end
describe google_compute_zones(project: 'chef-inspec-gcp') do
its('zone_statuses') { should_not include "DOWN" }
end
google_compute_zones(project: 'chef-inspec-gcp').where(zone_name: /^us/).zone_names.each do |zone_name|
describe google_compute_zone(project: 'chef-inspec-gcp', zone: zone_name) do
it { should exist }
its('status') { should eq 'UP' }
end
end
Properties that can be accessed from the google_compute_zones resource:
See google_compute_zone.md for more detailed information
creation_timestamps: an array ofgoogle_compute_zonecreation_timestampdeprecateds: an array ofgoogle_compute_zonedeprecateddescriptions: an array ofgoogle_compute_zonedescriptionzone_ids: an array ofgoogle_compute_zoneidzone_names: an array ofgoogle_compute_zonenameregions: an array ofgoogle_compute_zoneregionzone_statuses: an array ofgoogle_compute_zonestatusavailable_cpu_platforms: an array ofgoogle_compute_zoneavailable_cpu_platforms
This resource supports all of the above properties as filter criteria, which can be used
with where as a block or a method.
Ensure the Compute Engine API is enabled for the current project.