-
-
Notifications
You must be signed in to change notification settings - Fork 231
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: Fix an off-by-one error with validation records #47
fix: Fix an off-by-one error with validation records #47
Conversation
PR #32 introduces an obscure off-by-one error that leads to a duplicated validation record because of a wrap-around in `distinct_domain_names`. I assume this hasn't been spotted until now mainly because the duplicated record gets silently overwritten when `validation_allow_overwrite_records` is set to `true` (as it is by default). I tried to identify a corner case when this `+ 1` is required, but couldn't find any so far. Please let me know if you are aware why it may be needed.
I'm not really sure what to do for this "Semantic Pull Request" check... help? |
@blaskov You can safely ignore this for now. I will update PR template and explain how to deal with it in the near future. Meanwhile, you can prefix your PR title with |
The main reason why some PRs are not merged yet is the lack of time for proper research and investigation but we are getting there with more people involved in different terraform-aws-modules. |
@antonbabenko Ok, I've added As for the review - no worries, we've enabled |
This PR is definitely valid as it creates duplicate route53 validation records |
When (if) this PR gets applied, be careful when running Records created due to "wrapping" are stored as 2 different resources in the Terraform State, but they actually point to the same resource in AWS. So if in your plan you see something like this:
be aware, that this will destroy the Record associated with This can be resolved with one more It is better off to run Learned this the hard way just now by using the forked repo as the module source. Was not a big deal for me, but who knows. |
it's been almost a year since this PR was opened - any chance to get it merged? Also, it's now out of date, needs a rebase |
I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
Prevent duplicated validation record causing failures when
validation_allow_overwrite_records
is set tofalse
.Motivation and Context
PR #32 introduces an obscure off-by-one error that leads to a duplicated validation record because of a wrap-around in
distinct_domain_names
.I assume this hasn't been spotted until now mainly because the duplicated record gets silently overwritten when
validation_allow_overwrite_records
is set totrue
(as it is bydefault).
I tried to identify corner cases when this
+ 1
is required, but couldn't find any. Please let me know if you are aware why it may be needed.Breaking Changes
I don't think this is breaking backwards compatibility.
How Has This Been Tested?
Used latest
master
with disabledvalidation_allow_overwrite_records
inexamples/complete-dns-validation
and verified that Terraform fails to apply.Then did the change in this PR and managed to apply successfully.