Skip to content

Commit

Permalink
Pass parameter for NAT to VPC sub-module (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
snovikov authored Jan 26, 2024
1 parent 7828762 commit 40b35cc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ Type: `bool`

Default: `true`

### <a name="input_vpc_one_nat_gateway_per_az"></a> [vpc\_one\_nat\_gateway\_per\_az](#input\_vpc\_one\_nat\_gateway\_per\_az)

Description: Should be true if you want only one NAT Gateway per availability zone. Requires `var.azs` to be set, and the number of `public_subnets` created to be greater than or equal to the number of availability zones specified in `var.azs`

Type: `bool`

Default: `true`

### <a name="input_vpc_reuse_nat_ips"></a> [vpc\_reuse\_nat\_ips](#input\_vpc\_reuse\_nat\_ips)

Description: Should be true if you don't want EIPs to be created for your NAT Gateways and will instead pass them in via the 'external\_nat\_ip\_ids' variable
Expand Down
7 changes: 4 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# VPC Resources
# -------------------------------------------------------------------------------------------------
module "aws_vpc" {
source = "github.com/terraform-aws-modules/terraform-aws-vpc?ref=v5.4.0"
source = "github.com/terraform-aws-modules/terraform-aws-vpc?ref=v5.5.1"

cidr = var.vpc_cidr
azs = var.vpc_subnet_azs
Expand All @@ -18,8 +18,9 @@ module "aws_vpc" {
enable_dns_hostnames = var.vpc_enable_dns_hostnames
enable_dns_support = var.vpc_enable_dns_support

reuse_nat_ips = var.vpc_reuse_nat_ips
external_nat_ip_ids = local.ids_of_eips_for_natgws
one_nat_gateway_per_az = var.vpc_one_nat_gateway_per_az
reuse_nat_ips = var.vpc_reuse_nat_ips
external_nat_ip_ids = local.ids_of_eips_for_natgws

customer_gateways = var.vpc_customer_gateways

Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ variable "vpc_enable_nat_gateway" {
default = true
}

variable "vpc_one_nat_gateway_per_az" {
description = "Should be true if you want only one NAT Gateway per availability zone. Requires `var.azs` to be set, and the number of `public_subnets` created to be greater than or equal to the number of availability zones specified in `var.azs`"
type = bool
default = true
}

variable "vpc_reuse_nat_ips" {
description = "Should be true if you don't want EIPs to be created for your NAT Gateways and will instead pass them in via the 'external_nat_ip_ids' variable"
type = bool
Expand Down

0 comments on commit 40b35cc

Please sign in to comment.