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

Allow VPC peering in AWS by add extra variable routes to the default routing table #649

Closed
meabed opened this issue Feb 22, 2020 · 3 comments

Comments

@meabed
Copy link

meabed commented Feb 22, 2020

When creating new cluster, since it's not recommended to use shared VPC.
Its good option to peer VPC and allow networking. but every-time We extend the default routing table and apply again it remove the peer networking routes.
The proposed solution is to allow extra routes to the default routing table as variables passed to the module.
Would this make sense? I could open a PR if so :) Thanks!

Screen shot of terraform apply:
image

@dghubble - I have added some comments below to explain more on the behavior :) Thank you!

@dghubble
Copy link
Member

If you need to customize any internal resource (such as an aws_route_table), use Terraform data to reference and customize/extend that resource. You would not pass those customizations into the Typhoon module. You can use Typhoon's outputs (e.g. vpc_id) to assist in referencing the aws_route_table.

@meabed
Copy link
Author

meabed commented Feb 22, 2020

Hi @dghubble - thanks for the suggestion, I have used terraform data to fetch the route table and modify it.
However the result was not idempotent, first time i apply, terraform add the routes, second time it removes the routes.
So when I passed the routes via variable the terraform apply was idempotent.
it would be great to accommodate this change, the alternative i had was downloading the module and override it like below screenshot.

image

and override the default route table

image

image

@dghubble
Copy link
Member

#654 shows an example using the suggested approach. Previously, extension would cause a diff because of terraform-provider-aws's inline route vs route resource, but this is addressed. Overrides are not needed.

Note the warning: Internally connecting AWS clusters can reduce cross-cloud flexibility and inhibit blue-green cluster patterns. It is not a recommended architecture. Make sure you don't create a situation where two clusters rely on one another's specific setup / cloud.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants