forked from dsaidgovsg/terraform-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
82 lines (63 loc) · 2.95 KB
/
main.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
locals {
# Base path after `consul_key_prefix`
path = "telegraf/"
}
resource "consul_keys" "core_integration" {
count = "${var.core_integration ? 1 : 0}"
key {
path = "${var.consul_key_prefix}${local.path}README"
delete = true
value = <<EOF
This is used for integration with the `core` module.
See https://github.com/GovTechSG/terraform-modules/tree/master/modules/telegraf
EOF
}
}
module "consul" {
source = "server_type"
server_type = "consul"
enabled = "${var.consul_enabled}"
path = "${local.path}"
output_elastisearch = "${var.consul_output_elastisearch}"
output_elasticsearch_service_name = "${var.consul_output_elasticsearch_service_name}"
output_prometheus = "${var.consul_output_prometheus}"
output_prometheus_service_name = "${var.consul_output_prometheus_service_name}"
output_prometheus_service_port = "${var.consul_output_prometheus_service_port}"
output_prometheus_service_cidrs = "${var.consul_output_prometheus_service_cidrs}"
}
module "nomad_server" {
source = "server_type"
server_type = "nomad_server"
enabled = "${var.nomad_server_enabled}"
path = "${local.path}"
output_elastisearch = "${var.nomad_server_output_elastisearch}"
output_elasticsearch_service_name = "${var.nomad_server_output_elasticsearch_service_name}"
output_prometheus = "${var.nomad_server_output_prometheus}"
output_prometheus_service_name = "${var.nomad_server_output_prometheus_service_name}"
output_prometheus_service_port = "${var.nomad_server_output_prometheus_service_port}"
output_prometheus_service_cidrs = "${var.nomad_server_output_prometheus_service_cidrs}"
}
module "nomad_client" {
source = "server_type"
server_type = "nomad_client"
enabled = "${var.nomad_client_enabled}"
path = "${local.path}"
output_elastisearch = "${var.nomad_client_output_elastisearch}"
output_elasticsearch_service_name = "${var.nomad_client_output_elasticsearch_service_name}"
output_prometheus = "${var.nomad_client_output_prometheus}"
output_prometheus_service_name = "${var.nomad_client_output_prometheus_service_name}"
output_prometheus_service_port = "${var.nomad_client_output_prometheus_service_port}"
output_prometheus_service_cidrs = "${var.nomad_client_output_prometheus_service_cidrs}"
}
module "vault" {
source = "server_type"
server_type = "vault"
enabled = "${var.vault_enabled}"
path = "${local.path}"
output_elastisearch = "${var.vault_output_elastisearch}"
output_elasticsearch_service_name = "${var.vault_output_elasticsearch_service_name}"
output_prometheus = "${var.vault_output_prometheus}"
output_prometheus_service_name = "${var.vault_output_prometheus_service_name}"
output_prometheus_service_port = "${var.vault_output_prometheus_service_port}"
output_prometheus_service_cidrs = "${var.vault_output_prometheus_service_cidrs}"
}