-
Notifications
You must be signed in to change notification settings - Fork 636
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
DNS Records: Unused/irrelevant data fields are sent to the API #3348
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Thank you for reporting this issue! For maintainers to dig into issues it is required that all issues include the entirety of This issue has been marked with |
I didn't have time to review the entire log file for anything that shouldn't be published, but I believe the lines I included are sufficient :) |
Cloudflare API deprecates the service, proto and name fields within the data map in favor of the name field outside the data map, which is the same name field that’s used by all other record types. However, the terraform provider still maintains these fields in the data map. |
Hi All, Is there any chance we can get this issue revisited, as it seems to have officially kicked in and been removed from the Cloudflare API from today onwards? I believe that @janik-cloudflare has raised a draft PR for the potential schema changes. Any chance we can get this prioritised? Related to:
Ref: |
Hi @frankpengau! Could you help me understand the impact you're seeing as a result of this rollout? In theory it should be possible to simply omit the deprecated data fields without any issues! |
Hi @janik-cloudflare , We've omitted the deprecated data fields from the SRV records and applied it to terraform state, but every time that we run our CI/CD, it is still picking up changes/drift to remove the data fields from the terraform state. It looks like we might need to perform manual terraform state manipulation, in order to actually remove them, as it still expects them in the schema? Otherwise, we were thinking we might need to look at moving to not using the data map entirely and just use value field/attribute to apply the port, priority, target and weight fields from the data map. Any suggestions? |
That's interesting, thanks @frankpengau. I have to admit I'm not too familiar with our Terraform provider but based on your message it sounds like the previous service/proto/name values are still cached in the tfstate file, and, because the API doesn't send them anymore, Terraform just assumes they still exist? I'm using a Could you post an example of what your Perhaps setting the 3 deprecated fields in the data map to empty strings would work to clear out any caches that are still around? |
We have tried to plainly remove the name/proto/service fields like so: resource "cloudflare_record" "example_com_sips" {
name = "_sips._tcp"
proxied = false
ttl = 86400
type = "SRV"
zone_id = "12345678123456781234567812345678"
data {
port = 5060
priority = 20
target = "target.another.com"
weight = 5
}
} But that didn't work, so we tried just empty values for name/proto/service fields: resource "cloudflare_record" "example_com_sips" {
name = "_sips._tcp"
proxied = false
ttl = 86400
type = "SRV"
zone_id = "12345678123456781234567812345678"
data {
port = 5060
priority = 20
target = "target.another.com"
weight = 5
name = ""
proto = ""
service = ""
}
} However that didn't work either. Is there a way to find out which zones it has rolled out to, in the cloudflare console/dashboard? |
Hmm, that works fine for me. On the second run:
Are you using the latest provider version?
Could you share Terraform's output/diffs? Or, even better,
I can check if you have the zone ID, but at this point it's been rolled out to pretty much all zones. If you saw a change 2 days ago it must be because of that. |
Is the deprecation a slow rollout? I was very confused why the suggested changes worked in some places but resulted in an infinite apply loop in others. ignore_changes seems to be a valid workaround: lifecycle {
ignore_changes = [data[0].name, data[0].proto, data[0].service]
} |
I won't be able to share publicly on GitHub, but happy to share more details in our Cloudflare Enterprise Support Case, if that's okay? Cloudflare Support Case: 3342269 |
@arcnmx it is indeed, but it's essentially done now (finishing 08:00 UTC on Monday). Sorry for the trouble; we had missed the impact on Terraform while planning the change. In the future we'd probably choose a different rollout plan and/or roll out similar changes significantly faster. Thanks for sharing that workaround! @frankpengau that'd be great, thank you! In particular the |
@janik-cloudflare Seems like it has finally rolled out to the remaining zones that we had. Issue is good to resolve on our end. Thanks for your help! |
@frankpengau oh, interesting, based on the symptoms you saw I wouldn't have expected that to resolve it, but I'm glad it did. Apologies again for the bumpy rollout! |
Marking this issue as stale due to 30 days of inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 7 days it will automatically be closed. Maintainers can also remove the |
This issue was closed because it has been stalled for 7 days with no activity. |
Confirmation
Terraform and Cloudflare provider version
Terraform v1.8.5
on linux_amd64
Affected resource(s)
Terraform configuration files
Link to debug output
https://gist.github.com/janik-cloudflare/310eb92bb92fbd47db79fde4168a199d
Panic output
No response
Expected output
Terraform sends only the data fields that are actually present in the resource
Actual output
Terraform sends all data fields, including any that are not present in the resource and even data fields for completely unrelated record types, such as
lat_degrees
(which only makes sense for LOC records).Steps to reproduce
TF_LOG=TRACE terraform apply --auto-approve
Additional factoids
Sending unrelated fields or fields not present in the resource is unexpected and bad practice.
This has caused problems with a rollout related to SRV record data fields: https://community.cloudflare.com/t/eol-of-name-related-data-fields-on-srv-dns-records-is-not-applying/668360
References
No response
The text was updated successfully, but these errors were encountered: