aws-ia / terraform-aws-vpc

AWS VPC Module
https://registry.terraform.io/modules/aws-ia/vpc/aws/latest
Apache License 2.0
92 stars 98 forks source link

TGW attachment without dedicated subnets #141

Open defiant214 opened 9 months ago

defiant214 commented 9 months ago

Is it possible to use this module to create a VPC and attach to a transit gateway without having dedicated transit gateway subnets? For example, if I wanted a simple 2-AZ VPC with just a private subnet in each AZ. The TGW ENI would just be in each private subnet.

Thanks in advance.

drewmullen commented 9 months ago

Hi @defiant214 Thanks for opening this question!

This module does not allow that. Best practice is to have a dedicated tgw subnet so we have designed around that aws recommendation.

To accomplish your goal using this module you can call to build your VPC as normal then create the attachment using the output values

I hope this helps!

defiant214 commented 9 months ago

@drewmullen thanks! I figured as much, but figured I'd ask.