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

Add a way to access the main route table #193

Closed
xetorthio opened this issue Aug 14, 2014 · 6 comments
Closed

Add a way to access the main route table #193

xetorthio opened this issue Aug 14, 2014 · 6 comments

Comments

@xetorthio
Copy link
Contributor

In the AWS provider, there is no way to access the main route table created with a vpc.
Which means that if I wanted to add routing rules, I need to create a new route table for the vpc, which is somehow inconvenient since I already have one.

This is explained here: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html

What do you think of adding something like aws_vpc.foo.main_route_table_id to be able to reference the main route table of the vpc?

@mitchellh
Copy link
Contributor

Good idea. Done!

@alex88
Copy link

alex88 commented Dec 10, 2014

Now that the vpc resource has that parameter, how can I manipulate it? It seems I can just create a new route table, not edit the default one created with the vpc

@armon
Copy link
Member

armon commented Dec 10, 2014

@alex88 This allows you to just reference the route table that AWS automatically creates from the VPC. You would need a route table resource to be able to manipulate it.

@alex88
Copy link

alex88 commented Dec 11, 2014

@armon I tried but it creates a new route table, how can I reference an existing one?

@armon
Copy link
Member

armon commented Dec 11, 2014

The only way I can think of would be to make the configuration for the route table explicit, and then manually write the state of the resource into the state file.

If you just create the resource, then the next apply will try to create it since Terraform has no way to link the logical resource to the existing route table. So just putting the correct ID into the state file and calling refresh should do the trick.

@alex88
Copy link

alex88 commented Dec 12, 2014

Oh ok so there is just a workaround, thanks!

@ghost ghost locked and limited conversation to collaborators May 5, 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

4 participants