From 67c1e9fc9947b0ebaca413dc49fc0d1e1578f354 Mon Sep 17 00:00:00 2001 From: Anton Babenko Date: Sat, 6 Oct 2018 16:25:18 +0200 Subject: [PATCH] Fixed #177 - public_subnets should not always be validated --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 5a8461042..f09a07e30 100644 --- a/main.tf +++ b/main.tf @@ -161,7 +161,7 @@ resource "aws_subnet" "public" { count = "${var.create_vpc && length(var.public_subnets) > 0 && (!var.one_nat_gateway_per_az || length(var.public_subnets) >= length(var.azs)) ? length(var.public_subnets) : 0}" vpc_id = "${local.vpc_id}" - cidr_block = "${var.public_subnets[count.index]}" + cidr_block = "${element(concat(var.public_subnets, list("")), count.index)}" availability_zone = "${element(var.azs, count.index)}" map_public_ip_on_launch = "${var.map_public_ip_on_launch}"