-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroute_53.tf
25 lines (23 loc) · 853 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
resource "aws_route53_zone" "my_domain" {
name = var.DOMAIN_NAME
}
resource "aws_route53_record" "domain_record_A_1" {
zone_id = aws_route53_zone.my_domain.zone_id
name = var.DOMAIN_NAME
type = "A"
alias {
name = replace(aws_cloudfront_distribution.s3_distribution.domain_name, "/[.]$/", "")
zone_id = aws_cloudfront_distribution.s3_distribution.hosted_zone_id
evaluate_target_health = true
}
}
resource "aws_route53_record" "domain_record_A_2" {
zone_id = aws_route53_zone.my_domain.zone_id
name = var.WWW_DOMAIN_NAME
type = "A"
alias {
name = replace(aws_cloudfront_distribution.s3_distribution.domain_name, "/[.]$/", "")
zone_id = aws_cloudfront_distribution.s3_distribution.hosted_zone_id
evaluate_target_health = true
}
}