-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
aws_route53_zone imports with a trailing dot #8511
Comments
We can just strip the trailing-dot, as per the documentation:
|
Actually, after thinking about this. Perhaps it is better to update the documentation. Fixing this would affect many people and would require a migration, quite possibly. Thus it might not be worth it. What do you think @stack72 ? |
If Route53 considers the two to be equivalent, we could add a StateFunc to the attribute that normalizes the value by stripping it off... this would prevent Terraform from creating a diff related to trailing dots. |
@apparentlymart oh yes! Thank you for that. |
@apparentlymart I had to exclude |
@kwilczynski I'm not too familiar with the import system, so I'm not sure what the requirements are there. Hopefully there's a similar sort of normalization mechanism in that layer, but I'll have to defer to @mitchellh on this one. |
@kwilczynski we may need a custom migration for this rather than just using the Passthrough - look at how security_group_rule imports work |
@apparentlymart @stack72 @mitchellh this change works for normal operation but not for the imports, as per:
It seems that the import mechanism is not respecting the |
As per @stack72 (via Slack) we need a custom import to solve this. |
So, the custom import will require a lot of duplication from the ReadFunc, thus a re-factor is in order. |
What would be the workaround in the meantime? |
@martijnvermaat hi there! I am sorry that you are having the same problem! And my sincere apologies for the delay. I've been busy with my day work having less time as of late to work on this, I am very sorry! |
That's allright @kwilczynski . I tested a workaround by manually removing the trailing dot from the state file. I think that's basically what your PR would do. |
@martijnvermaat hi! That is what the initial Pull Request did, very true. But then I realised that it would not work for importing. To make it work for both import and normal operations e.g. plan, refresh, apply, etc., one needs to provide bespoke import routine, rather than rely on simple passthrough. Which is more time consuming to do. Your work around seem sensible. Again, apologise. |
Just wondering if there is any update on this issue. I hit it all the time. More of an annoyance at this point but it would be nice if it were resolved 👍 |
Useful example if you're retrieving the domain using data and would like to remove the trailing dot: |
This is still exist
I needed to pull/edit/push the remote state file after the import. |
Hi, @leventyalcin. 👋 Sorry you ran into trouble during your |
@bflad this still exists on provider.aws v1.11.0:
|
A simple workaround is to pull in the remote state, edit it and then push it back up. Eg:
|
I ran into this problem this past week with:
@developerinlondon's workaround worked for me. |
Just ran into this issue.
@bflad, it seems it was fixed for record, but not for zone. |
Oops thanks for the heads up and sorry for jumping to the wrong conclusion there regarding Since this issue is generating notifications in the wrong place now (providers were split from Terraform core back in Terraform 0.10), I am going to lock this issue to encourage 👍 reactions and comments on: hashicorp/terraform-provider-aws#241 |
Hi,
I'm on version 0.7.1 and when running an aws_route_53 import it'll end up in the state file with a trailing dot (as in bind, and as shown in the console).
This causes the resource to try and be recreated due to a mismatch with the terraform file.
How to reproduce:
Create a Route53 zone manually
Create the TF resource in a file
Import Route53 zone into your state
Run terraform plan
I could have just bypassed this by by adding a trailing dot to the resource, but documentation shows an example without it and it might be misleading to have both ways.
Bests
The text was updated successfully, but these errors were encountered: