-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnomad_policies.tf
More file actions
56 lines (48 loc) · 1007 Bytes
/
nomad_policies.tf
File metadata and controls
56 lines (48 loc) · 1007 Bytes
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
# This policy doesn't just assemble other policies because it needs to
# be able to assign an acl policy, and is purpose built for the nomad
# server.
resource "consul_acl_policy" "nomad_server" {
count = var.configure_for_nomad ? 1 : 0
name = "resin-nomad-server"
description = "Policy for Nomad server"
rules = jsonencode({
agent_prefix = {
"" = {
policy = "read"
}
}
node_prefix = {
"" = {
policy = "read"
}
}
service_prefix = {
"" = {
policy = "write"
}
}
acl = "write"
})
}
resource "consul_acl_policy" "nomad_client" {
count = var.configure_for_nomad ? 1 : 0
name = "resin-nomad-client"
description = "Policy for Nomad client"
rules = jsonencode({
agent_prefix = {
"" = {
policy = "read"
}
}
node_prefix = {
"" = {
policy = "read"
}
}
service_prefix = {
"" = {
policy = "write"
}
}
})
}