2014-07-23 23:26:47 +02:00
|
|
|
---
|
|
|
|
layout: "aws"
|
|
|
|
page_title: "AWS: aws_route_table"
|
|
|
|
sidebar_current: "docs-aws-resource-route-table|"
|
2014-10-22 05:21:56 +02:00
|
|
|
description: |-
|
|
|
|
Provides a resource to create a VPC routing table.
|
2014-07-23 23:26:47 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
# aws\_route\_table
|
|
|
|
|
|
|
|
Provides a resource to create a VPC routing table.
|
|
|
|
|
2014-12-10 19:33:13 +01:00
|
|
|
## Example usage with tags:
|
2014-07-23 23:26:47 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
resource "aws_route_table" "r" {
|
|
|
|
vpc_id = "${aws_vpc.default.id}"
|
|
|
|
route {
|
|
|
|
cidr_block = "10.0.1.0/24"
|
2014-08-22 02:08:51 +02:00
|
|
|
gateway_id = "${aws_internet_gateway.main.id}"
|
2014-07-23 23:26:47 +02:00
|
|
|
}
|
2014-12-10 19:33:13 +01:00
|
|
|
|
|
|
|
tags {
|
|
|
|
Name = "main"
|
|
|
|
}
|
2014-07-23 23:26:47 +02:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `vpc_id` - (Required) The ID of the routing table.
|
2014-08-22 02:08:51 +02:00
|
|
|
* `route` - (Optional) A list of route objects. Their keys are documented below.
|
2014-12-10 19:33:13 +01:00
|
|
|
* `tags` - (Optional) A mapping of tags to assign to the resource.
|
2014-07-23 23:26:47 +02:00
|
|
|
|
|
|
|
Each route supports the following:
|
|
|
|
|
|
|
|
* `cidr_block` - (Required) The CIDR block of the route.
|
|
|
|
* `gateway_id` - (Optional) The Internet Gateway ID.
|
|
|
|
* `instance_id` - (Optional) The EC2 instance ID.
|
|
|
|
|
2014-08-22 02:08:51 +02:00
|
|
|
Each route must contain either a `gateway_id` or an `instance_id`. Note that the
|
|
|
|
default route, mapping the VPC's CIDR block to "local", is created implicitly and
|
|
|
|
cannot be specified.
|
|
|
|
|
2014-07-23 23:26:47 +02:00
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
|
|
|
* `id` - The ID of the routing table
|