aws_vpn_connections Resource
Use the aws_vpn_connections
InSpec audit resource to test properties of all AWS VPN Connections.
For additional information, including details on parameters and properties, see the AWS documentation on VPN Connections.
Installation
This resource is available in the Chef InSpec AWS resource pack.
See the Chef InSpec documentation on cloud platforms for information on configuring your AWS environment for InSpec and creating an InSpec profile that uses the InSpec AWS resource pack.
Syntax
Ensure that one or more VPN Connections exist.
describe aws_vpn_connections do
it { should exist }
end
Parameters
This resource does not require any parameters.
Properties
vpn_connection_ids
- This property provides all the IDs of the VPN Connections.
vpn_gateway_ids
- This property provides all the IDs of the virtual private gateways associated with the VPN Connections.
outside_ip_addresses
- This property provides the outside IP addresses of the VPN Connections.
tunnel_inside_cidrs
- This property provides the tunnel inside cidrs of the VPN Connections.
states
- This property provides the current state of the VPN Connections.
types
- This property provides the current types of the VPN Connections.
tags
- This property provids the current tags of the VPN Connections.
Examples
Ensure that VPN connections are available.
describe aws_vpn_connections do
its('state.uniq') { should eq ['available'] }
end
Check tags .
describe aws_vpn_connections.where { tags["Name"] == "vpn-connection-example-123" } do
it { should exist }
its('count') { should be 3 }
end
Matchers
This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our Universal Matchers page.
exist
The control will pass if the describe returns at least one result.
Use should_not
to test the entity should not exist.
describe aws_vpn_connections do
it { should exist }
end
describe aws_vpn_connections do
it { should_not exist }
end
AWS Permissions
Your Principal will need the EC2:Client:DescribeVpnConnectionsResult
action with Effect
set to Allow
.
You can find detailed documentation at Actions, Resources, and Condition Keys for Amazon EC2.
Was this page helpful?