A google_projects is used to test a Google Project resource
describe google_projects() do
its('count') { should be >= 1 }
its('project_ids') { should include 'chef-gcp-inspec' }
its('lifecycle_states') { should include 'ACTIVE' }
end
describe google_projects do
its('count') { should be <= 100}
end
describe google_projects do
its('project_names'){ should include "GCP Project Name" }
end
describe google_projects do
its('project_ids'){ should include "gcp_project_id" }
end
describe google_projects do
its('project_numbers'){ should include 1122334455 }
end
google_projects.where(project_id: /^prod/).project_ids.each do |gcp_project_id|
describe google_project(project: gcp_project_id) do
it { should exist }
its('lifecycle_state') { should eq "ACTIVE" }
end
end
google_projects.where(project_id: /^prod/, lifecycle_state: 'ACTIVE').project_ids.each do |gcp_project_id|
describe google_project(project: gcp_project_id) do
it { should exist }
end
end
Properties that can be accessed from the google_projects resource:
See the google_project resource for more information.
project_numbersgoogle_project numberlifecycle_statesgoogle_project lifecycle_stateproject_namesgoogle_project namecreate_timesgoogle_project create_timelabelsgoogle_project labelsparentsgoogle_project parentproject_idsgoogle_project project_idThis resource supports all of the above properties as filter criteria, which can be used with where as a block or a method.
Ensure the Cloud Resource Manager 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_projects/