Skip to content

Latest commit

 

History

History
49 lines (29 loc) · 1.69 KB

google_compute_region_instance_group_manager.md

File metadata and controls

49 lines (29 loc) · 1.69 KB
title platform
About the google_compute_region_instance_group_manager Resource
gcp

google_compute_region_instance_group_manager

Use the google_compute_region_instance_group_manager InSpec audit resource to test properties of a single multi-zone GCP compute instance group.


Syntax

A google_compute_region_instance_group_manager resource block declares the tests for a single GCP compute instance group by project, region and name.

describe google_compute_region_instance_group_manager(project: 'chef-inspec-gcp', region: 'europe-west2', name: 'gcp-inspec-test') do
  it { should exist }
end

Examples

The following examples show how to use this InSpec audit resource.

Test that a GCP compute region instance group manager has the expected size

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

Test that a GCP compute region instance group manager has a port with supplied name and value

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

  • base_instance_name, creation_timestamp, current_actions, description, fingerprint, id, instance_group, instance_template, kind, name, named_ports, region, self_link, target_pools, target_size, region

GCP Permissions

Ensure the Compute Engine API is enabled for the project where the resource is located.