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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_route53_delegation_set import doesn't bring in reference_name #8476

Open
asvoboda opened this issue Apr 29, 2019 · 4 comments
Open

aws_route53_delegation_set import doesn't bring in reference_name #8476

asvoboda opened this issue Apr 29, 2019 · 4 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/route53 Issues and PRs that pertain to the route53 service.

Comments

@asvoboda
Copy link

asvoboda commented Apr 29, 2019

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

$ terraform -v
Terraform v0.11.11

  • provider.aws v2.8.0

Affected Resource(s)

  • aws_route53_delegation_set

Terraform Configuration Files

resource "aws_route53_delegation_set" "main" {
  reference_name = "Main"

  lifecycle {
    prevent_destroy = true
  }
}

Expected Behavior

terraform import aws_route53_delegation_set.main "ID" should bring in all attributes, including reference name.

Actual Behavior

The provider correctly pulls in name servers and ID, but not reference name.

Steps to Reproduce

  1. terraform import

Important Factoids

@nywilken nywilken added the service/route53 Issues and PRs that pertain to the route53 service. label Apr 29, 2019
@nywilken
Copy link
Member

nywilken commented Apr 29, 2019

Hi @asvoboda thank you for submitting this enhancement request. In looking at the implementation I see that the reference_name attribute acts more as a prefix since the provider appends a unique id to the specified value at creation time and does not use the value for any subsequent updates. Which is probably the reason why it was not being imported in the first place.

Could you provide a use case for including the attribute upon import so that I may better understand how and if we could support this request. Thanks!

@nywilken nywilken added enhancement Requests to existing resources that expand the functionality or scope. waiting-response Maintainers are waiting on response from community or contributor. labels Apr 29, 2019
@asvoboda
Copy link
Author

asvoboda commented Apr 30, 2019

I was refactoring some old terraform projects yesterday, and this value was set. I wanted to run terraform state rm and terraform import instead of manually mucking with the state file, and after import terraform wanted to delete the imported resource.

The fix here could also be not attempting to delete and re-create the resource if reference_name is currently set in AWS but not in terraform.

I've already fixed the issue by manually adding the reference_name, so this is a report after the fact.

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Apr 30, 2019
@LucaFilipozzi
Copy link

Why does the provider append a unique id? Isn't the reference_name the unique value?

@seanmacisaac
Copy link

At least as of provider 3.72.0 this behavior is still wrong. The provider does not seem to append a unique ID at least as of this version, and uses what is specified if provided. Import still leaves reference_name as null.

For anyone who comes across this issue in the future, the steps I took to resolve were:

  1. terraform import aws_route53_delegation_set.[name] [ID]
  2. terraform state pull > tempstate
  3. manually edit that file, replacing null for reference_name with "[my reference name]". also bump serial number.
  4. terraform state push tempstate

After this my plan showed no changes, as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/route53 Issues and PRs that pertain to the route53 service.
Projects
None yet
Development

No branches or pull requests

4 participants