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

Import of aws_route53_record with Underscore Fails #14465

Closed
rynbrd opened this issue May 14, 2017 · 1 comment
Closed

Import of aws_route53_record with Underscore Fails #14465

rynbrd opened this issue May 14, 2017 · 1 comment

Comments

@rynbrd
Copy link

rynbrd commented May 14, 2017

Terraform Version

Terraform v0.9.5

Affected Resource(s)

aws_route53_record

Terraform Configuration Files

resource "aws_route53_record" "tld_mailgun_key" {
  zone_id = "${aws_route53_zone.tld.id}"
  name    = "krs._domainkey.${var.tld}"
  type    = "TXT"
  ttl     = 300

  records = [
    "\"k=rsa; p=ABCDEFG\"",
  ]
}

Expected Behavior

The Route53 record is imported into Terraform successfully.

Actual Behavior

This error is printed:

aws_route53_record.tld_mailgun_key: Import complete!
  Imported aws_route53_record (ID: SANITIZEDZONEID_krs._domainkey.cntr.io_TXT)
aws_route53_record.tld_mailgun_key: Refreshing state... (ID: SANITIZEDZONEID_krs._domainkey.cntr.io_TXT)
Error importing: 1 error(s) occurred:

* aws_route53_record.tld_mailgun_key (import id: SANITIZEDZONEID_krs._domainkey.cntr.io_TXT): 1 error(s) occurred:

* import aws_route53_record.tld_mailgun_key result: SANITIZEDZONEID_krs._domainkey.cntr.io_TXT: aws_route53_record.tld_mailgun_key: InvalidInput: 1 validation error detected: Value 'domainkey.cntr.io' at 'startRecordType' failed to satisfy constraint: Member must satisfy enum value set: [AAAA, A, NS, SOA, SPF, MX, PTR, CNAME, TXT, SRV, NAPTR]
	status code: 400, request id: SANITIZED

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Create a Route53 record in AWS with an underscore in the name.
  2. Create a Terraform config for that record.
  3. Attempt to import the record with terraform import.

Important Factoids

It clearly attempts to split the ID on the underscore in the domain name. I verified this by finding the specific piece of code responsible for parsing the ID. As I suspected it simply calls strings.Split(d.Id(), "_").

I may cook up a PR if someone doesn't beat me to it.

@ghost
Copy link

ghost commented Apr 9, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants