-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathdns.tf
33 lines (26 loc) · 1.05 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
resource "google_dns_record_set" "public" {
count = var.dns_enabled ? 1 : 0
name = format("%s.%s.", var.dns_record_set_name_prefix, var.dns_managed_zone_dns_name)
type = "A"
ttl = 300
managed_zone = google_dns_managed_zone.nomad.0.name
rrdatas = [module.load_balancer.external_ip]
}
resource "google_dns_managed_zone" "nomad" {
count = var.dns_enabled ? 1 : 0
name = "nomad"
dns_name = format("%s.", var.dns_managed_zone_dns_name)
}
resource "google_dns_record_set" "grafana_public" {
count = (var.dns_enabled && var.grafana_dns_managed_zone_dns_name != "") ? 1 : 0
name = format("%s.%s.", var.grafana_dns_record_set_name_prefix, var.grafana_dns_managed_zone_dns_name)
type = "A"
ttl = 300
managed_zone = google_dns_managed_zone.grafana.0.name
rrdatas = [module.grafana_load_balancer.external_ip]
}
resource "google_dns_managed_zone" "grafana" {
count = (var.dns_enabled && var.grafana_dns_managed_zone_dns_name != "") ? 1 : 0
name = "grafana"
dns_name = format("%s.", var.grafana_dns_managed_zone_dns_name)
}