title | platform |
---|---|
About the google_organization Resource |
gcp |
Use the google_organization
InSpec audit resource to test properties of a GCP organization.
Google organization have a name, display name (or domain) and lifecycle state. For more info, please see here.
A google_organization
resource block declares the tests for a single GCP organization identified by display_name
or name
:
describe google_organization(display_name: 'google.com') do
it { should exist }
its('name') { should eq 'organizations/1234' }
its('display_name') { should eq 'google.com' }
end
describe google_organization(name: 'organizations/1234') do
it { should exist }
its('name') { should eq 'google.com' }
its('lifecycle_state') { should eq 'ACTIVE' }
end
The following examples show how to use this InSpec audit resource.
describe google_organization(name: 'organizations/1234') do
its('name') { should eq 'organizations/1234' }
end
describe google_organization(display_name: 'google.com') do
its('lifecycle_state') { should eq "ACTIVE" }
end
name
,display_name
,lifecycle_state
Ensure the Cloud Resource Manager API is enabled for the project.