dnsimple / terraform-provider-dnsimple

Terraform DNSimple provider.
https://www.terraform.io/docs/providers/dnsimple/
Mozilla Public License 2.0
22 stars 20 forks source link

Record cannot be imported #106

Closed daniel1302 closed 1 year ago

daniel1302 commented 1 year ago

Terraform Version

v1.4.6

Affected Resource(s)

Terraform Configuration Files


resource "dnsimple_zone_record" "netlify_aliases_txt" {
  for_each  = local.netlify_dns["aliases"]
  zone_name = each.key
  name      = ""
  type      = "TXT"
  value     = "ALIAS for ${each.value}"
  ttl       = 60
}

Debug Output

Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

Panic Output

➜  dns git:(dns-changes) ✗ terraform import 'dnsimple_zone_record.netlify_aliases_txt["some_domain"]' "some_domain_44041155"
╷
│ Error: The provider returned a resource missing an identifier during ImportResourceState. This is generally a bug in the resource implementation for import. Resource import code should not call d.SetId("") or create an empty ResourceData. If the resource is missing, instead return an error. Please report this to the provider developers.
DXTimer commented 1 year ago

Hi @daniel1302 based on the command you shared I can see that the format of the import ID is likely malformed. You are providing some_domain_44041155, instead it should be some.domain_44041155. Notice the domain name has the . (dot).

Importing record example.com with record ID 1234 terraform import dnsimple_zone_record.resource_name example.com_1234

I think we can do some more validation on the ID and provide immediate feedback in case we detect malformed IDs.

DXTimer commented 1 year ago

Closing as we haven't heard back from you.

DXTimer commented 1 year ago

Closing as we haven't heard back from you.