terraform-aws-modules / terraform-aws-transit-gateway

Terraform module to create AWS Transit Gateway resources 🇺🇦

Home Page:https://registry.terraform.io/modules/terraform-aws-modules/transit-gateway/aws

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using IPv6 with `vpc_attachments[].vpc_route_table_ids` fails

Jarodiv opened this issue · comments

Description

The module generally supports the use of IPv6. But when adding routes to the tables provided via vpc_attachments[].vpc_route_table_ids, it always tries to assign the vpc_attachments[].tgw_destination_cidr to the IPv4 aws_route.destination_cidr_block argument. Correct would be using aws_route.destination_cidr_block for IPv4 and aws_route.destination_ipv6_cidr_block for IPv6.

  • ✋ I have searched the open/closed issues and my issue is not listed.

Versions

  • Module version [Required]: 2.8.2
  • Terraform version:
    Terraform v1.3.7
    on darwin_arm64
    
  • Provider version(s):
    provider registry.terraform.io/hashicorp/aws v4.46.0
    

Reproduction Code [Required]

Everything it needs is to configure IPv6 and provide VPC Route Tables:

module "my_vpc_ipv6" {
  source  = "terraform-aws-modules/vpc/aws"
  version = "~> 3.0"

  name = "my-vpc-ipv6"
  cidr = "10.1.0.0/16"

  azs             = ["${local.region}a", "${local.region}b"]
  private_subnets = ["10.1.1.0/24", "10.1.2.0/24"]
  public_subnets  = ["10.1.101.0/24", "10.1.102.0/24"]

  enable_nat_gateway = false

  enable_ipv6                     = true
  assign_ipv6_address_on_creation = true

  private_subnet_assign_ipv6_address_on_creation = false

  public_subnet_ipv6_prefixes  = [0, 1]
  private_subnet_ipv6_prefixes = [2, 3]
}

module "my_tgw_ipv6" {
  source  = "terraform-aws-modules/transit-gateway/aws"
  version = "~> 2.0"

  name = "my-tgw-ipv6"

  vpc_attachments = {
    vpc = {
      vpc_id     = module.my_vpc_ipv6.vpc_id
      subnet_ids = module.my_vpc_ipv6.private_subnets

      ipv6_support         = true
      tgw_destination_cidr = "::/0"
      vpc_route_table_ids  = module.my_vpc_ipv6.private_route_table_ids
    },
  }
}

Expected behavior

The code runs and IPv6 routes are being created.

Actual behavior

The code would fails because of issue #100, but else it would fail, trying to assign an IPv6 CIDR to the IPv4 aws_route.destination_cidr_block instead of using its IPv6 counterpart aws_route.destination_ipv6_cidr_block.

This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days

Cannot remove the label, so need to comment in order to prevent this issue from being closed.

This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days

"Keep alive" post

This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days

This issue was automatically closed because of stale in 10 days

Any way to re-ope this issue? The issue still exists and the PR fixing it is still not merged

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

This issue has been resolved in version 2.12.1 🎉