-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Fix bug: route53_zone import saves name with trailing . in state causing plan to detect a change and try to recreate the zone #3982
Conversation
Hi @kaofelix thanks for this contribution! Generally its preferable to not touch how an attribute is saved from the API as it can cause a breaking change in people's configurations when they upgrade. Instead, we can likely just tell Terraform that the attribute is equivalent with or without the period, by adding a Something like this should be able to accomplish what we're looking for on the
Can you try that out? |
3b89540
to
1959801
Compare
@bflad thanks for the tip, I wasn't aware of that! I just pushed a new implementation with your suggestion and it seems to work perfectly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM -- thanks! 🚀
8 tests passed (all tests)
=== RUN TestAccAWSRoute53Zone_private_basic
--- PASS: TestAccAWSRoute53Zone_private_basic (59.30s)
=== RUN TestAccAWSRoute53Zone_basic
--- PASS: TestAccAWSRoute53Zone_basic (66.12s)
=== RUN TestAccAWSRoute53Zone_importBasic
--- PASS: TestAccAWSRoute53Zone_importBasic (70.36s)
=== RUN TestAccAWSRoute53Zone_updateComment
--- PASS: TestAccAWSRoute53Zone_updateComment (73.61s)
=== RUN TestAccAWSRoute53Zone_private_region
--- PASS: TestAccAWSRoute53Zone_private_region (85.55s)
=== RUN TestAccAWSRoute53ZoneAssociation_basic
--- PASS: TestAccAWSRoute53ZoneAssociation_basic (107.61s)
=== RUN TestAccAWSRoute53ZoneAssociation_region
--- PASS: TestAccAWSRoute53ZoneAssociation_region (115.55s)
=== RUN TestAccAWSRoute53Zone_forceDestroy
--- PASS: TestAccAWSRoute53Zone_forceDestroy (377.81s)
This has been released in version 1.14.1 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
When creating a
aws_route53_zone
in terraform, you define the name of the domain as in the documentation:However, when importing an existing
aws_route53_zone
, terraform is using the name returned by AWS which has a trailing "." in the end of it which is the name displayed in the web console. The name with the trailing "." gets saved into your state causing an inconsistency, so if you run a plan right after importing the zone you get something like:due to the difference in name. This PR fixes it buy removing the trailing "." when reading the zone name during an import. I also removed it from the data used in the acceptance tests since it doesn't match the example suggested in the docs.