-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modifying main routing table in AWS #748
Comments
This resource allows an existing Route Table to be assigned as the "main" Route Table of a VPC. This means that the Route Table will be used for any subnets within the VPC without an explicit Route Table assigned [1]. This is particularly useful in getting an Internet Gateway in place as the default for a VPC, since the automatically created Main Route Table does not have one [2]. Note that this resource is an abstraction over an association and does not map directly to a CRUD-able object in AWS. In order to retain a coherent "Delete" operation for this resource, we remember the ID of the AWS-created Route Table and reset the VPC's main Route Table to it when this resource is deleted. refs #843, #748 [1] http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html#RouteTableDetails [2] http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Internet_Gateway.html#Add_IGW_Routing
Just landed #918, which does not allow directly customizing the auto-created route table, but does allow you to attach a user-defined route table that as the main route table for a VPC. I believe this should cover pretty much all use cases, with the minor caveat that we have to leave the auto-created route table chilling in the VPC ❄️. Feel free to reopen if this doesn't meet your needs. This will come out in |
This resource allows an existing Route Table to be assigned as the "main" Route Table of a VPC. This means that the Route Table will be used for any subnets within the VPC without an explicit Route Table assigned [1]. This is particularly useful in getting an Internet Gateway in place as the default for a VPC, since the automatically created Main Route Table does not have one [2]. Note that this resource is an abstraction over an association and does not map directly to a CRUD-able object in AWS. In order to retain a coherent "Delete" operation for this resource, we remember the ID of the AWS-created Route Table and reset the VPC's main Route Table to it when this resource is deleted. refs hashicorp#843, hashicorp#748 [1] http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html#RouteTableDetails [2] http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Internet_Gateway.html#Add_IGW_Routing
1. This is needed to enable internet access to the control node 2. Terraform does not have the ability to modify the default route table created by AWS. The workaround is to create a new route table and then associate it with the vpc as the main route table. This leaves an unused route table artifact in AWS but it does get cleaned up properly on a `terraform destroy`. See hashicorp/terraform#748 and https://www.terraform.io/docs/providers/aws/r/main_route_table_assoc.html
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I want to amend an auto-created AWS routing table with:
According to the docs, I can currently access
${aws_vpc.x.main_route_table_id}
, but I cannot see a way of referring to it anywhere other then inaws_route_table_association
, which doesn't help much here.The text was updated successfully, but these errors were encountered: