-
Notifications
You must be signed in to change notification settings - Fork 0
/
route53.tf
60 lines (53 loc) · 1.65 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
resource "aws_route53_zone" "ddc" {
name = "${var.domainname}"
comment = "${var.name_prefix} DDC zone"
}
resource "aws_route53_record" "ddc-ns" {
zone_id = "${aws_route53_zone.ddc.zone_id}"
name = "${var.domainname}"
type = "NS"
ttl = "30"
records = [
"${aws_route53_zone.ddc.name_servers.0}",
"${aws_route53_zone.ddc.name_servers.1}",
"${aws_route53_zone.ddc.name_servers.2}",
"${aws_route53_zone.ddc.name_servers.3}"
]
}
resource "aws_route53_record" "ucp" {
zone_id = "${aws_route53_zone.ddc.zone_id}"
name = "${var.ucp_dns}.${var.domainname}."
type = "CNAME"
ttl = "300"
records = ["${aws_elb.ucp.dns_name}"]
}
resource "aws_route53_record" "dtr" {
zone_id = "${aws_route53_zone.ddc.zone_id}"
name = "${var.dtr_dns}.${var.domainname}."
type = "CNAME"
ttl = "300"
records = ["${aws_elb.dtr.dns_name}"]
}
resource "aws_route53_record" "apps" {
zone_id = "${aws_route53_zone.ddc.zone_id}"
name = "*.${var.apps_dns}.${var.domainname}."
type = "CNAME"
ttl = "300"
records = ["${aws_elb.apps.dns_name}"]
}
resource "aws_route53_record" "ucp-manager" {
count = "${var.ucp_manager_count}"
zone_id = "${aws_route53_zone.ddc.zone_id}"
name = "ucp-manager${count.index + 1}.${var.domainname}"
type = "A"
ttl = "300"
records = ["${element(aws_instance.ucp-manager.*.public_ip, count.index)}"]
}
resource "aws_route53_record" "ucp-worker" {
count = "${var.ucp_worker_count}"
zone_id = "${aws_route53_zone.ddc.zone_id}"
name = "ucp-worker${count.index + 1}.${var.domainname}"
type = "A"
ttl = "300"
records = ["${element(aws_instance.ucp-worker.*.public_ip, count.index)}"]
}