| title | About the google_compute_instance_group Resource |
|---|---|
| platform | gcp |
Use the google_compute_instance_group InSpec audit resource to test properties of a single GCP compute instance group.
A google_compute_instance_group resource block declares the tests for a single GCP compute instance group by project, zone and name.
describe google_compute_instance_group(project: 'chef-inspec-gcp', zone: 'europe-west2-a', name: 'gcp-inspec-test') do
it { should exist }
its('size') { should eq 2 }
end
The following examples show how to use this InSpec audit resource.
describe google_compute_instance_group(project: 'chef-inspec-gcp', zone: 'europe-west2-a', name: 'gcp-inspec-test') do
its('size') { should eq 2 }
end
describe google_compute_instance_group(project: 'chef-inspec-gcp', zone: 'europe-west2-a', name: 'gcp-inspec-test') do
its('port_name') { should eq "http" }
its('port_value') { should eq 80 }
end
creation_timestamp,description,fingerprint,id,kind,name,named_ports,network,size,subnetwork,zone
Ensure the Compute Engine API is enabled for the project where the resource is located.