title | platform |
---|---|
About the aws_ec2_customer_gateway Resource |
aws |
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.
Ensure that the customer gateway Id exists.
describe aws_ec2_customer_gateway(customer_gateway_id: "CUSTOMER_GATEWAY_ID") do
it { should exist }
end
customer_gateway_id
(required)
The ID of the customer gateway.
For additional information, see the AWS documentation on AWS EC2 customer gateway.
Property | Description |
---|---|
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. |
describe aws_ec2_customer_gateway(customer_gateway_id: "CUSTOMER_GATEWAY_ID") do
its('customer_gateway_id') { should eq 'CUSTOMER_GATEWAY_ID' }
end
describe aws_ec2_customer_gateway(customer_gateway_id: "CUSTOMER_GATEWAY_ID") do
its('state') { should eq 'available' }
end
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.
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
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
Your Principal will need the EC2:Client:DescribeCustomerGatewaysResult
action with Effect
set to Allow
.