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

Unable to create PTR records using Terraform #688

Closed
satya-toyota opened this issue May 19, 2020 · 10 comments
Closed

Unable to create PTR records using Terraform #688

satya-toyota opened this issue May 19, 2020 · 10 comments

Comments

@satya-toyota
Copy link

Hi there,

I am unable to create Cloudflare PTR records using Terraform. From the issue here, looks like this is fixed, but still facing the same error.

Terraform Version

Terraform v0.12.21

Affected Resource(s)

Please list the resources as a list, for example:

  • cloudflare_record

Terraform Configuration Files

provider "cloudflare" {
  version = "~> 2.0"
  email   = "<EMAIL>"
  api_key = "<API_KEY>"
}

resource "cloudflare_record" "this" {
  zone_id = "blabla"
  name    = "1.2.3.4"
  type    = "PTR"
  value   = "cf-ptr-test-rec1"
  proxied = true
}

Output

Terraform v0.12.21
Configuring remote state backend...
Initializing Terraform configuration...
2020/05/19 19:00:26 [DEBUG] Using modified User-Agent: Terraform/0.12.21 TFE/v202003-1

Error: expected type to be one of [A AAAA CAA CNAME TXT SRV LOC MX NS SPF CERT DNSKEY DS NAPTR SMIMEA SSHFP TLSA URI], got PTR 

Expected Behavior

Cloudflare PTR records should be created

Actual Behavior

Error message unable to detect PTR record type

Steps to Reproduce

terraform apply

References

https://github.com/terraform-providers/terraform-provider-cloudflare/issues/283

@jacobbednarz
Copy link
Member

What version of the provider are you using?

@satya-toyota
Copy link
Author

@jacobbednarz I am using the recent one with this construct.
version = "~> 2.0"

@jacobbednarz
Copy link
Member

Exact version please. That operator doesn’t mean the latest, just a version within the 2.0 to 3.0 range.

@satya-toyota
Copy link
Author

Looks like its picking 2.6.0

@jacobbednarz
Copy link
Member

One issue I see here is that you're attempting to proxy a PTR record (which isn't possible in Cloudflare https://support.cloudflare.com/hc/en-us/articles/360019093151). I'm checking whether that is interfering here as we have additional validation around that.

@satya-toyota
Copy link
Author

@jacobbednarz I removed the proxy option but still failing at the plan stage itself.

@jacobbednarz
Copy link
Member

This works on master (your content was still invalid)

resource "cloudflare_record" "ptr_repro" {
  zone_id = "ZONE_ID"
  name    = "@"
  type    = "PTR"
  value   = "mail.example.com"
}

However trying this on 2.6.0 doesn't which is odd as nothing as changed for records on master vs 2.6.0.

@satya-toyota
Copy link
Author

@jacobbednarz Which version is master using?

@jacobbednarz
Copy link
Member

master is it's own version; currently 9a8fd43. Which looking at now, @patryk has already fixed this 4 days ago and I am missing his last commit 🤦

This should be addressed in the next release.

@satya-toyota
Copy link
Author

Oh ok, will wait for the next release and validate again then. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants