From c7be1ff1e024d0aeb969c4cfeff0d433c3b9708c Mon Sep 17 00:00:00 2001 From: Alex Trepanier Date: Fri, 17 May 2024 10:08:39 -0400 Subject: [PATCH] feat: Add support for maximum number of NAT Gateways --- README.md | 1 + main.tf | 1 + variables.tf | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/README.md b/README.md index a4a90a1..af58ced 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ module "network" { | [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no | | [subnets\_availability\_zones](#input\_subnets\_availability\_zones) | Availability zones for the subnets. | `list(string)` |
[
"us-east-1a",
"us-east-1b"
]
| no | | [subnets\_ipv4\_cidr\_block](#input\_subnets\_ipv4\_cidr\_block) | IPv4 CIDR Block for the subnets. | `list(string)` |
[
"10.0.0.0/16"
]
| no | +| [subnets\_max\_nats](#input\_subnets\_max\_nats) | Upper limit on number of NAT Gateways/Instances to create. Set to 1 or 2 for cost savings at the expense of availability. | `number` | `999` | no | | [subnets\_nat\_gateway\_enabled](#input\_subnets\_nat\_gateway\_enabled) | Set to `true` to create a nat gateway in each subnet. | `bool` | `false` | no | | [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).
Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no | | [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no | diff --git a/main.tf b/main.tf index 77850b1..c0717af 100644 --- a/main.tf +++ b/main.tf @@ -22,6 +22,7 @@ module "subnets" { ipv4_cidr_block = var.subnets_ipv4_cidr_block availability_zones = var.subnets_availability_zones nat_gateway_enabled = var.subnets_nat_gateway_enabled + max_nats = var.subnets_max_nats context = module.this.context } diff --git a/variables.tf b/variables.tf index 158290c..29c6541 100644 --- a/variables.tf +++ b/variables.tf @@ -22,8 +22,15 @@ variable "subnets_nat_gateway_enabled" { description = "Set to `true` to create a nat gateway in each subnet." } +variable "subnets_max_nats" { + type = number + default = 999 + description = "Upper limit on number of NAT Gateways/Instances to create. Set to 1 or 2 for cost savings at the expense of availability." +} + variable "s3_endpoint_enabled" { type = bool default = false description = "Set to `true` to create a VPC gateway endpoint for S3." } +