-
Notifications
You must be signed in to change notification settings - Fork 96
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
[DXE-4099] akamai_dns_record does not handle DNS targets greater than 255 characters when using JSON instead of HCL #572
Comments
Hello @brucep-care , Thank you for creating this ticket. Best regards, |
@PawelSnoch If I delete and recreate my .tfstate file I'm still able to easily reproduce this. In fact if I delete absolutely everything and start from scratch then it's easy for me to reproduce.
So care.tf.json is the only file in my test directory. Its contents are identical to the JSON I posted in the initial report. I then do the following:
So at this point my care.tf.json file exactly matches the current DNS record. If I then modify the care.tf.json file by changing
If I edit care.tf.json further by removing the
|
@brucep-care , thank you for adding more details. I need to know how you created your zone with recordset. Did you use terraform or another option? |
@PawelSnoch How the zone was created shouldn't matter at all. We've had this zone hosted by Akamai for close to ten years now, long before we started working with terraform. We've backported this zone and many other resources into terraform. |
@brucep-care, It looks like the problem is caused by an incorrect order of DNS targets in the json file. With the same order as in the HCL example, the problem shouldn't happen. |
@FilipAntkowiak reordering target list in the json isn't a viable solution. It would require us to compare this JSON with the HCL every time we make a change, and we're not using HCL at all in our environment. That would be not trivial when dealing with many dozens of records across multiple zones. Given the provider will accept the target list in any order and appears to successfully apply them (as far as terraform is concerned) I would expect the provider to re-order the targets if necessary. |
The terraform provider does not handle DNS targets properly when two conditions are met:
Terraform and Akamai Terraform Provider Versions
Affected Resource(s)
Terraform Configuration Files
HCL configuration:
JSON configuration
Expected Behavior
Using either of the above input flies,
terraform plan
will report no changes to be made. Edit both files and change one of the target values (such asMS=ms24770002-test
) and runterraform plan
again. The expected behavior is both the HCL and JSON inputs would want to change that one data record.Actual Behavior
Modifying the HCL and running
terraform plan
works as expected. It reports that only theMS
data is to be updated:However modifying the JSON and running
terraform plan
results in unexpected changes:Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform import
the recordterraform plan
Important Factoids
In my testing it appears the issue revolves around our SPF record, which is greater than 255 characters, so it is split into multiple quoted strings. In the JSON file it is this record:
"\"v=spf1 ip4:208.118.226.0/26 include:servers.mcsv.net include:spf.mandrillapp.com include:mg-spf.greenhouse.io include:spf.protection.outlook.com include:_spf.salesforce.com\" \" include:mail.zendesk.com include:_spf.atlassian.net include:318630.spf01.hubspotemail.net ~all\"",
If I delete this record as well as making the other changes then
terraform plan
output looks correct.References
The text was updated successfully, but these errors were encountered: