generated from sa-progress/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #198 from inspec/CHEF-7209-MAGIC-MODULE-compute_v1…
…-TargetInstance CHEF-7209-MAGIC-MODULE-compute_v1-TargetInstance - Resource Implementation
- Loading branch information
Showing
5 changed files
with
214 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...mplates/inspec/examples/google_compute_target_instance/google_compute_target_instance.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%> | ||
<% target_instance = grab_attributes(pwd)['target_instance'] -%> | ||
describe google_compute_target_instance(project: <%= gcp_project_id -%>, targetInstance: <%= doc_generation ? "' #{target_instance['targetInstance']}'":"target_instance['targetInstance']" -%>, zone: <%= doc_generation ? "' #{target_instance['zone']}'":"target_instance['zone']" -%>) do | ||
it { should exist } | ||
its('kind') { should cmp <%= doc_generation ? "'#{target_instance['kind']}'" : "target_instance['kind']" -%> } | ||
its('id') { should cmp <%= doc_generation ? "'#{target_instance['id']}'" : "target_instance['id']" -%> } | ||
its('creation_timestamp') { should cmp <%= doc_generation ? "'#{target_instance['creation_timestamp']}'" : "target_instance['creation_timestamp']" -%> } | ||
its('name') { should cmp <%= doc_generation ? "'#{target_instance['name']}'" : "target_instance['name']" -%> } | ||
its('description') { should cmp <%= doc_generation ? "'#{target_instance['description']}'" : "target_instance['description']" -%> } | ||
its('zone') { should cmp <%= doc_generation ? "'#{target_instance['zone']}'" : "target_instance['zone']" -%> } | ||
its('nat_policy') { should cmp <%= doc_generation ? "'#{target_instance['nat_policy']}'" : "target_instance['nat_policy']" -%> } | ||
its('instance') { should cmp <%= doc_generation ? "'#{target_instance['instance']}'" : "target_instance['instance']" -%> } | ||
its('self_link') { should cmp <%= doc_generation ? "'#{target_instance['self_link']}'" : "target_instance['self_link']" -%> } | ||
its('self_link_with_id') { should cmp <%= doc_generation ? "'#{target_instance['self_link_with_id']}'" : "target_instance['self_link_with_id']" -%> } | ||
its('network') { should cmp <%= doc_generation ? "'#{target_instance['network']}'" : "target_instance['network']" -%> } | ||
its('security_policy') { should cmp <%= doc_generation ? "'#{target_instance['security_policy']}'" : "target_instance['security_policy']" -%> } | ||
|
||
end | ||
|
||
describe google_compute_target_instance(project: <%= gcp_project_id -%>, targetInstance: <%= doc_generation ? "' #{target_instance['targetInstance']}'":"target_instance['targetInstance']" -%>, zone: <%= doc_generation ? "' #{target_instance['zone']}'":"target_instance['zone']" -%>) do | ||
it { should_not exist } | ||
end |
3 changes: 3 additions & 0 deletions
3
...pec/examples/google_compute_target_instance/google_compute_target_instance_attributes.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
gcp_project_id = input(:gcp_project_id, value: '<%= external_attribute(pwd, 'gcp_project_id') -%>', description: 'The GCP project identifier.') | ||
|
||
target_instance = input('target_instance', value: <%= JSON.pretty_generate(grab_attributes(pwd)['target_instance']) -%>, description: 'target_instance description') |
5 changes: 5 additions & 0 deletions
5
...plates/inspec/examples/google_compute_target_instance/google_compute_target_instances.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%> | ||
<% target_instance = grab_attributes(pwd)['target_instance'] -%> | ||
describe google_compute_target_instances(project: <%= gcp_project_id -%>, zone: <%= doc_generation ? "' #{target_instance['zone']}'":"target_instance['zone']" -%>) do | ||
it { should exist } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters