Terraform-provider-cloudflare: Cloudflare record throwing Invalid dns record identifier

Created on 13 Jun 2017  路  5Comments  路  Source: cloudflare/terraform-provider-cloudflare

_This issue was originally opened by @jleclanche as hashicorp/terraform#13068. It was migrated here as part of the provider split. The original body of the issue is below._


Terraform 0.9.1, recently upgraded from 0.8 to the new backend system to the new backend system (I was using an s3 remote state before).

I have the following record:

resource "cloudflare_record" "uploads-db" {
    domain = "example.com"
    name = "uploads-db"
    type = "CNAME"
    value = "${aws_db_instance.uploads-db.address}"
    proxied = false
}

I've had this record for a while, but now after the upgrade every time I do terraform plan, I get the following error:

Error refreshing state: 1 error(s) occurred:
2017/03/25 17:22:34 [DEBUG] plugin: terraform: local-exec-provisioner (internal) 2017/03/25 17:22:34 [DEBUG] plugin: waiting for all plugin processes to complete...
2017/03/25 17:22:34 [DEBUG] plugin: terraform: aws-provider (internal) 2017/03/25 17:22:34 [DEBUG] plugin: waiting for all plugin processes to complete...

* cloudflare_record.uploads-db: cloudflare_record.uploads-db: error from makeRequest: HTTP status 400: content "{\"success\":false,\"errors\":[{\"code\":1002,\"message\":\"Invalid dns record identifier\"}],\"messages\":[],\"result\":null}"

I tried deleting and even tainting the record, but it always gives me that error, rendering terraform completely unusable :(

kinbug

Most helpful comment

This is a pretty big error; I'm running into it as well after:

  • Creating resource via Terraform
  • Removing it manually
  • Trying to apply Terraform again

Basically what's happening is, since I deleted the record manually, it's no longer able to be referenced by the id that Terraform was keeping track of.

I had to do manual .tfstate surgery to change id to a newly created record to get to be able to do anything with Terraform

All 5 comments

This is a pretty big error; I'm running into it as well after:

  • Creating resource via Terraform
  • Removing it manually
  • Trying to apply Terraform again

Basically what's happening is, since I deleted the record manually, it's no longer able to be referenced by the id that Terraform was keeping track of.

I had to do manual .tfstate surgery to change id to a newly created record to get to be able to do anything with Terraform

I can't believe this issue still happening, i just removed the cname record and terraform struck

Just hit this issue as well. I just manually removed the sections from the state file since I had removed the records manually as well.

I ran into this as well. It's pretty bad UX, since any manual change will just freeze Terraform.

Hello! This issue for Cloudflare records was addressed in #29. A new release of the provider should go out in the near future.

Was this page helpful?
0 / 5 - 0 ratings