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 support to create a custom route in a subnet for TGW #116

Closed

Conversation

findmyname666
Copy link

@findmyname666 findmyname666 commented Jun 7, 2023

Reasoning

TLDR The company where I work right now have 2 TGWs in the VPC. Each TGW is used for the different traffic.
It means I have to add a route for both TGWs to some specific subnets. Unfortunately I didn't find any way how to achieve it in the current state of the module. I noticed that one can use variables transit_gateway_id and transit_gateway_routes but this works only for one TGW. Additionally It is worth to mention that creation of VPC and TGWs is out of my control.

Implementation notes

Adding a new variable custom_route_to_tgw which is map of objects.
The map key is used to identify required subnets.
Each object contains route configuration.
Right now I'm creating a new route in the private and public subnets.
Not sure if this can be useful also for the transit_gateway and / or core_network subnets.
It is fair to mention that there is one limitation of this variable - one cannot create more routes per a subnet.
Not sure how to achieve it without too much changes.

data.tf Outdated Show resolved Hide resolved
@findmyname666 findmyname666 force-pushed the support_additional_routes branch 2 times, most recently from 0a029fb to fd017d0 Compare June 7, 2023 11:05
Adding a new variable custom_route_to_tgw which is map of objects.
The map key is used to identify required subnets.
Each object contains route configuration.
Right now I'm creating a new route in the private and public subnets.
Not sure if this can be useful also for the transit_gateway and / or core_network subnets.
It is fair to mention that there is one limitation of this variable - one cannot create more routes per a subnet.
Not sure how to achieve it without too much changes.
@findmyname666 findmyname666 force-pushed the support_additional_routes branch from fd017d0 to b9e2465 Compare July 27, 2023 15:11
@findmyname666
Copy link
Author

I found a better solution in #128.

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

Successfully merging this pull request may close these issues.

2 participants