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

[Bug]: aws_route53_zone is sorting name_servers #28430

Open
batkuip opened this issue Dec 16, 2022 · 1 comment
Open

[Bug]: aws_route53_zone is sorting name_servers #28430

batkuip opened this issue Dec 16, 2022 · 1 comment
Labels
bug Addresses a defect in current functionality. service/route53 Issues and PRs that pertain to the route53 service.

Comments

@batkuip
Copy link

batkuip commented Dec 16, 2022

Terraform Core Version

1.3.6

AWS Provider Version

4.47

Affected Resource(s)

  • aws_route53_zone

Expected Behavior

The attribute name_servers order matches order in NS record.

Actual Behavior

It's explicitly sorting the name_servers:
https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/route53/zone.go#L229

This is problematic with (from my use case)

  • Certain DNS clients rely on the order.
  • Linking to aws_route53domains_registered_domain. esp for existing records as it will now want to re-order the names-servers.

Relevant Error/Panic Output Snippet

~ resource "aws_route53domains_registered_domain" "this" {
      ~ name_server {
          ~ name     = "ns-1546.awsdns-01.co.uk" -> "ns-1417.awsdns-49.org"
            # (1 unchanged attribute hidden)
        }
      ~ name_server {
          ~ name     = "ns-99.awsdns-12.com" -> "ns-1546.awsdns-01.co.uk"
            # (1 unchanged attribute hidden)
        }
      ~ name_server {
          ~ name     = "ns-1417.awsdns-49.org" -> "ns-585.awsdns-09.net"
            # (1 unchanged attribute hidden)
        }
      ~ name_server {
          ~ name     = "ns-585.awsdns-09.net" -> "ns-99.awsdns-12.com"
            # (1 unchanged attribute hidden)
        }
}
### Terraform Configuration Files

resource "aws_route53_zone" "this" {
  name = "my_existing_domain.com"
}

resource "aws_route53domains_registered_domain" "this" {
  domain_name = aws_route53_zone.this.name

  dynamic "name_server" {
    for_each = toset(aws_route53_zone.this.name_servers)
    content {
      name = name_server.value
    }
  }
}

Steps to Reproduce

terraform import aws_route53_zone.this 1234
terraform apply

Debug Output

No response

Panic Output

No response

Important Factoids

It's been raised multiple times and fixed for various use cases. Sorting is still there unfortunately. Why does this list need to be sorted explicitly?

References

#21965
#3447

Would you like to implement a fix?

None

@batkuip batkuip added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Dec 16, 2022
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added service/route53 Issues and PRs that pertain to the route53 service. service/route53domains Issues and PRs that pertain to the route53domains service. labels Dec 16, 2022
@justinretzolk justinretzolk removed service/route53domains Issues and PRs that pertain to the route53domains service. needs-triage Waiting for first response or review from a maintainer. labels Jan 19, 2023
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/route53 Issues and PRs that pertain to the route53 service.
Projects
None yet
Development

No branches or pull requests

2 participants