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

Datasource cloudflare_dns_record not supported even though documentation tells it should be #4215

Closed
3 tasks done
danidemi opened this issue Oct 5, 2024 · 3 comments
Closed
3 tasks done
Labels
kind/support Categorizes issue or PR as related to user support.

Comments

@danidemi
Copy link

danidemi commented Oct 5, 2024

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 -v
Terraform v1.9.7
on windows_amd64
+ provider registry.terraform.io/cloudflare/cloudflare v4.43.0

Affected resource(s)

data "cloudflare_dns_record"

Terraform configuration files

terraform {
  required_version = ">= 0.12.6"
  required_providers {

    cloudflare = {
      source = "cloudflare/cloudflare"
      version = "~> 4"
    }

  }
}

provider "cloudflare" {
  api_token = "..."
}

output coderit-it-zone {
  value = data.cloudflare_zone.coderit-it
}
data "cloudflare_dns_record" "veikla-coderit-it" {
  zone_id  = data.cloudflare_zone.coderit-it.zone_id
  hostname = "veikla.coderit.it"
}
output veikla-coderit-it-record {
  value = data.cloudflare_dns_record.veikla-coderit-it
}

data "cloudflare_zone" "coderit-it" {
  name = "coderit.it"
}

Link to debug output

https://gist.github.com/danidemi/74832c4794e8bed39a309af6a4e6843b

Panic output

No response

Expected output

Data source cloudflare_dns_record should not raise any error and it should be supported, as documented here: https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/data-sources/dns_record

Actual output

> terraform plan
╷
│ Error: Invalid data source
│
│   on provider.tf line 21, in data "cloudflare_dns_record" "veikla-coderit-it":
│   21: data "cloudflare_dns_record" "veikla-coderit-it" {
│
│ The provider cloudflare/cloudflare does not support data source "cloudflare_dns_record".
╵

Steps to reproduce

  1. generate a cloudflare token
  2. just run terraform init and then terraform plan using the terraform attached to this bug using the token you've just created

Additional factoids

I have a free account on cloudflare

References

No response

@danidemi danidemi 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 5, 2024
Copy link
Contributor

github-actions bot commented Oct 5, 2024

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

you're referencing the 5.x documentation that is currently in alpha.

you want to toggle the version to 4.x for the correct data source.

@jacobbednarz jacobbednarz added kind/support Categorizes issue or PR as related to user support. and removed 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. labels Oct 5, 2024
@danidemi
Copy link
Author

danidemi commented Oct 6, 2024

thx @jacobbednarz, I didn't notice Terraform propose the user the latest version even when it is still in alpha. My bad, thx for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as related to user support.
Projects
None yet
Development

No branches or pull requests

2 participants