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 #180 from inspec/CHEF-7342_2-MAGIC-MODULE-compute_…
…v1-GlobalNetworkEndpointGroup CHEF-7342_2-MAGIC-MODULE-compute_v1-GlobalNetworkEndpointGroup - Resource Implementation
- Loading branch information
Showing
4 changed files
with
200 additions
and
15 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
24 changes: 17 additions & 7 deletions
24
...le_compute_global_network_endpoint_group/google_compute_global_network_endpoint_group.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 |
---|---|---|
@@ -1,12 +1,22 @@ | ||
<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%> | ||
<% global_network_endpoint_group = grab_attributes(pwd)['global_network_endpoint_group'] -%> | ||
describe google_compute_global_network_endpoint_group(networkEndpointGroup: <%= doc_generation ? "' #{global_network_endpoint_group['networkEndpointGroup']}'":"global_network_endpoint_group['networkEndpointGroup']" -%>, project: <%= gcp_project_id -%>) do | ||
it { should exist } | ||
its('kind') { should cmp <%= doc_generation ? "'#{global_network_endpoint_group['kind']}'" : "global_network_endpoint_group['kind']" -%> } | ||
its('id') { should cmp <%= doc_generation ? "'#{global_network_endpoint_group['id']}'" : "global_network_endpoint_group['id']" -%> } | ||
its('creation_timestamp') { should cmp <%= doc_generation ? "'#{global_network_endpoint_group['creation_timestamp']}'" : "global_network_endpoint_group['creation_timestamp']" -%> } | ||
its('self_link') { should cmp <%= doc_generation ? "'#{global_network_endpoint_group['self_link']}'" : "global_network_endpoint_group['self_link']" -%> } | ||
its('name') { should cmp <%= doc_generation ? "'#{global_network_endpoint_group['name']}'" : "global_network_endpoint_group['name']" -%> } | ||
its('description') { should cmp <%= doc_generation ? "'#{global_network_endpoint_group['description']}'" : "global_network_endpoint_group['description']" -%> } | ||
its('network_endpoint_type') { should cmp <%= doc_generation ? "'#{global_network_endpoint_group['network_endpoint_type']}'" : "global_network_endpoint_group['network_endpoint_type']" -%> } | ||
its('region') { should cmp <%= doc_generation ? "'#{global_network_endpoint_group['region']}'" : "global_network_endpoint_group['region']" -%> } | ||
its('zone') { should cmp <%= doc_generation ? "'#{global_network_endpoint_group['zone']}'" : "global_network_endpoint_group['zone']" -%> } | ||
its('network') { should cmp <%= doc_generation ? "'#{global_network_endpoint_group['network']}'" : "global_network_endpoint_group['network']" -%> } | ||
its('subnetwork') { should cmp <%= doc_generation ? "'#{global_network_endpoint_group['subnetwork']}'" : "global_network_endpoint_group['subnetwork']" -%> } | ||
its('psc_target_service') { should cmp <%= doc_generation ? "'#{global_network_endpoint_group['psc_target_service']}'" : "global_network_endpoint_group['psc_target_service']" -%> } | ||
|
||
describe google_compute_global_network_endpoint_group(project: <%= gcp_project_id -%>, name: <%= doc_generation ? "'#{global_network_endpoint_group['name']}'" : "global_network_endpoint_group['name']" -%>) do | ||
it { should exist } | ||
its('default_port') { should cmp <%= doc_generation ? "'#{global_network_endpoint_group['default_port']}'" : "global_network_endpoint_group['default_port']" -%> } | ||
its('network_endpoint_type'){ should cmp <%= doc_generation ? "'#{global_network_endpoint_group['network_endpoint_type']}'" : "global_network_endpoint_group['network_endpoint_type']" -%> } | ||
end | ||
|
||
describe google_compute_global_network_endpoint_group(project: <%= gcp_project_id -%>, name: 'nonexistent') do | ||
it { should_not exist } | ||
end | ||
describe google_compute_global_network_endpoint_group(networkEndpointGroup: <%= doc_generation ? "' #{global_network_endpoint_group['networkEndpointGroup']}'":"global_network_endpoint_group['networkEndpointGroup']" -%>, project: <%= gcp_project_id -%>) do | ||
it { should_not exist } | ||
end |
3 changes: 2 additions & 1 deletion
3
...global_network_endpoint_group/google_compute_global_network_endpoint_group_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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
gcp_project_id = input(:gcp_project_id, value: '<%= external_attribute(pwd, 'gcp_project_id') -%>', description: 'The GCP project identifier.') | ||
global_network_endpoint_group = input('global_network_endpoint_group', value: <%= JSON.pretty_generate(grab_attributes(pwd)['global_network_endpoint_group']) -%>, description: 'Network endpoint group description') | ||
|
||
global_network_endpoint_group = input('global_network_endpoint_group', value: <%= JSON.pretty_generate(grab_attributes(pwd)['global_network_endpoint_group']) -%>, description: 'global_network_endpoint_group description') |
11 changes: 4 additions & 7 deletions
11
...e_compute_global_network_endpoint_group/google_compute_global_network_endpoint_groups.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 |
---|---|---|
@@ -1,8 +1,5 @@ | ||
<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%> | ||
<% global_network_endpoint_group = grab_attributes(pwd)['global_network_endpoint_group'] -%> | ||
|
||
describe google_compute_global_network_endpoint_groups(project: <%= gcp_project_id -%>) do | ||
its('default_ports') { should include <%= doc_generation ? "'#{global_network_endpoint_group['default_port']}'" : "global_network_endpoint_group['default_port']" -%> } | ||
its('names') { should include <%= doc_generation ? "'#{global_network_endpoint_group['name']}'" : "global_network_endpoint_group['name']" -%> } | ||
its('network_endpoint_types'){ should include <%= doc_generation ? "'#{global_network_endpoint_group['network_endpoint_type']}'" : "global_network_endpoint_group['network_endpoint_type']" -%> } | ||
end | ||
<% global_network_endpoint_group = grab_attributes(pwd)['global_network_endpoint_group'] -%> | ||
describe google_compute_global_network_endpoint_groups(project: <%= gcp_project_id -%>) do | ||
it { should exist } | ||
end |