2018-02-07 15:48:55 +00:00
---
title: About the aws_route_table Resource
2018-02-14 01:42:39 +00:00
platform: aws
2018-02-07 15:48:55 +00:00
---
2018-02-15 02:23:29 +00:00
# aws\_route\_table
2018-02-07 15:48:55 +00:00
2019-04-26 18:24:29 +00:00
Use the `aws_route_table` Chef InSpec audit resource to test properties of a single Route Table. A route table contains a set of rules, called routes, that are used to determine where network traffic is directed.
2018-02-07 15:48:55 +00:00
<br>
2018-08-09 12:34:49 +00:00
## Availability
### Installation
2019-04-26 18:24:29 +00:00
This resource is distributed along with Chef InSpec itself. You can use it automatically.
2018-08-09 12:34:49 +00:00
### Version
This resource first became available in v2.0.16 of InSpec.
2018-02-07 15:48:55 +00:00
## Syntax
2018-02-26 16:11:06 +00:00
# Ensure that a certain route table exists by name
describe aws_route_table('rtb-123abcde') do
it { should exist }
end
2018-02-07 15:48:55 +00:00
## Resource Parameters
2018-02-15 02:23:29 +00:00
### route\_table\_id
2018-02-07 15:48:55 +00:00
2018-02-14 01:42:39 +00:00
This resource expects a single parameter that uniquely identifies the Route Table. You may pass it as a string, or as the value in a hash:
2018-02-07 15:48:55 +00:00
2018-02-26 16:11:06 +00:00
describe aws_route_table('rtb-123abcde') do
it { should exist }
end
# Same
describe aws_route_table(route_table_id: 'rtb-123abcde') do
it { should exist }
end
2018-02-07 15:48:55 +00:00
## Matchers
2018-02-16 03:07:18 +00:00
For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
2018-02-14 01:42:39 +00:00
2018-02-07 15:48:55 +00:00
### exist
2018-02-26 16:11:06 +00:00
Indicates that the Route Table provided was found. Use `should_not` to test for Route Tables that should not exist.
2018-02-07 15:48:55 +00:00
describe aws_route_table('should-be-there') do
it { should exist }
end
describe aws_route_table('should-not-be-there') do
it { should_not exist }
end
2018-05-10 18:57:53 +00:00
## AWS Permissions
Your [Principal](https://docs.aws.amazon.com/IAM/latest/UserGuide/intro-structure.html#intro-structure-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](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazonec2.html).