A google_compute_region_instance_group_manager is used to test a Google RegionInstanceGroupManager resource
This resource has beta fields available. To retrieve these fields, include beta: true in the constructor for the resource
describe google_compute_region_instance_group_manager(project: 'chef-gcp-inspec', region: 'europe-west2', name: 'inspec-rigm') do
it { should exist }
its('base_instance_name') { should eq 'rigm1' }
its('target_size') { should eq '1' }
its('named_ports.first.name') { should eq 'https' }
its('named_ports.first.port') { should eq '8888' }
its('auto_healing_policies.first.initial_delay_sec') { should eq '300' }
end
describe google_compute_region_instance_group_manager(project: 'chef-gcp-inspec', region: 'europe-west2', name: 'nonexistent') do
it { should_not exist }
end
describe google_compute_region_instance_group_manager(project: 'chef-inspec-gcp', region: 'europe-west2', name: 'gcp-inspec-test') do
its('target_size') { should eq 2 }
end
describe google_compute_region_instance_group_manager(project: 'chef-inspec-gcp', region: 'europe-west2', name: 'gcp-inspec-test') do
its('named_ports') { should include "http" }
end
Properties that can be accessed from the google_compute_region_instance_group_manager resource:
base_instance_namecreation_timestampcurrent_actionsabandoning : The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from the managed instance group without deleting it.
creating : The number of instances in the managed instance group that are scheduled to be created or are currently being created. If the group fails to create any of these instances, it tries again until it creates the instance successfully. If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated.
creating_without_retries : The number of instances that the managed instance group will attempt to create. The group attempts to create each instance only once. If the group fails to create any of these instances, it decreases the group’s targetSize value accordingly.
deleting : The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted.
none : The number of instances in the managed instance group that are running and have no scheduled actions.
recreating : The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template.
refreshing : The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a recreate action. For example, setting or removing target pools for the instance.
restarting : The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted.
descriptionidinstance_groupinstance_templatenamenamed_portsname : The name for this named port. The name must be 1-63 characters long, and comply with RFC1035.
port : The port number, which can be a value between 1 and 65535.
target_poolstarget_sizeauto_healing_policieshealth_check : The URL for the health check that signals autohealing.
initial_delay_sec : The number of seconds that the managed instance group waits before it applies autohealing policies to new instances or recently recreated instances
regionEnsure 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_region_instance_group_manager/