cloudposse / terraform-aws-vpc-peering-multi-account

Terraform module to provision a VPC peering across multiple VPCs in different accounts by using multiple providers
https://cloudposse.com/accelerate
Apache License 2.0
129 stars 92 forks source link

"IPv6 communication over VPC peering" PR broke module functionality without IPv6 specified #103

Open adziura-ledger opened 1 week ago

adziura-ledger commented 1 week ago

Describe the Bug

When you don't have IPv6 cidr specified for VPC module will not work because of this change data.aws_vpc.requester[*].ipv6_cidr_block returns list with one empty element, and length will be always > 0 same for accepter Changes introduced in PR #101

Expected Behavior

No changes if IPv6 CIDRs not defined.

Steps to Reproduce

Apply module (starting from version 0.20.1) for VPCs without IPv6 CIDRs defined.

Screenshots

No response

Environment

No response

Additional Context

No response

NathanBaulch commented 5 days ago

This also broke my ipv6-less VPC deployment with:

│ Error: "" is not a valid CIDR block: invalid CIDR address:
│
│   with module.peering.aws_route.accepter_ipv6[0],
│   on .terraform\modules\peering\accepter.tf line 128, in resource "aws_route" "accepter_ipv6":
│  128:   destination_ipv6_cidr_block = local.requester_ipv6_cidr_block_associations[count.index % local.requester_ipv6_cidr_block_associations_count]["cidr_block"]

Downgrading to v0.20.0 for now.