-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathmain.tf
53 lines (43 loc) · 1.18 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
resource "consul_keys" "core_integration" {
count = var.core_integration ? 1 : 0
key {
path = "${var.consul_key_prefix}td-agent/README"
delete = true
value = <<EOF
This is used for integration with the `core` module.
See https://github.com/GovTechSG/terraform-modules/tree/master/modules/td-agent
EOF
}
}
resource "consul_keys" "consul" {
count = var.core_integration && var.consul_enabled ? 1 : 0
key {
path = "${var.consul_key_prefix}td-agent/consul/enabled"
value = "yes"
delete = true
}
}
resource "consul_keys" "nomad_server" {
count = var.core_integration && var.nomad_server_enabled ? 1 : 0
key {
path = "${var.consul_key_prefix}td-agent/nomad_server/enabled"
value = "yes"
delete = true
}
}
resource "consul_keys" "nomad_client" {
count = var.core_integration && var.nomad_client_enabled ? 1 : 0
key {
path = "${var.consul_key_prefix}td-agent/nomad_client/enabled"
value = "yes"
delete = true
}
}
resource "consul_keys" "vault" {
count = var.core_integration && var.vault_enabled ? 1 : 0
key {
path = "${var.consul_key_prefix}td-agent/vault/enabled"
value = "yes"
delete = true
}
}