A google_compute_regions is used to test a Google Region resource
This resource has beta fields available. To retrieve these fields, include beta: true in the constructor for the resource
describe google_compute_regions(project: 'chef-gcp-inspec') do
its('count') { should be >= 1 }
its('region_names') { should include "#{gcp_location}" }
its('region_statuses') { should_not include "DOWN" }
its('region_ids') { should include "1290" }
end
google_compute_region
google_compute_regions(project: 'chef-inspec-gcp').region_names.each do |region_name|
describe google_compute_region(project: 'chef-inspec-gcp', region: region_name) do
it { should be_up }
end
end
describe google_compute_regions(project: 'chef-inspec-gcp') do
its('count') { should be >= 10}
end
describe google_compute_regions(project: 'chef-inspec-gcp') do
its('region_names') { should include 'europe-west2' }
end
describe google_compute_regions(project: 'chef-inspec-gcp') do
its('region_statuses') { should_not include "DOWN" }
end
google_compute_regions(project: gcp_project_id).where(region_name: /^europe/).region_names.each do |region_name|
describe google_compute_region(project: 'chef-inspec-gcp', region: region_name) do
it { should be_up }
end
end
Properties that can be accessed from the google_compute_regions resource:
See the google_compute_region resource for more information.
creation_timestampsgoogle_compute_region creation_timestampdeprecatedsgoogle_compute_region deprecateddescriptionsgoogle_compute_region descriptionregion_idsgoogle_compute_region idregion_namesgoogle_compute_region namequotasgoogle_compute_region quotasregion_statusesgoogle_compute_region statuszonesgoogle_compute_region zonesThis 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.
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/google_compute_regions/