Cloudflare record resource inconsistently handles zone names in DNS record updates #4333
Closed
3 tasks done
Labels
kind/bug
Categorizes issue or PR as related to a bug.
lifecycle/stale
triage/needs-information
Indicates an issue needs more information in order to work on it.
Confirmation
Terraform and Cloudflare provider version
Affected resource(s)
There appears to be an inconsistency in how the Cloudflare provider handles zone names when updating DNS records. This issue affects the
cloudflare_record
resource.Terraform configuration files
Link to debug output
NA
Panic output
NA
Expected output
The expected behavior would be consistent handling of the zone name. Either:
Both sides should include the full zone name:
"cluster.ie.pointsbet.com" -> "cluster.ie.pointsbet.com"
Or both sides should exclude the zone name:
"cluster.ie" -> "cluster.ie"
so the plan in full should look like below.
cloudflare_record.sf_proxy must be replaced
resource "cloudflare_record" "example_proxy" {
created_on = "2023-05-11T05:40:56.65566Z" -> (known after apply)
hostname = "proxy.ie.pointsbet.com" -> (known after apply)
id = "12345" -> (known after apply)
metadata = {
"auto_added" = "false"
"managed_by_apps" = "false"
"managed_by_argo_tunnel" = "false"
} -> (known after apply)
modified_on = "2023-05-11T05:40:56.65566Z" -> (known after apply)
name = "proxy.ie.pointsbet.com" -> "proxy.ie.ie.pointsbet.com" # forces replacement
proxiable = true -> (known after apply)
- tags = [] -> null
}
Actual output
When updating a DNS record, the provider seems to inconsistently handle the zone name portion of the hostname:
For the existing record, it uses the full hostname including the zone name:
"cluster.ie.pointsbet.com"
For the replacement, it drops the zone name entirely:
"cluster.ie"
This behavior is seen in the plan output:
~ name = "cluster.ie.pointsbet.com" -> "cluster.ie" # forces replacement
This is how it looks currently in a full plan,
Steps to reproduce
Additional Context
This issue was observed in a Terraform plan output. The inconsistency in handling the zone name could lead to unexpected behavior or errors when applying the Terraform configuration.
Additional factoids
This issue was observed in a Terraform plan output. The inconsistency in handling the zone name could lead to unexpected behavior or errors when applying the Terraform configuration.
References
NA
The text was updated successfully, but these errors were encountered: