How to split / quote TXT-records correctly? / possible quoting issue
ppuschmann opened this issue · 1 comments
Hi there,
I'm trying to configure longer TXT-records like this:
resource "infoblox_txt_record" "rd__domainkey_example_com_TXT_1" {
comment = "managed by TF"
dns_view = "MyView"
fqdn = "rd._domainkey.example.com"
text = "\"v=DKIM1; p=MIIBIjv/v/g+Nn/ZIp161m2/Eeh\" \"Te9TbwgtNf/eZhVC0+g+9bBQQcAe676/0XjSeqN/g/g/gRPX7/Q/b+h\""
ttl = 3600
}
I then always get this diff with terraform plan
or terraform apply
:
# infoblox_txt_record.rd__domainkey_example_com_TXT_1 will be updated in-place
~ resource "infoblox_txt_record" "rd__domainkey_example_com_TXT_1" {
id = "record:txt/<some-id>:rd._domainkey.example.com/MyView"
~ text = "\"v=DKIM1; p=MIIBIjv/v/g+Nn/ZIp161m2/Eeh\" Te9TbwgtNf/eZhVC0+g+9bBQQcAe676/0XjSeqN/g/g/gRPX7/Q/b+h" -> "\"v=DKIM1; p=MIIBIjv/v/g+Nn/ZIp161m2/Eeh\" \"Te9TbwgtNf/eZhVC0+g+9bBQQcAe676/0XjSeqN/g/g/gRPX7/Q/b+h\""
# (4 unchanged attributes hidden)
}
which is:
"\"v=DKIM1; p=MIIBIjv/v/g+Nn/ZIp161m2/Eeh\" Te9TbwgtNf/eZhVC0+g+9bBQQcAe676/0XjSeqN/g/g/gRPX7/Q/b+h"
against
"\"v=DKIM1; p=MIIBIjv/v/g+Nn/ZIp161m2/Eeh\" \"Te9TbwgtNf/eZhVC0+g+9bBQQcAe676/0XjSeqN/g/g/gRPX7/Q/b+h\""
Setting the desired value via the web-interface show, that only the first block is quoted:
Which leads to the conclusion that there might be a bug in our Infoblox version or do I really have to split the TXT-record into multiple records like the documentation suggests?
The actual Question is: how can I solve this? Is there any workaround?
Current environment:
- macOS, arm64 with Terraform 1.8.0 using infobloxopen/infoblox v2.4.1
- Infoblox 9.0.3
For readers of this: "Of course" the original problem is the character-limit of 255 characters per entry in TXT-records.
So the orginal example should be:
resource "infoblox_txt_record" "rd__domainkey_example_com_TXT_1" {
comment = "managed by TF"
dns_view = "MyView"
fqdn = "rd._domainkey.example.com"
text = "\"<first-255-characters>\" \"<second-255-characters>\""
ttl = 3600
}
Reading some documentation I found out that other DNS server do this:
<first-255-characters><second-255-characters>
It turns out that this is the way Infoblox wants to have a separation of the single 255 character chunks:
<first-255-characters> <second-255-characters>
resource "infoblox_txt_record" "rd__domainkey_example_com_TXT_1" {
comment = "managed by TF"
dns_view = "MyView"
fqdn = "rd._domainkey.example.com"
text = <first-255-characters> <second-255-characters>
ttl = 3600
}
--> Mind the space.