aws_route_tables resource

[edit on GitHub]

Use the aws_route_tables InSpec audit resource to test properties of all or a group of Route Tables. A Route Table contains a set of rules, called routes, that are used to determine where network traffic is directed.

Syntax

Ensure that there is at least one route table

describe aws_route_tables do
  it { should exist }
end

Parameters

This resource does not expect any parameters.

See also the AWS documentation on Route Tables.

Properties

Property Description
route_table_ids The route table IDs
vpc_ids The VPC IDs
entries Provides access to the raw results of the query, which can be treated as an array of hashes.

Examples

Confirm that a route table exists

describe aws_route_tables do
  its('vpc_ids') { should include 'vpc-01625e36123456789' }
end

Confirm a Route Table exists.

describe aws_route_tables do
  its('route_table_ids') { should include 'rtb-12345678' }
end

Matchers

exist

The control will pass if the describe returns at least one result.

Use should_not to test the entity should not exist.

  it { should exist }

  it { should_not exist }

AWS Permissions

Your Principal will need the ec2:DescribeRouteTables action with Effect set to Allow.

You can find detailed documentation at Actions, Resources, and Condition Keys for Amazon EC2.

© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/aws_route_tables/