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

openwebui_ollama_connections (Resource)

Manages the list of Ollama backend connections for Open WebUI. This is a singleton resource; the full list is replaced on every apply.

Example Usage

# The resource owns the whole list. Every apply replaces it, so a connection
# added by hand in the web UI disappears on the next apply.
resource "openwebui_ollama_connections" "example" {
  enabled = true

  connections = [
    {
      url             = "http://ollama.internal:11434"
      connection_type = "local"
      tags            = ["local"]
    },
    {
      url       = "https://ollama.example.com"
      key       = var.remote_ollama_key
      prefix_id = "remote"
      model_ids = ["llama3.2", "qwen2.5-coder"]
    },
  ]
}

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

Schema

Required

  • connections (Attributes List) Ordered list of Ollama connection entries. (see below for nested schema)
  • enabled (Boolean) Global toggle for all Ollama connections (ENABLE_OLLAMA_API).

Read-Only

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

Nested Schema for connections

Required:

  • url (String) Base URL of the Ollama backend, e.g. http://localhost:11434.

Optional:

  • connection_type (String) Connection type label, e.g. local. Stored as-is for model tagging.
  • enable (Boolean) Whether this specific connection is active. Defaults to true.
  • key (String, Sensitive) Optional API key for authenticated Ollama instances. Sensitive.
  • model_ids (List of String) Allowlist of model names exposed from this connection. Empty list exposes all models.
  • prefix_id (String) String prepended to every model name from this connection. Empty string disables prefixing.
  • tags (List of String) Labels attached to models from this connection.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# The Ollama connection list is one configuration block, so this resource is a
# singleton. Import it under its fixed id, and every connection comes with it.
# The API may return the connection keys masked, so confirm them after the
# import.
terraform import openwebui_ollama_connections.example ollama