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

Removing a DNS record outside terraform breaks #4581

Closed
3 tasks done
david-haugh opened this issue Nov 14, 2024 · 2 comments
Closed
3 tasks done

Removing a DNS record outside terraform breaks #4581

david-haugh opened this issue Nov 14, 2024 · 2 comments
Labels
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. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log.

Comments

@david-haugh
Copy link

Confirmation

  • This is a bug with an existing resource and is not a feature request or enhancement. Feature requests should be submitted with Cloudflare Support or your account team.
  • I have searched the issue tracker and my issue isn't already found.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

Terraform v1.9.5
provider "5.0.0-alpha1"

Affected resource(s)

cloudflare_dns_record

Terraform configuration files

terraform {
  required_providers {
    cloudflare = {
      source  = "cloudflare/cloudflare"
      version = "5.0.0-alpha1"
    }
  }
}

provider "cloudflare" {
  api_token = "TOKEN"
}

resource "cloudflare_dns_record" "all_records" {
  name     = "temp"
  zone_id  = "ZONE"
  content  = "www.google.com"
  ttl      = 60
  type     = "CNAME"
}

Link to debug output

https://aoeuaoeuaoeuaoeuu.blob.core.windows.net/temp/log.txt

Panic output

No response

Expected output

The provider should detect the resource is missing and add it. It should not crash.

Actual output

│ Error: failed to make http request

│ with cloudflare_dns_record.all_records["frontend"],
│ on dns.tf line 52, in resource "cloudflare_dns_record" "all_records":
│ 52: resource "cloudflare_dns_record" "all_records" {

│ GET
│ "https://api.cloudflare.com/client/v4/zones/be632ff0a3fc2321688003bbcd0e227f/dns_records/480f7f51fd04e5249631f35a1ed2439d":
│ 404 Not Found {"result":null,"success":false,"errors":[{"code":81044,"message":"Record does not
│ exist."}],"messages":[]}

Steps to reproduce

  1. Create a DNS record through terraform
  2. Delete one DNS record through the cloudflare portal

Additional factoids

The problem is that I have to modify my .tfstate file manually to resolve this.

References

No response

@david-haugh david-haugh 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 Nov 14, 2024
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 Nov 14, 2024
@jacobbednarz jacobbednarz closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 2024
@jacobbednarz
Copy link
Member

this is a known issue with the 5.0.0-alpha1 and we're not yet tracking public bugs. it will be fixed in later releases.

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. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log.
Projects
None yet
Development

No branches or pull requests

2 participants