-
Notifications
You must be signed in to change notification settings - Fork 0
/
dns.tf
80 lines (67 loc) · 1.85 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
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# INTERNAL DNS SERVER
resource "aws_route53_zone" "private" {
name = var.domain_name
vpc {
vpc_id = aws_vpc.main.id
}
}
# EXTERNAL DNS SERVER
resource "aws_route53_zone" "public" {
name = var.public_domain_name
}
resource "aws_route53_record" "httpdpub" {
zone_id = aws_route53_zone.public.zone_id
name = "machine-httpd.${var.public_domain_name}"
type = "A"
ttl = "300"
records = [aws_eip.httpd.public_ip]
}
resource "aws_route53_record" "httpd" {
zone_id = aws_route53_zone.private.zone_id
name = "httpd"
type = "A"
ttl = "300"
records = [aws_instance.httpd.private_ip]
}
resource "aws_route53_record" "nexusHttpProxy" {
zone_id = aws_route53_zone.public.zone_id
name = "nexus.${var.public_domain_name}"
type = "A"
ttl = "300"
records = [aws_eip.httpd.public_ip]
}
resource "aws_route53_record" "nexuspub" {
zone_id = aws_route53_zone.public.zone_id
name = "machine-nexus.${var.public_domain_name}"
type = "A"
ttl = "300"
records = [aws_instance.nexus.public_ip]
}
resource "aws_route53_record" "nexus" {
zone_id = aws_route53_zone.private.zone_id
name = "nexus"
type = "A"
ttl = "300"
records = [aws_instance.nexus.private_ip]
}
resource "aws_route53_record" "jenkinsHttpProxy" {
zone_id = aws_route53_zone.public.zone_id
name = "jenkins.${var.public_domain_name}"
type = "A"
ttl = "300"
records = [aws_eip.httpd.public_ip]
}
resource "aws_route53_record" "jenkinspub" {
zone_id = aws_route53_zone.public.zone_id
name = "machine-jenkins.${var.public_domain_name}"
type = "A"
ttl = "300"
records = [aws_instance.jenkins.public_ip]
}
resource "aws_route53_record" "jenkins" {
zone_id = aws_route53_zone.private.zone_id
name = "jenkins"
type = "A"
ttl = "300"
records = [aws_instance.jenkins.private_ip]
}