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

EdgeDNS TXT record trimmed #537

Closed
izzm opened this issue Mar 26, 2024 · 2 comments
Closed

EdgeDNS TXT record trimmed #537

izzm opened this issue Mar 26, 2024 · 2 comments

Comments

@izzm
Copy link

izzm commented Mar 26, 2024

Hi there,

After upgrading to version 5.5+, I discovered a change in the behavior of creating TXT records containing semicolons and spaces.

Terraform Version

Terraform v1.6.6
on darwin_arm64
+ provider registry.terraform.io/akamai/akamai v6.0.0

Affected Resource(s)

  • akamai_dns_record

Terraform Configuration Files

resource "akamai_dns_record" "this" {
  name        = "test.example.com"
  recordtype  = "TXT"
  target      = [
      "a=test b=1",
      "a=test; b=2",
      ";a=test b=3",
  ]
  ttl         = 3600
  zone    = "example.com"
}

Expected Behavior

TXT records are created as they present in configuration

Actual Behavior

TXT records are trimmed after semicolon and spaces are escaped with double quotes.

Screenshot 2024-03-26 at 22 01 27

Second terraform apply run produces plan with:

~ target     = [
  - "\"\"",
  + "a=test b=1",
    "a=test; b=2",
  - "\"a=test\" \"b=1\"",
  + ";a=test b=3",
]

Steps to Reproduce

  1. terraform apply
  2. verify record at https://control.akamai.com

Related issues

#430

@mimazaka
Copy link
Contributor

mimazaka commented Mar 27, 2024

Hi @izzm ,

Thank you for rising this ticket. I was able to reproduce trimming behavior, but it seemed to work as designed. In order to avoid trimming after space or semicolon, you have to provide additional \" at the begging and end of target eg. "\"a=test b=1\"".

For full explanation of trimming txt record after escaping characters please refer to RFC 1035 for quoting details (Page 34,35).

Best regards,

@izzm
Copy link
Author

izzm commented Mar 27, 2024

Hi @mimazaka ,

Thank you, additional \" fixed the problem.

@izzm izzm closed this as completed Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants