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

Powerdns record with count and hyphen in name fails on refresh #5228

Closed
alkersan opened this issue Feb 20, 2016 · 3 comments
Closed

Powerdns record with count and hyphen in name fails on refresh #5228

alkersan opened this issue Feb 20, 2016 · 3 comments

Comments

@alkersan
Copy link
Contributor

provider fails to retrieve record information if name contains hyphens.

resource "powerdns_record" "hyphened" {
    count = "2"
    zone = "example.org"
    name = "redis-${count.index}.example.org"
    type = "A"
    ttl = 60
    records = [ "10.20.30.${count.index}" ]
}

Reason: poor choice of recordId separator character here.
Powerdns don't include unique identifier of rrsets, thus a tuple (name, type) was used to correlate terraform's resourceId with pdns record. But I totally missed the factor of allowed dns hostname characters and 've put allowed hyphen as separator between name and type, thus making impossible reverse parsing of resourceId like redis-1.example.com-A

While fix seems simple - to choose different separator (*$#&) that's not it allowed set, i understand this is a complete FUBAR. Change of internal resource representation will make all existing records effectively invalid after update. Is there some internal migration mechanism in terraform that can be applied? But if not - I don't think this provider attracted lots of users, so impact shouldn't be huge.

@stack72 stack72 added the bug label Feb 21, 2016
@jen20 jen20 added this to the Terraform 0.6.12 milestone Feb 22, 2016
@jen20
Copy link
Contributor

jen20 commented Feb 22, 2016

Fixed by #5229.

@stack72 stack72 closed this as completed Feb 22, 2016
@jasonl
Copy link

jasonl commented Mar 1, 2016

For anyone who finds this, and needs to manually update their state file:

  1. Open terraform.tfstate in a text editor
  2. Find all the powerdns_record entries in it.
  3. In each one, change both id keys from "your-domain.something.com-A" to "your-domain.something.com:::A".
  4. Incremental the serial number at the top of terraform.tfstate so that Terraform doesn't think you've got a state file conflict.
  5. Run terraform plan. It should show that no changes are required in your infrastructure.

bigkraig pushed a commit to bigkraig/terraform that referenced this issue Mar 1, 2016
@ghost
Copy link

ghost commented Apr 27, 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 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants