dnsimple / terraform-provider-dnsimple

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

Import fails with error "nil entry in ImportState results" #27

Closed aryounce closed 1 year ago

aryounce commented 4 years ago

When attempting to import some DNSimple records into Terraform:

terraform import "dnsimple_record.test-ns1" "example.com_123456789"

Fails with the error:

Error: nil entry in ImportState results. This is always a bug with
the resource that is being imported. Please report this as
a bug to Terraform.

Terraform Version

Terraform v0.12.29
+ provider.dnsimple v0.4.0
+ provider.external v1.2.0

Affected Resource(s)

Terraform Configuration Files

data "external" "dnsimple_credentials" {
  program = ["/bin/bash", "-c", "jq -c -r . /Users/XXXX/.config/dnsimple/XXXXXXX.json"]
}

provider "dnsimple" {
  token = data.external.dnsimple_credentials.result["token"]
  account = data.external.dnsimple_credentials.result["account"]
}

resource "dnsimple_record" "test-ns1" {
  domain = "example.com"
  name   = "test"
  value  = "ns1.example-dns-provider.com"
  type   = "NS"
  ttl    = 3600
}

Debug Output

https://gist.github.com/aryounce/e7ca7ef412ee05d0ddef9a890a7b3cf2

Expected Behavior

The resource should be imported into the Terraform state.

Actual Behavior

Failure with error message provided above.

Steps to Reproduce

  1. terraform import "dnsimple_record.test-ns1" "example.com_123456789"
mustafa-kutlu-dioss commented 2 years ago

Hi I'm still getting this issue. Has a fix already been implemented? Same steps, same output.

Terraform v1.0.11
on linux_amd64
+ provider registry.terraform.io/dnsimple/dnsimple v0.11.0
weppos commented 2 years ago

Can you confirm as to whether the record you were trying to import did exist?

2020-07-24T17:08:38.409-0500 [DEBUG] plugin.terraform-provider-dnsimple_v0.4.0_x4: 2020/07/24 17:08:38 DNSimple Record Not Found - Refreshing from State
DXTimer commented 1 year ago

This has now been fixed in v0.16.3.