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

Records with underscores in the name cannot be imported #7

Closed
logicbomb421 opened this issue Mar 31, 2018 · 1 comment · Fixed by #65
Closed

Records with underscores in the name cannot be imported #7

logicbomb421 opened this issue Mar 31, 2018 · 1 comment · Fixed by #65
Assignees
Labels

Comments

@logicbomb421
Copy link

logicbomb421 commented Mar 31, 2018

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Terraform v0.11.1

  • provider.aws v1.13.0
  • provider.dnsimple v0.1.0

Affected Resource(s)

  • dnsimple_record
  • resource import functionality

Terraform Configuration Files

resource "dnssimple_record" "domain" {}

also via cli: terraform import dnsimple_record.domain _mydomain.com_1234

Expected Behavior

The record is imported into the terraform state.

Actual Behavior

Received the following:

Error importing: 1 error(s) occurred:
* dnsimple_record.domain (import id: _mydomain.com_1234): import dnsimple_record.domain (id:_mydomain.com_1234): Error Importing dnsimple_record. Please make sure the record ID is in the form DOMAIN_RECORDID (i.e. example.com_1234

Steps to Reproduce

  1. Create a DNSimple record with an underscore in it (e.g. my_domain.example.com)
  2. Create a dnsimple_record resource to import into
  3. Run the import step as described in the provider documentation

Important Factoids

The issue is in the resourceDNSimpleRecordImport func on line 191 of /dnsimple/resource_dnsimple_record.go. The length check after splitting the input domain on _ expects there to be exactly two parts, when there is the possibility for domains with underscores in them (for instance, AWS ACM certificate validation records begin with an underscore).

Shown here.

@radeksimko radeksimko added the bug label Feb 21, 2019
@jamesarosen
Copy link

jamesarosen commented Aug 7, 2019

Note that this only matters for apex domains with underscores since the ID of the record is [zone]_[id]. I was able to import a record like foo._domainkey.example.com CNAME … just fine via terraform import dnsimple_record.foo_dkim example.com_12345678.

weppos added a commit that referenced this issue Oct 25, 2022
Fixes #7

Note I have not modified the dnsimple_record resource, as it will be removed in the upcoming major version as per #63
@weppos weppos self-assigned this Oct 25, 2022
weppos added a commit that referenced this issue Nov 16, 2022
Fixes #7

Note I have not modified the dnsimple_record resource, as it will be removed in the upcoming major version as per #63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants