title | platform |
---|---|
About the google_compute_vpn_tunnel Resource |
gcp |
Use the google_compute_vpn_tunnel
InSpec audit resource to test properties of a single GCP compute vpn_tunnel.
A google_compute_vpn_tunnel
resource block declares the tests for a single GCP vpn_tunnel by project, region and name.
describe google_compute_vpn_tunnel(project: 'chef-inspec-gcp', region: 'europe-west2', name: 'gcp-inspec-vpn-tunnel') do
it { should exist }
its('name') { should eq 'gcp-inspec-vpn-tunnel' }
its('region') { should match 'europe-west2' }
end
The following examples show how to use this InSpec audit resource.
describe google_compute_vpn_tunnel(project: 'chef-inspec-gcp', region: 'europe-west2', name: 'gcp-inspec-vpn-tunnel') do
it { should exist }
end
describe google_compute_vpn_tunnel(project: 'chef-inspec-gcp', region: 'europe-west2', name: 'gcp-inspec-vpn-tunnel') do
its('creation_timestamp_date') { should be > Time.now - 365*60*60*24*10 }
end
describe google_compute_vpn_tunnel(project: 'chef-inspec-gcp', region: 'europe-west2', name: 'gcp-inspec-vpn-tunnel') do
its('id') { should eq 12345567789 }
end
describe google_compute_vpn_tunnel(project: 'chef-inspec-gcp', region: 'europe-west2', name: 'gcp-inspec-vpn-tunnel') do
its('peer_ip') { should eq "123.123.123.123" }
end
describe google_compute_vpn_tunnel(project: 'chef-inspec-gcp', region: 'europe-west2', name: 'gcp-inspec-vpn_tunnel') do
its('status') { should eq "ESTABLISHED" }
end
creation_timestamp
,description
,detailed_status
,id
,ike_version
,kind
,local_traffic_selector
,name
,peer_ip
,region
,remote_traffic_selector
,router
,self_link
,shared_secret
,shared_secret_hash
,status
,target_vpn_gateway
Ensure the Compute Engine API is enabled for the project where the resource is located.