homelab/vault/main.tf
2022-07-15 14:06:31 +02:00

34 lines
571 B
HCL

terraform {
backend "consul" {
path = "terraform/vault"
}
}
provider vault {
token = var.vault_token
}
locals {
allowed_policies= [
"access-tables"
]
}
resource "vault_token_auth_backend_role" "nomad-cluster" {
role_name = "nomad-cluster"
orphan = true
renewable = true
token_explicit_max_ttl = "0"
token_period = "259200"
allowed_policies = local.allowed_policies
}
resource "vault_mount" "kvv2-secret" {
path = "secrets"
type = "kv"
options = {
version = "2"
}
}