You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module "acm" {
source = "terraform-aws-modules/acm/aws"
version = "~> v2.0"
providers = {
aws = aws.useast1
}
domain_name = var.domain
zone_id = var.zone_id
subject_alternative_names = compact(
[
"*.alerts.${var.domain}",
"*.info.${var.domain}",
"*.news.${var.domain}",
"*.${var.domain}",
],
)
wait_for_validation = true #have to wait for validation process since further I use acm cert in CF distribution creation
tags = {
Name = "${var.domain}"
}
}
When I'll apply it will fail with error about missing validation records for all alternative names.
If I change wait_for_validation to false I can see outputs like:
The contains function will return false for everything except main domain since the domain names in this_acm_certificate_domain_validation_options have a wildcard and in local.distinct_domain_names it's replaced.
When I changed it to validation_domains = [for k, v in aws_acm_certificate.this[0].domain_validation_options : tomap(v) if contains(local.distinct_domain_names, replace(v.domain_name, "*.", ""))]
everything seems created correctly.
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.
Hi, there,
I have these configs
When I'll apply it will fail with error about missing validation records for all alternative names.
If I change
wait_for_validation
tofalse
I can see outputs like:As you can see
validation_domains
contains only main domain but not alternative names.Further investigations brought me to
terraform-aws-acm/main.tf
Line 6 in 1d8e823
The
contains
function will return false for everything except main domain since the domain names inthis_acm_certificate_domain_validation_options
have a wildcard and inlocal.distinct_domain_names
it's replaced.When I changed it to
validation_domains = [for k, v in aws_acm_certificate.this[0].domain_validation_options : tomap(v) if contains(local.distinct_domain_names, replace(v.domain_name, "*.", ""))]
everything seems created correctly.
Do I do something wrong or is it an issue?
Thanks!
UPD:
And also change in
terraform-aws-acm/main.tf
Line 24 in 1d8e823
length(local.distinct_domain_names)+1
The text was updated successfully, but these errors were encountered: