A google_compute_instance_groups is used to test a Google InstanceGroup resource
This resource has beta fields available. To retrieve these fields, include beta: true in the constructor for the resource
describe google_compute_instance_groups(project: 'chef-gcp-inspec', zone: 'zone') do
its('instance_group_names') { should include 'inspec-instance-group' }
end
describe google_compute_instance_groups(project: 'chef-inspec-gcp') do
its('count') { should be <= 100}
end
describe google_compute_instance_groups(project: 'chef-inspec-gcp', zone: 'europe-west2-a') do
its('instance_group_names') { should include "my-instance-group-name" }
end
google_compute_instance_groups(project: 'chef-inspec-gcp', zone: 'europe-west2-a').where(instance_group_name: /^mig/).instance_group_names.each do |instance_group_name|
describe google_compute_instance_group(project: 'chef-inspec-gcp', zone: 'europe-west2-a', name: instance_group_name) do
it { should exist }
its('size') { should be > 0 }
end
end
Properties that can be accessed from the google_compute_instance_groups resource:
See the google_compute_instance_group resource for more information.
creation_timestampsgoogle_compute_instance_group creation_timestampdescriptionsgoogle_compute_instance_group descriptioninstance_group_idsgoogle_compute_instance_group idinstance_group_namesgoogle_compute_instance_group namenamed_portsgoogle_compute_instance_group named_portsnetworksgoogle_compute_instance_group networkregionsgoogle_compute_instance_group regionsubnetworksgoogle_compute_instance_group subnetworkzonesgoogle_compute_instance_group zoneThis resource supports all of the above properties as filter criteria, which can be used with where as a block or a method.
Ensure the Compute Engine API is enabled for the current project.
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/google_compute_instance_groups/