# ----------------------------------------------------------------------------
#
#     ***     AUTO GENERATED CODE    ***    Type: MMv1     ***
#
# ----------------------------------------------------------------------------
#
#     This file is automatically generated by Magic Modules and manual
#     changes will be clobbered when the file is regenerated.
#
#     Please read more about how to change this file in README.md and
#     CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------

title 'Test GCP google_compute_region_instance_group resource.'

gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.')
gcp_location = input(:gcp_location, value: 'gcp_location', description: 'The GCP project region.')
region_instance_group = input('region_instance_group', value: {
  "name": "instance-group-2",
  "region": "us-central1",
  "size": 1,
  "named_port_name": "port",
  "named_port_port": 80
}, description: 'Compute region instance group description')
control 'google_compute_region_instance_group-1.0' do
  impact 1.0
  title 'google_compute_region_instance_group resource test'

  describe google_compute_region_instance_group(project: gcp_project_id, region: region_instance_group['region'], name: region_instance_group['name']) do
  it { should exist }
  its('name') { should eq region_instance_group['name'] }
  its('size') { should eq region_instance_group['size'] }
  its('named_ports.first.name') { should eq region_instance_group['named_port_name'] }
  its('named_ports.first.port') { should eq region_instance_group['named_port_port'] }
  end

  describe google_compute_region_instance_group(project: gcp_project_id, region: gcp_location, name: 'nonexistent') do
  it { should_not exist }
  end
end
