我使用https://github.com/cloudposse/terraform-aws-acm-request-certificate
terraform 和 aws 生成证书。
如何在 terraform 的同一文件中运行多个域?(不是子域)
我试试这个,但我有错误Error: Duplicate module call
:
module "acm_request_certificate" {
source = "git::https://github.com/cloudposse/terraform-aws-acm-request-certificate.git?ref=master"
domain_name = "example.com"
process_domain_validation_options = true
ttl = "300"
}
module "acm_request_certificate" {
source = "git::https://github.com/cloudposse/terraform-aws-acm-request-certificate.git?ref=master"
domain_name = "otherexample.com"
process_domain_validation_options = true
ttl = "300"
}
我正在寻找解决方案,例如:
const domains = ["example.com", "otherexample.com"]
foreach(domain of domains) {
module "acm_request_certificate" {
source = "git::https://github.com/cloudposse/terraform-aws-acm-request-certificate.git?ref=master"
domain_name = domain
process_domain_validation_options = true
ttl = "300"
}
}