Skip to content

fix(route53): correct traffic policy behavior (#27767) #42365

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Dhruvin1
Copy link

Description

This PR enhances the aws_route53_traffic_policy resource to properly support versioning when updating traffic policy documents. Previously, updates to the traffic policy document would overwrite existing versions rather than creating a new version as expected. This change ensures that when a traffic policy document is modified, a new version is created while preserving previous versions, aligning with AWS Route53 API behavior and user expectations.

Relations

Closes #27767

References

  • AWS Route53 API documentation on CreateTrafficPolicyVersion
  • AWS Route53 behavior maintains historical versions of traffic policies which this PR now correctly models

Output from Acceptance Testing

% make testacc TESTS=TestAccRoute53TrafficPolicy_updateDocument PKG=route53
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/route53/... -v -count 1 -parallel 20 -run=TestAccRoute53TrafficPolicy_updateDocument -timeout 360m
2025/04/24 15:28:42 Initializing Terraform AWS Provider...
=== RUN   TestAccRoute53TrafficPolicy_updateDocument
=== PAUSE TestAccRoute53TrafficPolicy_updateDocument
=== CONT  TestAccRoute53TrafficPolicy_updateDocument
--- PASS: TestAccRoute53TrafficPolicy_updateDocument (19.19s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/route53	23.751s


### Credits
Credit to @IamEnTm for the original fork and implementation of the versioned update approach.
This PR is being submitted on behalf of Palo Alto Networks CDSS DNS Security team, where the issue was reproduced, fixed and validated.

@Dhruvin1 Dhruvin1 requested a review from a team as a code owner April 24, 2025 20:29
Copy link

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

⚠️ We've detected the following potential issues with your pull request

Unneccessary Changelog Changes

The CHANGELOG.md file contents are handled by the maintainers during merge. This is to prevent pull request merge conflicts, especially for contributions which may not be merged immediately. Please see the Changelog Process section of the contributing guide for additional information.

Remove any changes to the CHANGELOG.md file and commit them in this pull request to prevent delays with reviewing and potentially merging it.

Changelog Entry Required

The proposed change requires a changelog entry. Please see the Changelog Process section of the contributing guide for information on the changelog generation process.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/route53 Issues and PRs that pertain to the route53 service. provider Pertains to the provider itself, rather than any interaction with AWS. size/M Managed by automation to categorize the size of a PR. labels Apr 24, 2025
@Dhruvin1
Copy link
Author

Hi, can anyone please review this merge request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. needs-triage Waiting for first response or review from a maintainer. provider Pertains to the provider itself, rather than any interaction with AWS. service/route53 Issues and PRs that pertain to the route53 service. size/M 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.

[Bug]: Impossible to update traffic policy
1 participant