Open PierreBart opened 11 months ago
Voting for Prioritization
Volunteering to Work on This Issue
I'm currently using the latest Terraform and Cloudflare provider, but this issue persists.
In my use case, I only need to set up regional hostnames for records manually created in the past. The problem arises when I create a cloudflare_regional_hostname
for a record like test.xpto.com
, which works well. However, if that record gets deleted outside of Terraform, subsequent plan/apply operations fail with a not_found (1,000)
error, and I need to manually remove the corresponding cloudflare_regional_hostname
from the state. From my perspective, I expected Terraform to detect the drift and report it.
Confirmation
Terraform and Cloudflare provider version
Affected resource(s)
Terraform configuration files
Link to debug output
https://gist.github.com/PierreBart/1082528e73e04faca66d7ce4c55dd0fd
Panic output
No response
Expected output
Updating the
cloudflare_record.test.name
attribute, and applying the new configuration recreates the resource and updates thecloudflare_record.cloudflare_regional_hostname
resource in place.Actual output
The apply command fails with error:
Steps to reproduce
cloudflare_record.test.name
value;Additional factoids
It seems that after the record is deleted, the
regional_hostname
resource is deleted from Cloudflare as well. However, the resource is still in the state and terraform tries to retrieve it but Cloudflare query fails with error 1000.Subsequent
terraform plan
commands also fail with the same error.From the API documentation, it seems that we can only patch the
region
attribute, not thehostname
: https://developers.cloudflare.com/data-localization/regional-services/get-started/I guess that the update of the
hostname
attribute should require the replacement of the resource rather than an in-place update.References
No response