-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathroute53.tf
28 lines (26 loc) · 929 Bytes
/
route53.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
data "aws_route53_zone" "this" {
count = var.is_create_route53_reccord ? 1 : 0
name = var.route53_zone_name
}
resource "aws_route53_record" "public" {
count = var.is_create_route53_reccord ? 1 : 0
zone_id = data.aws_route53_zone.this[0].zone_id
name = format("%s.%s", var.public_lb_vpn_domain, var.route53_zone_name)
type = "A"
alias {
name = aws_lb.public.dns_name
zone_id = aws_lb.public.zone_id
evaluate_target_health = true
}
}
resource "aws_route53_record" "private" {
count = var.is_create_private_lb && var.is_create_route53_reccord ? 1 : 0
zone_id = data.aws_route53_zone.this[0].zone_id
name = format("%s.%s", var.private_lb_vpn_domain, var.route53_zone_name)
type = "A"
alias {
name = aws_lb.private[0].dns_name
zone_id = aws_lb.private[0].zone_id
evaluate_target_health = true
}
}