aws_ec2_transit_gateway_route_tables Resource
Use the aws_ec2_transit_gateway_route_tables
InSpec audit resource to test properties of some or all Transit Gateway route tables.
This resource does not expect any parameters.
For additional information, including details on parameters and properties, see the AWS documentation on Transit Gateway route tables.
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
Verify that a Transit Gateway route table ID exists.
describe aws_ec2_transit_gateway_route_tables do
it { should exist }
end
An aws_ec2_transit_gateway_route_tables
resource block uses an optional filter to select a group of Elastic IPs and then test that group.
Parameters
This resource does not require any parameters.
Properties
transit_gateway_route_table_ids
- The ID of the Transit Gateway route table.
transit_gateway_ids
- The ID of the Transit Gateway.
states
- The state of the route table. Relevant values are:
available
,deleting
,deleted
, andpending
. default_association_route_tables
- Indicates whether this is the default association route table for the Transit Gateway. Default values are
true
andfalse
. default_propagation_route_tables
- Indicates whether this is the default propagation route table for the Transit Gateway. Default values are
true
andfalse
. creation_times
- The creation time of the Transit Gateway route table.
tags
- The tags of the Transit Gateway route table.
Examples
Ensure a Transit Gateway route table has route table ID.
describe aws_ec2_transit_gateway_route_tables do
it { should exist }
end
Match count of Transit Gateway route table.
describe aws_ec2_transit_gateway_route_tables do
its('count') { should eq 5 }
end
Check State whether it is available or not.
describe aws_ec2_transit_gateway_route_tables 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.
exist
The control will pass if the describe returns at least one result.
describe aws_ec2_transit_gateway_route_tables do
it { should exist }
end
Use should_not
to test an entity that should not exist.
describe aws_ec2_transit_gateway_route_tables do
it { should_not exist }
end
AWS Permissions
Your Principal will need the EC2:Client:DescribeTransitGatewayRouteTablesResult
action with Effect
set to Allow
.
You can find detailed documentation at Actions, Resources, and Condition Keys for Amazon EC2.
Was this page helpful?