-
-
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
ACM DNS validation record set not created for all domain names on Route53 #82
Comments
Please run code in |
I have reproduced this issue. I'm using Terraform v0.14.11. In this case It can be fixed by inserting a single item instead.
With the suggested fix:
|
Thanks for opening this issue. I have managed to reproduce the issue and completed PR #89 created by @flora-five . @Rammohanemis There is a potential problem with the code:
If you want to create an ACM certificate for a custom set of domains and SANs then you need to set |
Please give a try to v3.1.0 that has been just released. |
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. |
Description
CNAME record not created for all distinct domain names on Route53
Reproduction
My Domain list for ACM
here I am going to create ACM for four domains. For DNS validation we have to create four CNAME record in Route53 but three records is enough because "*.acm-test.com" and "acm-test.com" both having same record value so we will create record set for only "acm-test.com" on Route53.
In above code distinct_domain_names will have below three value because we are skipping "*.acm-test.com"
we are getting domain_validation_options from ACM for all four domains so validation_domains have four value set
In above code length(local.distinct_domain_names) is 3 so it will create three Record. For record value we are getting from local.validation_domains list and it have 4 record set. Consider local.validation_domains have a list like below order
Based on the count we are creating Route53 record for first three record and in hosted zone we might have two CNAME record, because third record (*.acm-test.com) will overwrite second record (acm-test.com) value because both have same record value on ACM.
In above method we missed to create record for "www1.acm-test.com" domain on Route53 due to invalid logic.
FIX
To fix this issue we have to change the if condition logic on validation_domains local variable. Here we are checking whether ACM domain was there on distinct_domain_names after replacing "*." Obviously we have all the ACM domain name in distinct_domain_names so validation_domains will have four record set. So this part creating issue here.
Instead of above code we have to use below code to resolve this issue.
Here we are copying distinct domain name value so that validation_domains änd distinct_domain_names have same count and same domain name list
The text was updated successfully, but these errors were encountered: