forked from hchenxa/ocp311_tf_aws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dns.tf
27 lines (26 loc) · 847 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
# Find the public hosted zone
data "aws_route53_zone" "base_dns" {
name = var.aws_base_dns_domain
private_zone = false
}
# Create a public DNS alias for Master load balancer
resource "aws_route53_record" "master_public_dns_record" {
zone_id = data.aws_route53_zone.base_dns.zone_id
name = local.cluster_master_domain
type = "A"
alias {
name = aws_lb.master_elb.dns_name
zone_id = aws_lb.master_elb.zone_id
evaluate_target_health = true
}
}
resource "aws_route53_record" "subdomain_public_dns_record" {
zone_id = data.aws_route53_zone.base_dns.zone_id
name = "*.${local.cluster_subdomain}"
type = "A"
alias {
name = aws_lb.master_elb.dns_name
zone_id = aws_lb.master_elb.zone_id
evaluate_target_health = true
}
}