RaJiska / terraform-aws-fck-nat

Terraform module for fck-nat
https://registry.terraform.io/modules/RaJiska/fck-nat/aws/latest
MIT License
74 stars 38 forks source link

Architecture #2

Closed havedill closed 12 months ago

havedill commented 12 months ago

Hello, I'm new to nat instances.

Is the intention with this module, to have 1 module per subnet/AZ in a VPC?

I notice the variables for route table ID's and subnet id's are of type string, and not list. So im thinking i'd need one fck-nat per AZ?

For the HA option - is that HA in the single AZ?

RaJiska commented 12 months ago

Hi!

The intention is to have at least one NAT instance within the VPC. A user may wish to use a single NAT for every availability zone, one NAT per AZ, or multiple NAT per AZ, depending of the usage.

One instance of this module represents one NAT instance.

As you noticed, the route table is a string rather than a list, which indeed is not adequate to this vision as one may want to configure their NAT to span across multiple subnets. This has been documented in a different branch, and is planned to be addressed, which would allow one to have the route table of multiple subnets to have the NAT route added.

This module, just like the AWS managed NAT gateway, is a resource tied to a specific subnet (but may be used through different subnets and cross AZ). HA mode provide a degree of high availability within one subnet through an auto scaling group.

Hope it clarifies.

havedill commented 12 months ago

Very informative, thanks a ton!