Skip to content
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

Closed
errordeveloper opened this issue Jan 7, 2015 · 2 comments
Closed

Modifying main routing table in AWS #748

errordeveloper opened this issue Jan 7, 2015 · 2 comments

Comments

@errordeveloper
Copy link

I want to amend an auto-created AWS routing table with:

gateway_id = ${aws_internet_gateway.x.id}

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 in aws_route_table_association, which doesn't help much here.

@errordeveloper errordeveloper changed the title Modifying an auto-created resource, such as main routing table in AWS Modifying main routing table in AWS Jan 7, 2015
phinze added a commit that referenced this issue Feb 3, 2015
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
@phinze
Copy link
Contributor

phinze commented Feb 3, 2015

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 0.3.7, but you're welcome to take it for a spin on master - feedback is welcome!

@phinze phinze closed this as completed Feb 3, 2015
yahyapo pushed a commit to yahyapo/terraform that referenced this issue Mar 13, 2015
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
floriangrundig pushed a commit to triforkse/microservices-infrastructure that referenced this issue May 26, 2015
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
@ghost
Copy link

ghost commented May 4, 2020

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.

@ghost ghost locked and limited conversation to collaborators May 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants