Skip to main content

aws_vpn_connections Resource

[edit on GitHub]

Use the aws_vpn_connections InSpec audit resource to test the 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 VPN connections.
tags
This property provides 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

To 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 passes if the describe returns at least one result.

describe aws_vpn_connections do
  it { should exist }
end

not exists

Use should_not to test whether the entity should not exist.

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?

×









Search Results