Skip to main content

aws_ec2_customer_gateways Resource

Use the aws_ec2_customer_gateways InSpec audit resource to test properties of the plural resource of AWS EC2 customer gateway.

The AWS::EC2::CustomerGateway resource type specifies a customer gateway.

For additional information, including details on parameters and properties, see the AWS documentation on AWS EC2 customer gateway.

Install

This resource is available in the Chef InSpec AWS resource pack.

For information on configuring your AWS environment for Chef InSpec and creating an InSpec profile that uses the InSpec AWS resource pack, see the Chef InSpec documentation on the AWS cloud platform.

Syntax

Ensure that the customer gateway exists.

describe aws_ec2_customer_gateways do
  it { should exist }
end

Parameters

This resource does not require any parameters.

Properties

bgp_asns
The customer gateway’s Border Gateway Protocol (BGP) Autonomous System Number (ASN).

Field: bgp_asn

customer_gateway_ids
The ID of the customer gateway.

Field: customer_gateway_id

ip_addresses
The Internet-routable IP address of the customer gateway’s outside interface.

Field: ip_address

certificate_arns
The Amazon Resource Name (ARN) for the customer gateway certificate.

Field: certificate_arn

states
The current state of the customer gateway.

Field: state

types
The type of VPN connection the customer gateway supports (ipsec.1).

Field: type

device_names
The name of customer gateway device.

Field: device_name

tags
Any tags assigned to the customer gateway.

Field: tags

Examples

Ensure a customer gateway ID is available.

describe aws_ec2_customer_gateways do
  its('customer_gateway_ids') { should include 'CUSTOMER_GATEWAY_ID' }
end

Ensure that the state is available.

describe aws_ec2_customer_gateways do
    its('states') { should include 'available' }
end

Matchers

For a full list of available matchers, see our Universal Matchers page.

The controls will pass if the describe method returns at least one result.

exist

Use should to test that the entity exists.

describe aws_ec2_customer_gateways do
  it { should exist }
end

Use should_not to test the entity does not exist.

describe aws_ec2_customer_gateways do
  it { should_not exist }
end

be_available

Use should to check if the entity is available.

describe aws_ec2_customer_gateways do
  it { should be_available }
end

AWS Permissions

Your Principal will need the EC2:Client:DescribeCustomerGatewaysResult action with Effect set to Allow.

Edit this page on GitHub

Thank you for your feedback!

×









Search Results