title | platform |
---|---|
About the google_compute_address Resource |
gcp |
Use the google_compute_address
InSpec audit resource to test properties of a single GCP compute address.
A google_compute_address
resource block declares the tests for a single GCP compute address by project, region and name.
describe google_compute_address(project: 'chef-inspec-gcp', location: 'europe-west2', name: 'compute-address') do
it { should exist }
its('name') { should eq 'compute-address' }
its('region') { should match 'europe-west2' }
end
The following examples show how to use this InSpec audit resource.
describe google_compute_address(project: 'chef-inspec-gcp', location: 'europe-west2', name: 'compute-address') do
its('address_ip_exists') { should be true }
end
describe google_compute_address(project: 'chef-inspec-gcp', location: 'europe-west2', name: 'compute-address') do
its('status') { should eq "IN_USE" }
end
describe google_compute_address(project: 'chef-inspec-gcp', location: 'europe-west2', name: 'compute-address') do
its('user_count') { should eq 1 }
end
describe google_compute_address(project: 'chef-inspec-gcp', location: 'europe-west2', name: 'compute-address') do
its('user_resource_name') { should eq "gcp_ext_vm_name" }
end
address
,creation_timestamp
,description
,id
,kind
,name
,region
,status
,users
Ensure the Compute Engine API is enabled for the project where the resource is located.