Commit b253c94c authored by Anton Babenko's avatar Anton Babenko

Fixed opportunity to create the vpc, vpn gateway routes (bug during upgrade to 0.12)

parent c28b5af1
......@@ -248,7 +248,7 @@ resource "aws_route_table" "intra" {
# Public subnet
################
resource "aws_subnet" "public" {
count = var.create_vpc && length(var.public_subnets) > 0 && false == var.one_nat_gateway_per_az || length(var.public_subnets) >= length(var.azs) ? length(var.public_subnets) : 0
count = var.create_vpc && length(var.public_subnets) > 0 && (false == 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 = element(concat(var.public_subnets, [""]), count.index)
......@@ -1382,7 +1382,7 @@ resource "aws_vpn_gateway_attachment" "this" {
}
resource "aws_vpn_gateway_route_propagation" "public" {
count = var.create_vpc && var.propagate_public_route_tables_vgw && var.enable_vpn_gateway || var.vpn_gateway_id != "" ? 1 : 0
count = var.create_vpc && var.propagate_public_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != "") ? 1 : 0
route_table_id = element(aws_route_table.public.*.id, count.index)
vpn_gateway_id = element(
......@@ -1395,7 +1395,7 @@ resource "aws_vpn_gateway_route_propagation" "public" {
}
resource "aws_vpn_gateway_route_propagation" "private" {
count = var.create_vpc && var.propagate_private_route_tables_vgw && var.enable_vpn_gateway || var.vpn_gateway_id != "" ? length(var.private_subnets) : 0
count = var.create_vpc && var.propagate_private_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != "") ? length(var.private_subnets) : 0
route_table_id = element(aws_route_table.private.*.id, count.index)
vpn_gateway_id = element(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment