forked from GuyBarros/terraform-com-showcase-pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvault_policies.tf
31 lines (27 loc) · 846 Bytes
/
vault_policies.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
# policies.tf
# Create the data for the policies
data "vault_policy_document" "admin_policy_content" {
rule {
path = "*"
capabilities = ["create", "read", "update", "delete", "list", "sudo"]
description = "Policy that allows everything. When given to a token in a namespace, will be like a namespace-root token"
}
}
data "vault_policy_document" "devs_policy_content" {
rule {
path = "developers/*"
capabilities = ["create", "read", "update", "delete", "list"]
description = ""
}
}
# add the policies
resource "vault_policy" "admin" {
provider = vault.app
name = "admin-policy"
policy = data.vault_policy_document.admin_policy_content.hcl
}
resource "vault_policy" "devs" {
provider = vault.app
name = "devs-policy"
policy = data.vault_policy_document.devs_policy_content.hcl
}