Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accepter incorrectly maps routes to subnets #70

Open
mattcasiro opened this issue Mar 10, 2023 · 2 comments
Open

Accepter incorrectly maps routes to subnets #70

mattcasiro opened this issue Mar 10, 2023 · 2 comments
Labels
bug 🐛 An issue with the system

Comments

@mattcasiro
Copy link

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

When calculating the local value accepter_aws_rt_map the try condition always fails to default because it's attempting to access a set value using an index which is not possible.

Expected Behavior

The try condition properly accesses the set values when available to correctly build the map.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create a VPC with multiple route tables attached to different subnets as the accepter
  2. Run the terraform module with accepted and requester
  3. See that only one route table is mapped to the peering connection

Screenshots

If applicable, add screenshots or logs to help explain your problem.

Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:

  • Terraform Version 0.13
  • AWS Provider Version 4.0

Additional Context

Wrapping the set value in "tolist()" should resolve this, but I have yet to fully validate this solution.

@mattcasiro mattcasiro added the bug 🐛 An issue with the system label Mar 10, 2023
@mattcasiro
Copy link
Author

Upgrading from tf 0.13 to tf 0.14 seems to have fixed this, as a workaround. I can't find the actual documentation that explains why this would be the case though, so there's a chance I'm missing something.

@mattcasiro
Copy link
Author

Correction on the above. The actual fix was the upgrade from AWS provider 3.x to 4.x. In provider 3.x the ids attribute on the aws_route_tables data source is a set. On 4.x it's a list. This is why adding tolist() should resolve it, providing backwards compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

No branches or pull requests

1 participant