github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/aws/r/default_route_table.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_default_route_table" 4 sidebar_current: "docs-aws-resource-default-route-table|" 5 description: |- 6 Provides a resource to manage a Default VPC Routing Table. 7 --- 8 9 # aws\_default\_route\_table 10 11 Provides a resource to manage a Default VPC Routing Table. 12 13 Each VPC created in AWS comes with a Default Route Table that can be managed, but not 14 destroyed. **This is an advanced resource**, and has special caveats to be aware 15 of when using it. Please read this document in its entirety before using this 16 resource. It is recommended you **do not** use both `aws_default_route_table` to 17 manage the default route table **and** use the `aws_main_route_table_association`, 18 due to possible conflict in routes. 19 20 The `aws_default_route_table` behaves differently from normal resources, in that 21 Terraform does not _create_ this resource, but instead attempts to "adopt" it 22 into management. We can do this because each VPC created has a Default Route 23 Table that cannot be destroyed, and is created with a single route. 24 25 When Terraform first adopts the Default Route Table, it **immediately removes all 26 defined routes**. It then proceeds to create any routes specified in the 27 configuration. This step is required so that only the routes specified in the 28 configuration present in the Default Route Table. 29 30 For more information about Route Tables, see the AWS Documentation on 31 [Route Tables][aws-route-tables]. 32 33 For more information about managing normal Route Tables in Terraform, see our 34 documentation on [aws_route_table][tf-route-tables]. 35 36 ~> **NOTE on Route Tables and Routes:** Terraform currently 37 provides both a standalone [Route resource](route.html) and a Route Table resource with routes 38 defined in-line. At this time you cannot use a Route Table with in-line routes 39 in conjunction with any Route resources. Doing so will cause 40 a conflict of rule settings and will overwrite routes. 41 42 43 ## Example usage with tags: 44 45 ```hcl 46 resource "aws_default_route_table" "r" { 47 default_route_table_id = "${aws_vpc.foo.default_route_table_id}" 48 49 route { 50 # ... 51 } 52 53 tags { 54 Name = "default table" 55 } 56 } 57 ``` 58 59 ## Argument Reference 60 61 The following arguments are supported: 62 63 * `default_route_table_id` - (Required) The ID of the Default Routing Table. 64 * `route` - (Optional) A list of route objects. Their keys are documented below. 65 * `tags` - (Optional) A mapping of tags to assign to the resource. 66 * `propagating_vgws` - (Optional) A list of virtual gateways for propagation. 67 68 Each route supports the following: 69 70 * `cidr_block` - (Required) The CIDR block of the route. 71 * `ipv6_cidr_block` - Optional) The Ipv6 CIDR block of the route 72 * `egress_only_gateway_id` - (Optional) The Egress Only Internet Gateway ID. 73 * `gateway_id` - (Optional) The Internet Gateway ID. 74 * `nat_gateway_id` - (Optional) The NAT Gateway ID. 75 * `instance_id` - (Optional) The EC2 instance ID. 76 * `vpc_peering_connection_id` - (Optional) The VPC Peering ID. 77 * `network_interface_id` - (Optional) The ID of the elastic network interface (eni) to use. 78 79 Each route must contain either a `gateway_id`, an `instance_id`, a `nat_gateway_id`, a 80 `vpc_peering_connection_id` or a `network_interface_id`. Note that the default route, mapping 81 the VPC's CIDR block to "local", is created implicitly and cannot be specified. 82 83 ## Attributes Reference 84 85 The following attributes are exported: 86 87 * `id` - The ID of the routing table 88 89 90 [aws-route-tables]: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html#Route_Replacing_Main_Table 91 [tf-route-tables]: /docs/providers/aws/r/route_table.html