hashicorp/terraform-provider-aws

Route53 doesn't validate TXT record lengths

Open

#14,941 opened on Sep 1, 2020

 (11 comments) (40 reactions) (0 assignees)Go (10,312 forks)github user discovery
buggood first issueservice/route53

Repository metrics

Stars
 (11,045 stars)
PR merge metrics
 (Avg merge 19d 21h) (251 merged PRs in 30d)

Description

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.13.1

Affected Resource(s)

  • aws_route53_record

Terraform Configuration Files


resource "aws_route53_record" "google_mail_dkim2" {
  zone_id = aws_route53_zone.segmed_ai.zone_id
  name = "google._domainkey"
  type = "TXT"
  ttl = "1799"
  records = [
    "v=DKIM1; k=rsa; p=verylongthinggoes........................................................................................................................................................................................................................................................................here"
  ]
}

Debug Output

Panic Output

[ERR]: Error building changeset: InvalidChangeBatch: [Invalid Resource Record: FATAL problem: CharacterStringTooLong (Value is too long) encountered with '"v=DKIM1; k=rsa; p=MIIBIjANBgkqhRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRrRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR_very_long_string"'] status code: 400, request id: 1f3fcfb0-344a-4b66-adbd-a40788df8990

Expected Behavior

Since 255 length limit is known, I'd expect terraform plan to warn me about a domain name that is too long, so that my GitOps "prep" stage could fail.

Actual Behavior

terraform plan is OK with very long domains. terraform apply crashes.

Steps to Reproduce

  1. Take a DNS block from above. The idea is that you should attempt to make a very long (400characters+) long TXT record, which is popular in DKIM settings.
  2. Run terraform plan and see it succeed.
  3. Run terraform apply and see it crash with CharacterStringTooLong error

Important Factoids

References

  • #0000

Contributor guide