Skip to content

Conversation

seneka-DSNA
Copy link

Changes to Security Controls

  • There shouldn't be.

Description

  • This PR fixes a bug where aws_route53_resolver_endpoint.ip_address (previously a TypeSet) deduplicated multiple auto-assigned IPs in the same subnet because the hash relied on an empty ip value. The fix switches the attribute to a TypeList and adds SchemaVersion: 1 plus a state upgrader to migrate existing state across versions.

Relations

Closes #43724

Output from Acceptance Testing

-I also added an acceptance test to cover this scenario, since existing tests didn’t exercise it. The test creates 3+3 auto-assigned IPs across two subnets (ip_address.# == 6) and verifies update behavior. This is split into a separate commit from the code change.

-Here is the output of the test:
make testacc PKG=route53resolver TESTS='^TestAccRoute53ResolverEndpoint_multipleIPsPerSubnet_auto$'1
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.6 test ./internal/service/route53resolver/... -v -count 1 -parallel 20 -run='^TestAccRoute53ResolverEndpoint_multipleIPsPerSubnet_auto' -timeout 360m -vet=off
2025/08/22 16:09:24 Creating Terraform AWS Provider (SDKv2-style)...
2025/08/22 16:09:24 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN TestAccRoute53ResolverEndpoint_multipleIPsPerSubnet_auto
=== PAUSE TestAccRoute53ResolverEndpoint_multipleIPsPerSubnet_auto
=== CONT TestAccRoute53ResolverEndpoint_multipleIPsPerSubnet_auto
--- PASS: TestAccRoute53ResolverEndpoint_multipleIPsPerSubnet_auto (322.77s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/route53resolver 322.927s

Comments

  • Hi! I'm an IT student and I probably made a few mistakes while working on this bug fix, so I really appreciate any feedback on my code or PR. I’m looking forward to your reply and I’m happy to fix anything I might have missed. Thanks!

… switching ip_address from Set to List and adding state upgrader

Signed-off-by: Alejandro <[email protected]>
@seneka-DSNA seneka-DSNA requested a review from a team as a code owner August 22, 2025 14:29
Copy link
Contributor

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

Copy link
Contributor

github-actions bot commented Aug 22, 2025

✅ Thank you for correcting the previously detected issues! The maintainers appreciate your efforts to make the review process as smooth as possible.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/route53resolver Issues and PRs that pertain to the route53resolver service. size/L Managed by automation to categorize the size of a PR. labels Aug 22, 2025
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/route53resolver Issues and PRs that pertain to the route53resolver service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Route53 Resolver Endpoint Hash Function Prevents Multiple IPs per Subnet When IP Address is Auto-Assigned
2 participants