I want to pass var.domain_names as list(list(string)), example:
domain_names = [
["foo.com",".*foo-1.com",".*foo-2.com"],
["bar.com",".*bar-1.com"],
...
]
So it should create certificate for foo.com, bar.com ... but add others like .*foo-1.com ... to the subject_alternative_names.
Please help me solve this, Using terraform 0.12.18
resource "aws_acm_certificate" "certificate" {
domain_name = var.domain_names[count.index]
subject_alternative_names = slice(var.domain_names, 1, length(var.domain_names))
validation_method = var.validation_method
tags = {
Name = var.domain_names[count.index]
owner = "xx"
terraform = "true"
}
lifecycle {
create_before_destroy = true
}
}