Skip to content
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

cloudflare_regional_hostname fail to update #2856

Open
2 tasks done
PierreBart opened this issue Oct 17, 2023 · 1 comment
Open
2 tasks done

cloudflare_regional_hostname fail to update #2856

PierreBart opened this issue Oct 17, 2023 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug. service/addressing Categorizes issue or PR as related to the Addressing service. triage/accepted Indicates an issue or PR is ready to be actively worked on. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. workflow/synced

Comments

@PierreBart
Copy link

PierreBart commented Oct 17, 2023

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

Terraform v1.5.3
on darwin_arm64
+ provider registry.terraform.io/cloudflare/cloudflare v4.16.0

Affected resource(s)

  • cloudflare_regional_hostname

Terraform configuration files

data "cloudflare_zone" "zone" {
  name = "your_zone_id"
}

resource "cloudflare_record" "test" {
  name    = "test-1"
  proxied = true
  ttl     = 1
  type    = "A"
  value   = "192.0.2.1"
  zone_id = data.cloudflare_zone.zone.id
}

resource "cloudflare_regional_hostname" "test" {
  hostname   = cloudflare_record.test.hostname
  region_key = "isoeu"
  zone_id    = data.cloudflare_zone.zone.id
}

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 the cloudflare_record.cloudflare_regional_hostname resource in place.

Actual output

The apply command fails with error:

2023-10-17T12:02:36.507+0200 [ERROR] vertex "cloudflare_regional_hostname.test" error: not_found (1000)
╷
│ Error: not_found (1000)
│
│   with cloudflare_regional_hostname.test,
│   on test.tf line 14, in resource "cloudflare_regional_hostname" "test":
│   14: resource "cloudflare_regional_hostname" "test" {
│

Steps to reproduce

  1. Apply the Terraform configuration files I provided;
  2. Update the cloudflare_record.test.name value;
  3. Apply the new configuration;

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 the hostname: 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

@PierreBart PierreBart added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 17, 2023
@github-actions
Copy link
Contributor

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. label Oct 17, 2023
@jacobbednarz jacobbednarz added triage/accepted Indicates an issue or PR is ready to be actively worked on. service/addressing Categorizes issue or PR as related to the Addressing service. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. service/addressing Categorizes issue or PR as related to the Addressing service. triage/accepted Indicates an issue or PR is ready to be actively worked on. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. workflow/synced
Projects
None yet
Development

No branches or pull requests

2 participants