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.
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 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
This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit 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
.