-
Notifications
You must be signed in to change notification settings - Fork 12
/
cloudflare.tf
26 lines (22 loc) · 859 Bytes
/
cloudflare.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## cloudflare
# Add an IPv4 DNS record pointing to the CloudFront distribution
resource "cloudflare_record" "validation" {
count = length(module.acm.distinct_domain_names)
zone_id = var.cloudflare_zone
name = element(module.acm.validation_domains, count.index)["resource_record_name"]
type = element(module.acm.validation_domains, count.index)["resource_record_type"]
value = replace(element(module.acm.validation_domains, count.index)["resource_record_value"], "/.$/", "")
ttl = 60
proxied = false
allow_overwrite = true
depends_on = [module.acm.certificate]
}
resource "cloudflare_record" "domain_record" {
zone_id = var.cloudflare_zone
name = var.site_domain
type = "CNAME"
value = module.alb.lb_dns_name
ttl = var.dns_ttl
proxied = false
allow_overwrite = var.dns_allow_overwrite_records
}