title | platform |
---|---|
About the google_projects resource |
gcp |
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 google_project.md for more detailed information
project_numbers
: an array ofgoogle_project
numberlifecycle_states
: an array ofgoogle_project
lifecycle_stateproject_names
: an array ofgoogle_project
namecreate_times
: an array ofgoogle_project
create_timelabels
: an array ofgoogle_project
labelsparents
: an array ofgoogle_project
parentproject_ids
: an array ofgoogle_project
project_id
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 Cloud Resource Manager API is enabled for the current project.