aws_ec2_vpn_gateway_route_propagation Resource
Use the aws_ec2_vpn_gateway_route_propagation
InSpec audit resource to test if a virtual private gateway can propagate routes to a single AWS EC2 route table.
The AWS::EC2::TransitGatewayRouteTablePropagation
resource enables a virtual private gateway (VGW) to propagate routes to the specified route table of a VPC.
For additional information, including details on parameters and properties, see the AWS documentation on AWS EC2 VPNGatewayRoutePropagation.
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 a route table ID exists.
describe aws_ec2_vpn_gateway_route_propagation(route_table_id: 'ROUTE_TABLE_ID') do
it { should exist }
end
Parameters
transit_gateway_route_table_id
(required)The ID of the route table.
Properties
vpn_gateway_id
- The ID of the virtual private gateway.
route_table_id
- The ID of the route table.
Examples
Ensure a VPN gateway ID is available.
describe aws_ec2_vpn_gateway_route_propagation(route_table_id: 'ROUTE_TABLE_ID') do
its('vpn_gateway_id') { should eq 'VPN_GATEWAY_ID' }
end
Ensure a route table ID is available.
describe aws_ec2_vpn_gateway_route_propagation(route_table_id: 'ROUTE_TABLE_ID') do
its('route_table_id') { should eq 'ROUTE_TABLE_ID' }
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_vpn_gateway_route_propagation(route_table_id: 'ROUTE_TABLE_ID') do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_ec2_vpn_gateway_route_propagation(route_table_id: 'ROUTE_TABLE_ID') do
it { should_not exist }
end
be_available
Use should
to check if the entity is available.
describe aws_ec2_vpn_gateway_route_propagation(route_table_id: 'ROUTE_TABLE_ID') do
it { should be_available }
end
AWS Permissions
Your Principal will need the EC2:Client:DescribeRouteTablesResult
action with Effect
set to Allow
.