Closed hightoxicity closed 9 months ago
In other term for which reason are you trimming double quotes here?
case RRTypeTxt:
logger.Debugf("Bind TXT Data IN: [%s]", recContentStr)
recContentStr = strings.Trim(recContentStr, `"`)
recContentStr = txtRecordEscape(recContentStr)
logger.Debugf("Bind TXT Data %s", recContentStr)
logger.Debugf("Bind TXT Data OUT: [%s]", recContentStr)
records = append(records, recContentStr)
Thx
Thank you for rising this issue. We will investigate and update once we have some details.
You may be interested by the WIP to try to deal with this: https://github.com/hightoxicity/terraform-provider-akamai/tree/v4.1.0-safer-double-quotes-trim
I may not have understood what it should do or what is expected as behaviour:
If you can share some specs about this, I may help.
Hi, any update here?
Thx
Hi @hightoxicity,
Fix for this issue will be a part for upcoming release.
BR, Lukasz
Hi @hightoxicity,
Fix for this issue will be a part for upcoming release.
BR, Lukasz
Where can we see the upcoming changes that will be merged into next release? I mean are you about to integrate my changes or do you have made your own fix and in such case do you have a link to the relative commits?
Thx
Hi @hightoxicity,
Unfortunately, there is no place that we can share with you to see the upcoming changes. All changes (commits) will be available after release.
BR, Lukasz
Hi @lsadlon
The underlying issue here also prevented managing TXT records with length > 255 chars in terraform, not just the terraform import of it. Can we assume that the upcoming release will allow managing the long (> 255 chars) TXT records in terraform as well?
BR, Sriraam
Hi @sriraamas
Yes, fix is in general for handling record with length > 255 chars, not just import.
BR, Lukasz
This issue should be fixed now with Akamai Terraform Provider 5.5.0 release.
Hi there,
Conforming https://community.akamai.com/customers/s/article/How-to-set-TXT-or-SPF-record-longer-than-255-bytes-in-Authoritative-DNS?language=en_US
We have an SPF record larger than 255 that has been created in the past into the gui following previous guide and setting this exact value:
"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmMZAR79x/6UHyyz6INnpuDC0dAMXUqcF6xE4a0nRN8R9FXfGRYhUHIOLCYTtj0PBG39A82lQAb/IB8epeEHkiJBye7/X8Khf4NsuQd2mkJuBgmSGsDXRI9evWE7+LcyxJaiZK/qKBAzVx37iZtbw7KhKimXhq+UztjmkVJ4qTIEkqa1z467Fw3Yyrr70JDv" "0aorve7Fs94v4Lr4/NTWHi7wVLUHl6TpBhqfJir7xVupeMLCcm2pbKkMd8eyeDDhYcrKTnubiuNGO/hqw7Sjt6WoVo8srz3+cvkEPzQbw0NRN4MVUTkcr4XGQjl3C2XSD7Gmtvjrm7sPuvdYtCADGJQIDAQAB\010"
You can find the concerning record here:
But fact is that when we use:
TF_LOG=debug terraform import -var-file=tfvars/production/env.tfvars -var-file=tfvars/production/zones.tfvars 'akamai_dns_record.ak-txt-records["springcmcontracts.com#google._domainkey.springcmcontracts.com"]' "springcmcontracts.com#google._domainkey.springcmcontracts.com#TXT"
We can see there something that is populating a strange value in the state... And this is what we see in the console on the import:
` - .target[0]: was cty.StringVal("\"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmMZAR79x/6UHyyz6INnpuDC0dAMXUqcF6xE4a0nRN8R9FXfGRYhUHIOLCYTtj0PBG39A82lQAb/IB8epeEHkiJBye7/X8Khf4NsuQd2mkJuBgmSGsDXRI9evWE7+LcyxJaiZK/qKBAzVx37iZtbw7KhKimXhq+UztjmkVJ4qTIEkqa1z467Fw3Yyrr70JDv\" \"0aorve7Fs94v4Lr4/NTWHi7wVLUHl6TpBhqfJir7xVupeMLCcm2pbKkMd8eyeDDhYcrKTnubiuNGO/hqw7Sjt6WoVo8srz3+cvkEPzQbw0NRN4MVUTkcr4XGQjl3C2XSD7Gmtvjrm7sPuvdYtCADGJQIDAQAB\010\""), but now cty.StringVal("v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmMZAR79x/6UHyyz6INnpuDC0dAMXUqcF6xE4a0nRN8R9FXfGRYhUHIOLCYTtj0PBG39A82lQAb/IB8epeEHkiJBye7/X8Khf4NsuQd2mkJuBgmSGsDXRI9evWE7+LcyxJaiZK/qKBAzVx37iZtbw7KhKimXhq+UztjmkVJ4qTIEkqa1z467Fw3Yyrr70JDv\" \"0aorve7Fs94v4Lr4/NTWHi7wVLUHl6TpBhqfJir7xVupeMLCcm2pbKkMd8eyeDDhYcrKTnubiuNGO/hqw7Sjt6WoVo8srz3+cvkEPzQbw0NRN4MVUTkcr4XGQjl3C2XSD7Gmtvjrm7sPuvdYtCADGJQIDAQAB\010")
This break the first double quote and the last one for some strange reason (which one, I do not know) but fact is that it is not looking what you explain into the above guide.
Here is the populated record into the state:
I think both the value and the computed sha1 are wrong into the state json file...
Terraform Version
1.5.0
Affected Resource(s)