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

openwebui_user (Resource)

Manages a user account in Open WebUI.

Group membership belongs to openwebui_group, which owns the users list. There is no route that sets a user's groups from the user's side.

Open WebUI protects the first account ever created, its primary admin. Nobody else can update it, it cannot give up its own admin role, and no one can delete it. This resource checks all three before it calls the API, so a plan that would demote or delete the primary admin fails instead of sending the request.

Example Usage

# The password is write-only: Terraform sends it to the provider and never
# records it. No route reads a password back, so a password changed elsewhere is
# invisible here. To rotate one, change the password and the marker together.
resource "openwebui_user" "kid" {
  name  = "Alex Doe"
  email = "alex@example.com"
  role  = "user"

  password         = var.sam_password
  password_version = "2026-08-14"
}

# Group membership belongs to the group, which owns the list of users.
resource "openwebui_group" "family" {
  name        = "Family"
  description = "Everyone in the house"
  users       = [openwebui_user.kid.email]
}

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

Schema

Required

  • email (String) Mail address the account signs in with. Must be lowercase, because Open WebUI lowercases the address it stores.
  • name (String) Display name of the account.

Optional

NOTE: Write-only arguments are supported in Terraform 1.11 and later.

  • password (String, Sensitive, Write-only) Password of the account. Required to create one. Terraform sends this value to the provider and never writes it to state, and no Open WebUI route reads a password back, so a password changed elsewhere is invisible here. Change password_version to send a new one.
  • password_version (String) Marker that triggers a password write. The provider sends the password only while creating the account and whenever this value changes, so an unrelated update never resets the password. Any text works, e.g. a date or a counter.
  • profile_image_url (String) Profile image of the account, as a path or a data URI.
  • role (String) Role of the account: pending, user, or admin. A new account is pending unless this says otherwise.

Read-Only

  • created_at (Number) Unix timestamp of when the account was created. Set by Open WebUI.
  • id (String) UUID assigned by Open WebUI on create.
  • last_active_at (Number) Unix timestamp of the account's last activity. Set by Open WebUI.
  • updated_at (Number) Unix timestamp of the account's last change. Set by Open WebUI.
  • username (String) Username of the account. Set by Open WebUI.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# A user is imported by the UUID Open WebUI assigned the account, not by the
# email address. No route reads a password back, so set password and
# password_version in the configuration after the import.
terraform import openwebui_user.kid 2f8e7d6c-5b4a-4392-8170-6f5e4d3c2b1a