From d159c9fa1119aabcf190e738e77d90ae265bdd6e Mon Sep 17 00:00:00 2001 From: thaunghtike-share <87596555+thaunghtike-share@users.noreply.github.com> Date: Tue, 19 Sep 2023 01:16:30 +0630 Subject: [PATCH] Rename enable_nat to nat_enabled (#336) * Update private_subnet.tf * Update variables.tf --- private_subnet.tf | 6 +++--- variables.tf | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/private_subnet.tf b/private_subnet.tf index 2bc9065e..66baeb04 100644 --- a/private_subnet.tf +++ b/private_subnet.tf @@ -16,12 +16,12 @@ resource "aws_subnet" "private" { } resource "aws_eip" "eips" { - count = var.enable_nat && length(var.eips) == 0 ? 2 : 0 + count = var.nat_enabled && length(var.eips) == 0 ? 2 : 0 tags = local.tags } resource "aws_nat_gateway" "gw" { - count = var.enable_nat ? 2 : 0 + count = var.nat_enabled ? 2 : 0 allocation_id = length(var.eips) == 0 ? aws_eip.eips[count.index].id : var.eips[count.index].id subnet_id = aws_subnet.public[count.index].id @@ -41,7 +41,7 @@ resource "aws_route_table" "private" { } resource "aws_route" "nat" { - count = var.enable_nat ? 2 : 0 + count = var.nat_enabled ? 2 : 0 route_table_id = aws_route_table.private[count.index].id destination_cidr_block = "0.0.0.0/0" diff --git a/variables.tf b/variables.tf index 7739d728..eea81e04 100644 --- a/variables.tf +++ b/variables.tf @@ -75,7 +75,7 @@ variable "enable_ipv6" { description = "Enable an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC" } -variable "enable_nat" { +variable "nat_enabled" { default = true description = "Whether the NAT gateway is enabled" }