-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdns.tf
33 lines (30 loc) · 895 Bytes
/
dns.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
33
# #########################################
# Route53 zone
# #########################################
data "aws_route53_zone" "primary" {
count = local.enable_dns_count
provider = aws.root
name = var.route53_zone
private_zone = false
}
# #########################################
# DNS Records
# #########################################
resource "aws_route53_record" "interop" {
count = local.enable_dns_count
provider = aws.root
zone_id = data.aws_route53_zone.primary[0].id
name = var.interop_dns
type = "A"
alias {
name = aws_api_gateway_domain_name.main[0].cloudfront_domain_name
zone_id = aws_api_gateway_domain_name.main[0].cloudfront_zone_id
evaluate_target_health = true
}
lifecycle {
create_before_destroy = true
}
depends_on = [
aws_api_gateway_domain_name.main
]
}