# ----------------------------------------------------------------------------
#
#     ***     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_target_instance resource.'

gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.')

target_instance = input('target_instance', value: {
  "project": "ppradhan",
  "region": "asia-east1",
  "url_map": "value_urlmap",
  "kind": "compute#targetInstance",
  "name": "example-target",
  "zone": "asia-east1-a",
  "full_zone": "https://www.googleapis.com/compute/v1/projects/ppradhan/zones/asia-east1-a",
  "nat_policy": "NO_NAT",
  "instance": "https://www.googleapis.com/compute/v1/projects/ppradhan/zones/asia-east1-a/instances/target-vm",
  "self_link": "https://www.googleapis.com/compute/v1/projects/ppradhan/zones/asia-east1-a/targetInstances/example-target",
}, description: 'target_instance description')

control 'google_compute_target_instance-1.0' do
  impact 1.0
  title 'google_compute_target_instance resource test'

  describe google_compute_target_instance(project: gcp_project_id, name: target_instance['name'], zone: target_instance['zone']) do
  	it { should exist }
  	its('kind') { should cmp target_instance['kind'] }
  	its('name') { should cmp target_instance['name'] }
  	its('zone') { should cmp target_instance['full_zone'] }
  	its('nat_policy') { should cmp target_instance['nat_policy'] }
  	its('instance') { should cmp target_instance['instance'] }
  	its('self_link') { should cmp target_instance['self_link'] }
  end

  describe google_compute_target_instance(project: gcp_project_id, name: "donotexist", zone: target_instance['zone']) do
  	it { should_not exist }
  end
end
