terraform/website/source/docs/providers/aws/r/route.html.markdown

52 lines
1.8 KiB
Markdown
Raw Normal View History

2015-06-24 05:44:02 +02:00
---
layout: "aws"
page_title: "AWS: aws_route_table"
sidebar_current: "docs-aws-resource-route-table|"
description: |-
Provides a resource to create a routing entry in a VPC routing table.
---
# aws\_route
Provides a resource to create a routing table entry (a route) in a VPC routing table.
## Example usage:
```
resource "aws_route" "r" {
route_table_id = "rtb-4fbb3ac4"
destination_cidr_block = "10.0.1.0/22"
vpc_peering_connection_id = "pcx-45ff3dc1"
depends_on = ["aws_route_table.testing"]
}
```
## Argument Reference
The following arguments are supported:
* `route_table_id` - (Required) The ID of the routing table.
* `destination_cidr_block` - (Required) The destination CIDR block.
* `vpc_peering_connection_id` - (Optional) An ID of a VPC peering connection.
* `gateway_id` - (Optional) An ID of a VPC internet gateway or a virtual private gateway.
* `instance_id` - (Optional) An ID of a NAT instance.
* `network_interface_id` - (Optional) An ID of a network interface.
Each route must contain either a `gateway_id`, an `instance_id` or a `vpc_peering_connection_id`
or a `network_interface_id`. Note that the default route, mapping the VPC's CIDR block to "local",
is created implicitly and cannot be specified.
## Attributes Reference
The following attributes are exported:
~> **NOTE:** Only the target type that is specified (one of the above)
will be exported as an attribute once the resource is created.
* `route_table_id` - The ID of the routing table.
* `destination_cidr_block` - The destination CIDR block.
* `vpc_peering_connection_id` - An ID of a VPC peering connection.
* `gateway_id` - An ID of a VPC internet gateway or a virtual private gateway.
* `instance_id` - An ID of a NAT instance.
* `network_interface_id` - An ID of a network interface.