mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
* feat(terraform): close key/team schema gaps, fix team read envelope, add import support * feat(terraform): add fallback resource/data source and key/team block resources * feat(terraform): add access group and unified access group resources and data sources * feat(terraform): add guardrail and prompt resources and data sources * feat(terraform): add agent and search tool resources and data sources * feat(terraform): add user and budget resources and data sources * feat(terraform): add tag and project resources and data sources * docs(terraform): changelog and readme for parity additions * feat(terraform): add data sources for keys, teams, models, organizations, and mcp servers * fix(terraform): key update 400 on empty budget_duration, key info envelope, config-supplied key * fix(terraform): hash raw keys to SHA-256 tokens in key lookup URLs and block resource IDs
66 lines
2.5 KiB
Markdown
66 lines
2.5 KiB
Markdown
# litellm_user Resource
|
|
|
|
Manages an internal user on the LiteLLM proxy. Internal users can log into the Admin UI, own API keys, and belong to teams
|
|
|
|
## Example Usage
|
|
|
|
```hcl
|
|
resource "litellm_user" "alice" {
|
|
user_email = "alice@example.com"
|
|
user_alias = "Alice"
|
|
user_role = "internal_user"
|
|
max_budget = 100.0
|
|
budget_duration = "30d"
|
|
tpm_limit = 100000
|
|
rpm_limit = 1000
|
|
teams = [litellm_team.engineering.id]
|
|
models = ["gpt-4o", "claude-sonnet-4-5"]
|
|
|
|
metadata = {
|
|
department = "engineering"
|
|
}
|
|
|
|
model_max_budget = jsonencode({
|
|
"gpt-4o" = {
|
|
max_budget = 25.0
|
|
}
|
|
})
|
|
}
|
|
```
|
|
|
|
## Argument Reference
|
|
|
|
- `user_id` (Optional, Forces new resource) - Unique ID for the user. Generated by the server if not provided
|
|
- `user_email` (Optional) - Email address of the user
|
|
- `user_alias` (Optional) - Descriptive name for the user
|
|
- `user_role` (Optional) - Role of the user. One of `proxy_admin`, `proxy_admin_viewer`, `internal_user`, `internal_user_viewer`
|
|
- `teams` (Optional) - List of team IDs the user belongs to
|
|
- `models` (Optional) - Models the user is allowed to call
|
|
- `max_budget` (Optional) - Maximum budget in USD for the user
|
|
- `budget_duration` (Optional) - Budget reset period, e.g. `30s`, `30m`, `30d`
|
|
- `tpm_limit` (Optional) - Tokens per minute limit
|
|
- `rpm_limit` (Optional) - Requests per minute limit
|
|
- `max_parallel_requests` (Optional) - Maximum number of parallel requests
|
|
- `metadata` (Optional) - Map of metadata for the user
|
|
- `auto_create_key` (Optional, Default `true`, Forces new resource) - Whether to auto-create an API key on creation
|
|
- `send_invite_email` (Optional, Default `false`, Forces new resource) - Whether to send an invite email on creation
|
|
- `key_alias` (Optional) - Alias for the auto-created API key
|
|
- `aliases` (Optional) - Map of model aliases for the user
|
|
- `config` (Optional) - Map of config values for the user
|
|
- `permissions` (Optional) - Map of permission values for the user
|
|
- `model_max_budget` (Optional) - JSON string of per-model budget config, e.g. `jsonencode({"gpt-4o" = {max_budget = 10.0}})`
|
|
- `guardrails` (Optional) - List of guardrails applied to the user's requests
|
|
- `blocked` (Optional, Default `false`) - Whether the user is blocked from making requests
|
|
|
|
## Attribute Reference
|
|
|
|
- `id` - The user ID
|
|
- `key` (Sensitive) - The auto-created API key for the user, populated when `auto_create_key` is `true`
|
|
|
|
## Import
|
|
|
|
Users can be imported using the user ID:
|
|
|
|
```shell
|
|
terraform import litellm_user.alice <user-id>
|
|
```
|