A google_compute_router_nat is used to test a Google RouterNat resource
This resource has beta fields available. To retrieve these fields, include beta: true in the constructor for the resource
describe google_compute_router_nat(project: 'chef-gcp-inspec', region: 'europe-west2', router: 'inspec-gcp-router', name: 'inspec-router-nat') do
it { should exist }
its('nat_ip_allocate_option') { should cmp 'AUTO_ONLY' }
its('source_subnetwork_ip_ranges_to_nat') { should cmp 'ALL_SUBNETWORKS_ALL_IP_RANGES' }
its('min_ports_per_vm') { should cmp '2' }
its('log_config.enable') { should cmp 'true' }
its('log_config.filter') { should cmp 'ERRORS_ONLY' }
end
describe google_compute_router(project: 'chef-gcp-inspec', region: 'europe-west2', router: 'nonexistent', name: 'nonexistent') do
it { should_not exist }
end
Properties that can be accessed from the google_compute_router_nat resource:
namenat_ip_allocate_optionAUTO_ONLY for only allowing NAT IPs allocated by Google Cloud Platform, or MANUAL_ONLY for only user-allocated NAT IP addresses. Possible values:
nat_ipsdrain_nat_ipssource_subnetwork_ip_ranges_to_natALL_SUBNETWORKS_ALL_IP_RANGES, all of the IP ranges in every Subnetwork are allowed to Nat. If ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, all of the primary IP ranges in every Subnetwork are allowed to Nat. LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below). Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other RouterNat section in any Router for this network in this region. Possible values:
subnetworksource_subnetwork_ip_ranges_to_nat is set to LIST_OF_SUBNETWORKS
namesource_ip_ranges_to_natSupported values include:
ALL_IP_RANGESLIST_OF_SECONDARY_IP_RANGESPRIMARY_IP_RANGEsecondary_ip_range_namesLIST_OF_SECONDARY_IP_RANGES is one of the values in sourceIpRangesToNatmin_ports_per_vmudp_idle_timeout_secicmp_idle_timeout_sectcp_established_idle_timeout_sectcp_transitory_idle_timeout_seclog_configenablefilterPossible values:
routerregionEnsure the Compute Engine API is enabled for the current project.
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/google_compute_router_nat/