-
Notifications
You must be signed in to change notification settings - Fork 0
/
route_53.tf
32 lines (27 loc) · 860 Bytes
/
route_53.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
27
28
29
30
31
32
### Route 53 Records ###
# Route 53 Alias Record
resource "aws_route53_record" "cv" {
zone_id = var.route_53_zone_id
name = var.domain_name
type = "A"
alias {
name = aws_cloudfront_distribution.cv_distribution.domain_name
zone_id = aws_cloudfront_distribution.cv_distribution.hosted_zone_id
evaluate_target_health = true
}
}
# Route 53 Cert Validation
resource "aws_route53_record" "cv_cert_validation" {
for_each = {
for dvo in aws_acm_certificate.cv_distribution_cert.domain_validation_options : dvo.domain_name => {
name = dvo.resource_record_name
record = dvo.resource_record_value
type = dvo.resource_record_type
}
}
name = each.value.name
type = each.value.type
zone_id = var.route_53_zone_id
records = [each.value.record]
ttl = 60
}