-
Notifications
You must be signed in to change notification settings - Fork 0
/
acm.tf
22 lines (20 loc) · 923 Bytes
/
acm.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module "acm" {
source = "terraform-aws-modules/acm/aws"
version = "4.3.2"
tags = var.tags
domain_name = var.app_domain
zone_id = data.cloudflare_zone.main.id
subject_alternative_names = ["*.${var.app_domain}"]
create_route53_records = false
validation_record_fqdns = cloudflare_record.validation[*].hostname
}
resource "cloudflare_record" "validation" {
zone_id = data.cloudflare_zone.main.id
count = length(module.acm.distinct_domain_names)
name = element(module.acm.validation_domains, count.index)["resource_record_name"]
type = element(module.acm.validation_domains, count.index)["resource_record_type"]
value = trimsuffix(element(module.acm.validation_domains, count.index)["resource_record_value"], ".")
ttl = 60
proxied = false
allow_overwrite = true
}