Skip to main content

aws_ec2_customer_gateway Resource

Use the aws_ec2_customer_gateway InSpec audit resource to test properties of a single 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 Id exists.

describe aws_ec2_customer_gateway(customer_gateway_id: "CUSTOMER_GATEWAY_ID") do
  it { should exist }
end

Parameters

customer_gateway_id (required)

The ID of the customer gateway.

Properties

bgp_asn
The customer gateway’s Border Gateway Protocol (BGP) Autonomous System Number (ASN).
customer_gateway_id
The ID of the customer gateway.
ip_address
The internet-routable IP address of the customer gateway’s outside interface.
certificate_arn
The Amazon Resource Name (ARN) for the customer gateway certificate.
state
The current state of the customer gateway.
type
The type of VPN connection the customer gateway supports (ipsec.1).
device_name
The name of customer gateway device.
tags
Any tags assigned to the customer gateway.

Examples

Ensure a customer gateway ID is available.

describe aws_ec2_customer_gateway(customer_gateway_id: "CUSTOMER_GATEWAY_ID") do
  its('customer_gateway_id') { should eq 'CUSTOMER_GATEWAY_ID' }
end

Ensure that the state is available.

describe aws_ec2_customer_gateway(customer_gateway_id: "CUSTOMER_GATEWAY_ID") do
    its('state') { should eq '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_gateway(customer_gateway_id: "CUSTOMER_GATEWAY_ID") do
  it { should exist }
end

Use should_not to test the entity does not exist.

describe aws_ec2_customer_gateway(customer_gateway_id: "CUSTOMER_GATEWAY_ID") do
  it { should_not exist }
end

be_available

Use should to check if the entity is available.

describe aws_ec2_customer_gateway(customer_gateway_id: "CUSTOMER_GATEWAY_ID") 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