From d7389da98c8e47cc698b10a09874070cb8f8b512 Mon Sep 17 00:00:00 2001 From: Jarod Date: Mon, 13 Feb 2023 16:20:56 +0100 Subject: [PATCH 1/2] Fix: Using IPv6 with 'vpc_attachments[].vpc_route_table_ids' fails --- main.tf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.tf b/main.tf index 600e26e..458917a 100644 --- a/main.tf +++ b/main.tf @@ -111,9 +111,10 @@ resource "aws_ec2_transit_gateway_route" "this" { resource "aws_route" "this" { for_each = { for x in local.vpc_route_table_destination_cidr : x.rtb_id => x.cidr } - route_table_id = each.key - destination_cidr_block = each.value - transit_gateway_id = aws_ec2_transit_gateway.this[0].id + route_table_id = each.key + destination_cidr_block = try(each.value.ipv6_support, false) ? null : each.value + destination_ipv6_cidr_block = try(each.value.ipv6_support, false) ? each.value : null + transit_gateway_id = aws_ec2_transit_gateway.this[0].id } resource "aws_ec2_transit_gateway_route_table_association" "this" { From 1eb0daab0d3073002414f057330b47f2fa048db2 Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Mon, 11 Dec 2023 08:52:20 -0500 Subject: [PATCH 2/2] Update main.tf --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 2fb68f4..0f642b9 100644 --- a/main.tf +++ b/main.tf @@ -119,7 +119,7 @@ resource "aws_route" "this" { route_table_id = each.key destination_cidr_block = try(each.value.ipv6_support, false) ? null : each.value["cidr"] destination_ipv6_cidr_block = try(each.value.ipv6_support, false) ? each.value["cidr"] : null - transit_gateway_id = aws_ec2_transit_gateway.this[0].id + transit_gateway_id = each.value["tgw_id"] } resource "aws_ec2_transit_gateway_route_table_association" "this" {