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

openwebui_function_valves (Resource)

Configures the Valves (settings) of an Open WebUI function.

Example Usage

resource "openwebui_function" "example" {
  function_id = "content_filter"
  name        = "Content Filter"
  content     = file("${path.module}/functions/content_filter.py")
}

# Valves are the settings the function reads at run time. They live apart from
# the function, so changing one does not rewrite the code.
resource "openwebui_function_valves" "example" {
  function_id = openwebui_function.example.id

  valves_json = jsonencode({
    priority = 5
  })
}

Schema

Required

  • function_id (String) Identifier of the function whose valves to configure. Forces replacement.

Optional

  • valves_json (String) JSON object of valve values to apply. Keys must match the function's Valves schema. e.g. jsonencode({ priority = 5 }).

Read-Only

  • id (String) Terraform identifier. Always equal to function_id.
  • spec_json (String) JSON schema of the function's Valves class. Read-only; returned by Open WebUI.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# Valves belong to a function, so the import id is the function_id.
terraform import openwebui_function_valves.example content_filter