-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdns.tf
32 lines (29 loc) · 1.08 KB
/
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
# Create customer zone
resource "aws_route53_zone" "customer" {
name = "${concat(var.customer,".",var.domain_base)}"
}
# Create environment zone
resource "aws_route53_zone" "environment" {
name = "${concat(,var.environment,".",var.customer,".",var.domain_base)}"
}
# Create A record for external load balancer address
resource "aws_route53_record" "ext_lb_name" {
zone_id = "${aws_route53_zone.environment.zone_id}"
name = "${concat(var.ext_lb_name,".",var.environment,".",var.customer,".",var.domain_base)}"
type = "A"
ttl = "10"
records = ["${openstack_compute_floatingip_v2.float1.address}"]
}
# Create NS record for environment
resource "aws_route53_record" "environment-ns" {
zone_id = "${aws_route53_zone.environment.zone_id}"
name = "${concat(var.environment,".",var.customer,".",var.domain_base)}"
type = "NS"
ttl = "10"
records = [
"${aws_route53_zone.environment.name_servers.0}",
"${aws_route53_zone.environment.name_servers.1}",
"${aws_route53_zone.environment.name_servers.2}",
"${aws_route53_zone.environment.name_servers.3}"
]
}