-
Notifications
You must be signed in to change notification settings - Fork 41
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
Multiple domain in one certificate #3
Comments
Hey @noizo, thanks for using it! I don't think we ever considered mixing TLDs in our initial design, but I wonder if there is a way to support this by using the |
Got hit by this as well, and we couldn't find a clean way to pass the mapping between domains used in A possible hack is to make both of them a list, and have an extra first/last element for the primary domain, but it wouldn't look nice (since you'll have to pass the same Zone ID multiple times if you repeat a zone, which is very likely). I was wondering if there was an easy way (hopefully within terraform) to convert a domain to a root domain? So for eg: module "cert" {
source = "github.com/azavea/terraform-aws-acm-certificate?ref=0.1.0"
domain_name = "*.example.com"
subject_alternative_names = ["*.example.io"]
validation_record_ttl = "60"
}
// Inside the module
resource "aws_route53_record" "validation" {
provider = "aws.route53_account"
count = "${length(var.subject_alternative_names) + 1}"
name = "${lookup(aws_acm_certificate.default.domain_validation_options[count.index], "resource_record_name")}"
type = "${lookup(aws_acm_certificate.default.domain_validation_options[count.index], "resource_record_type")}"
zone_id = "${data.aws_route53_zone.selected[count.index].id}"
records = ["${lookup(aws_acm_certificate.default.domain_validation_options[count.index], "resource_record_value")}"]
ttl = "${var.validation_record_ttl}"
}
data "aws_route53_zone" "selected" {
count = "${length(var.subject_alternative_names) + 1}"
name = "${magic_root_domain(lookup(aws_acm_certificate.default.domain_validation_options[count.index], "resource_record_name"))}"
private_zone = false
} Even |
I'm having the same issue.
So far I'm not able to figure out a way do multi-domain verifications... |
The official limit is 10 (default) and 100 (extended): https://docs.aws.amazon.com/acm/latest/userguide/acm-limits.html Is the 4 limitation from the provider? |
The problem is that after the acm certificate is created, it's no longer possible to add new SANs to the same cert. This restriction happens on the AWS side. @bartvollebregt That's why you're seeing that max is four, because this was the amount of domains added on creation, so trying to add a new one will fail. In our case the error said "max of 3", for example. The solution is to create a new cert with the additional SANs added. |
I think I came up with a solution to this, though it isn't exactly my favorite. I'm still testing it but here's a gist of what it looks like: https://gist.github.com/chancez/dfaaf799b98698839d65ebba55db7d44 |
I made some updates to the gist (just look at the history). A few paint points I hit I'll explain here: A huge challenge was just that the validations option list has duplicate resource records because |
Hi.
Great job You've done with that module.
I found an issue.
If i'm trying to provision certificate with multiple domain names:
or
subject_alternative_names = ["*.example.io", "*.example.net"]
Terraform cant properly interpolate
zone_id
for each domain.Module trying to write dns verification only for domain, listed in
aws_route53_zone"
It uses same
zone_id
for different domain name. And ends up with an error.Besides that it gives an error, provisioning finishes just fine, correct entries are being added to dns verification records in each domain.
The text was updated successfully, but these errors were encountered: