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

dme_domain resource import #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Tensho
Copy link

@Tensho Tensho commented Dec 12, 2023

Thanks for developing and maintaining the Terraform provider for DME resources 🙇 I have a bunch of exisitng domains which I'd like to manage with Terraform. This change provides dme_domain resource import. I'm going to work on the other resources import capability too. Partially closes #21.

Test

$ export apikey=<REDACTED>
$ export secretkey=<REDACTED>
$ make testacc TESTARGS='-run=TestAccDomain_Basic'
make testacc TESTARGS='-run=TestAccDomain_Basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run=TestAccDomain_Basic -timeout 120m
?   	github.com/terraform-providers/terraform-provider-dme	[no test files]
=== RUN   TestAccDomain_Basic
    testing.go:745: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.

        Error: errors during apply: Cannot delete a domain that is pending a create or delete action.

        State: dme_domain.example:
          ID = 7969106
          provider = provider.dme
          created = 1702339200000
          folder_id = 102461
          gtd_enabled = false
          name = domain_test_basic1.com
          soa_id =
          template_id =
          transfer_acl_id =
          updated = 1702407712514
          vanity_id = 26221
--- FAIL: TestAccDomain_Basic (4.35s)
FAIL
FAIL	github.com/terraform-providers/terraform-provider-dme/dme	4.767s
FAIL
make: *** [testacc] Error 1

The test passes but cleanup can't be handled due to a resource eventual consistency nature. I haven't found a quick way to disabled destroy step in SDK v1 to make test green and sweep resource manually.

Notes

  1. Can you provide some sandbox account to run the tests, please? I've run them in my production account for this contribution but would be glad to have a separate test environment.
  2. I'd recommend using the same environment variables in tests as in production provider/client for the sake of less ambiguity or at least adjust the error message text as it doesn't reveal intention well:
    - apikey
    - secretkey
    + DME_API_KEY
    + DME_SECRET_KEY
  3. SDK v1 is quite old. Are there any plans to upgrade it to SDK v2 or Framework?

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

Successfully merging this pull request may close these issues.

Import support
1 participant