title | platform |
---|---|
About the google_project Resource |
gcp |
Use the google_project
InSpec audit resource to test properties of a GCP project.
Google projects have a name, ID and number as described here.
A google_project
resource block declares the tests for a single GCP project identified by project_id
or project_number
:
describe google_project(project: 'chef-inspec-gcp') do
it { should exist }
its('name') { should eq 'chef-inspec-gcp' }
its('project_number') { should eq 12345678 }
end
describe google_project(project: 12345678) do
it { should exist }
its('name') { should eq 'chef-inspec-gcp' }
its('project_number') { should eq 12345678 }
end
The following examples show how to use this InSpec audit resource.
describe google_project(project: 'chef-inspec-gcp') do
its('project_number') { should eq 12345678 }
end
describe google_project(project: 'chef-inspec-gcp') do
its('lifecycle_state') { should eq "ACTIVE" }
end
create_time
,lifecycle_state
,name
,parent
,project_id
,project_number
Ensure the Cloud Resource Manager API is enabled for the project.