aws-ia / terraform-aws-vpc

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

Multiple public subnets provisioning #119

Open pielu opened 1 year ago

pielu commented 1 year ago

Hello,

There seem to be no way to provision multiple public subnets. This functionality is useful for many use cases, having security (firewall) subnets being one of them. The public subnet code technically iterates over public subnet(s) but it's iterating keys and public is protected key and cannot be used more than once.

drewmullen commented 1 year ago

Hi! thanks for opening this issue! you are correct that we lock down the module to only define 1 set of public subnets using protected keys. ATM we do not have any intention of allowing additional public subnet definitions.

However, I believe the use case you mentioned is one we have considered and planned for using our network firewall module. Here is an example: https://github.com/aws-ia/terraform-aws-networkfirewall/blob/main/examples/central_inspection_with_egress/main.tf

Please let me know if you think that will solve the use case you mentioned!

pielu commented 1 year ago

Hi! Thanks for coming back so quickly. Yes I have looked at it and in the central firewall architecture that would work. I had a feeling implementing multiple public subnets right now would be a rather ordeal and quite a refactor to the module itself. I have worked around this in my wrapper module, no problem. Just wanted to signal a use case that might be somewhat of a niche. Again, thank you for considering it.