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

Split out top-level aws_route resource #2388

Closed
phinze opened this issue Jun 17, 2015 · 12 comments
Closed

Split out top-level aws_route resource #2388

phinze opened this issue Jun 17, 2015 · 12 comments

Comments

@phinze
Copy link
Contributor

phinze commented Jun 17, 2015

Same logic as splitting out other top level resources:

  • routes don't all have to be known at route table definition time
  • routes can be dynamically added and removed
  • individual routes can be managed on route tables that terraform does not manage
@willmcg
Copy link

willmcg commented Jun 18, 2015

+1

I swear you guys are reading my mind. I have an exact use for this case where I need to add a route to an pre-existing route table for a VPC peering connection created with Terraform. In this case I own both of the VPCs being peered but only one of them is created by Terraform and so has its own pre-existing route table that needs the peering route to be created.

@gkze
Copy link
Contributor

gkze commented Jun 19, 2015

huge +1 :)

@gkze
Copy link
Contributor

gkze commented Jun 22, 2015

@phinze I took a stab at this -- and since Route is not a top-level resource in the EC2 API, it doesn't have an ID that it can be identified by. How do you think the resourceAwsRouteRead should be implemented then? I was thinking pass it the route table ID that it's an entry in, and then check whether the route is present in there, but I'm not too sure on how clean that is

@phinze
Copy link
Contributor Author

phinze commented Jun 22, 2015

@gkze - great to hear you're interesting in helping out! 😀

It's correct that we need to build our own identifier in this case. You should be able to look to the implementation of aws_security_group_rule which is very similar.

Let me know if that helps - happy to go into more detail here too.

@gkze
Copy link
Contributor

gkze commented Jun 22, 2015

Thanks @phinze! That's definitely helpful.

On a semi-related note, in a schema -- what's the difference between Optional being false vs. Required being true (or vice versa)? I would assume they're the same but I'm sure there's a reason for both of them existing...

@phinze
Copy link
Contributor Author

phinze commented Jun 22, 2015

I agree it's a little confusing with all the booleans. Here's a truth table of the relevant scenarios:

Required Optional Computed Description
F F F Invalid
F F T Exported, read-only field
F T F Optional, user specified field (if unspecified, implies that user requested an empty value)
F T T Optional, if unspecified, will be calculated
T F F Required, user-specified field
T F T Invalid
T T F Invalid
T T T Invalid

@gkze
Copy link
Contributor

gkze commented Jun 22, 2015

This is awesome @phinze! Another question: I see there is a MigrateState field in a Resource. Does this apply here? Not sure how exactly it's being used in the aws_security_group_rule resource

@phinze
Copy link
Contributor Author

phinze commented Jun 22, 2015

If you take a look at the docs for MigrateState and SchemaVersion, you'll see those exist to provide us with hooks for maintaining backwards compatibility as the state config changes. Since you're implementing a new resource, you don't have to worry about them at all. 👍

@gkze
Copy link
Contributor

gkze commented Jun 22, 2015

sweet! 🙏

@steve-jansen
Copy link
Contributor

FYI
PR #3548 is an update to #2454 to implement an aws_route resource.

@catsby
Copy link
Contributor

catsby commented Mar 31, 2016

Hey all! We merged #3548 some time ago, just forgot to close the loop here.

Thanks!

@catsby catsby closed this as completed Mar 31, 2016
@ghost
Copy link

ghost commented Apr 26, 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 Apr 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants