-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdns-records.tf
83 lines (78 loc) · 2.14 KB
/
dns-records.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
79
80
81
82
83
######
# svcs
######
//variable "all_enabled" {
// description = "Bool to enable all services"
// type = bool
// default = true
//}
//
//variable "consul_enabled" {
// description = "Bool to enable consul"
// type = bool
// default = true
//}
//variable "elb_host_name" {}
//variable "domain_name" {
// description = "The root domain - leave blank for no dns"
// type = string
// default = ""
//}
//variable "elasticsearch_enabled" {
// description = "Bool to enable elasticsearch"
// type = bool
// default = true
//}
//
//variable "prometheus_enabled" {
// description = "Bool to enable prometheus"
// type = bool
// default = true
//}
//
//
//locals {
// prometheus_enabled = var.all_enabled ? true : var.prometheus_enabled
// consul_enabled = var.all_enabled ? true : var.consul_enabled
// elasticsearch_enabled = var.all_enabled ? true : var.elasticsearch_enabled
//}
//data "aws_route53_zone" "this" {
// count = var.domain_name != "" ? 1 : 0
// name = "${var.domain_name}."
//}
//// TODO: Move to aws k8s
//resource "aws_route53_record" "prom-record" {
// count = var.prometheus_enabled && local.dns_enabled ? 1 : 0
//
// allow_overwrite = true
// name = join(".", ["prometheus", var.root_domain_name])
// ttl = 30
// type = "CNAME"
// zone_id = data.aws_route53_zone.this.*.id
//
// records = [var.elb_host_name]
//}
//
//resource "aws_route53_record" "graf-record" {
// count = var.prometheus_enabled && local.dns_enabled ? 1 : 0
//
// allow_overwrite = true
// name = join(".", ["grafana", var.root_domain_name])
// ttl = 30
// type = "CNAME"
// zone_id = data.aws_route53_zone.this.*.id
//
// records = [var.elb_host_name]
//}
//
//resource "aws_route53_record" "alertman-record" {
// count = var.prometheus_enabled && local.dns_enabled ? 1 : 0
//
// allow_overwrite = true
// name = join(".", ["alertman", var.root_domain_name])
// ttl = 30
// type = "CNAME"
// zone_id = data.aws_route53_zone.this.*.id
//
// records = [var.elb_host_name]
//}