1 Resources ldap_config
Forgejo Actions edited this page 2026-11-26 06:34:52 +00:00

openwebui_ldap_config (Resource)

Manages the LDAP directory Open WebUI signs users in against, and the switch that enables LDAP sign-in.

Open WebUI stores the bind password in plain text and returns it on read, so it round-trips into Terraform state. Treat the state file as a secret.

Example Usage

# Open WebUI stores the bind password in plain text and returns it on read, so
# it lands in Terraform state. Keep the state file as secret as the password.
resource "openwebui_ldap_config" "example" {
  enable_ldap = true

  label                  = "Household directory"
  host                   = "ldap.example.com"
  port                   = 636
  use_tls                = true
  validate_cert          = true
  attribute_for_mail     = "mail"
  attribute_for_username = "uid"

  app_dn          = "cn=openwebui,ou=services,dc=example,dc=com"
  app_dn_password = var.ldap_bind_password
  search_base     = "ou=people,dc=example,dc=com"
  search_filters  = "(objectClass=inetOrgPerson)"

  enable_group_management = true
  enable_group_creation   = false
  attribute_for_groups    = "memberOf"
}

variable "ldap_bind_password" {
  type      = string
  sensitive = true
}

Schema

Optional

  • app_dn (String) Distinguished name Open WebUI binds with.
  • app_dn_password (String, Sensitive) Password for the bind DN. Open WebUI returns this value unmasked on read.
  • attribute_for_groups (String) Directory attribute holding group membership, e.g. memberOf. Open WebUI rejects an empty value while enable_group_management is true.
  • attribute_for_mail (String) Directory attribute holding the user's mail address, e.g. mail. Open WebUI rejects an empty value.
  • attribute_for_username (String) Directory attribute holding the username, e.g. uid. Open WebUI rejects an empty value.
  • certificate_path (String) Path to the CA certificate file used to verify the server.
  • ciphers (String) TLS cipher list, e.g. ALL.
  • enable_group_creation (Boolean) Whether Open WebUI creates a group it finds in the directory but not locally.
  • enable_group_management (Boolean) Whether Open WebUI reads group membership from the directory.
  • enable_ldap (Boolean) Whether users can sign in through LDAP.
  • host (String) Hostname or address of the LDAP server. Open WebUI rejects an empty value.
  • label (String) Name of the directory, shown on the sign-in page. Open WebUI rejects an empty value.
  • port (Number) Port of the LDAP server. Unset uses 389, or 636 with TLS.
  • search_base (String) Base DN the user search starts from. Open WebUI rejects an empty value.
  • search_filters (String) Extra LDAP filter applied to the user search.
  • use_tls (Boolean) Whether to connect over TLS.
  • validate_cert (Boolean) Whether to verify the server's certificate.

Read-Only

  • id (String) Identifier of this singleton resource. Always ldap.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# Open WebUI holds one LDAP configuration, so this resource is a singleton.
# Import it under its fixed id. The bind password comes back with it, unmasked,
# so treat the state file as a secret.
terraform import openwebui_ldap_config.example ldap