homelab/terraform/vault/ldap.tf

20 lines
647 B
Terraform
Raw Permalink Normal View History

2022-08-10 17:30:38 +00:00
resource "vault_ldap_auth_backend" "ldap" {
path = "ldap"
2023-11-17 19:03:33 +00:00
url = "ldap://ldap.ducamps.eu"
2022-08-10 17:30:38 +00:00
userdn = "dc=ducamps,dc=win"
userattr = "uid"
discoverdn = false
groupdn = "cn=groups,dc=ducamps,dc=win"
groupfilter = "(|(memberUid={{.Username}})(member={{.UserDN}})(uniqueMember={{.UserDN}}))"
binddn = "uid=vaultserviceaccount,cn=users,dc=ducamps,dc=win"
groupattr = "cn"
bindpass = var.ldap_bindpass
}
resource "vault_ldap_auth_backend_group" "vault_admin" {
groupname = "vault_admin"
policies = ["admin_policy"]
backend = vault_ldap_auth_backend.ldap.path
}