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
1.9 KiB
1.9 KiB
| page_title | subcategory | description |
|---|---|---|
| litellm_key Data Source - terraform-provider-litellm | Retrieves information about an existing LiteLLM API key. |
litellm_key (Data Source)
Retrieves information about an existing LiteLLM API key via /key/info. Pass either the raw key or its hashed token. The raw key value is never written to state beyond the input you provide; the data source ID is the hashed token.
Example Usage
data "litellm_key" "ci" {
key = var.ci_key_hash
}
output "ci_key_team" {
value = data.litellm_key.ci.team_id
}
Argument Reference
The following arguments are supported:
key- (Required, Sensitive) The API key (or its hash) to look up.
Attributes Reference
In addition to all arguments above, the following attributes are exported:
token_id- Hashed token identifier of the key (safe to store in state).key_name- Redacted display name of the key.key_alias- User-friendly alias for the key.models- List of models this key can access.spend- Amount spent by this key.max_budget- Maximum budget for this key.user_id- User ID associated with this key.team_id- Team ID associated with this key.organization_id- Organization ID associated with this key.tpm_limit- Tokens per minute limit.rpm_limit- Requests per minute limit.max_parallel_requests- Maximum parallel requests allowed.budget_duration- Budget reset duration.metadata- Map of string metadata values for the key.tags- Tags attached to the key.blocked- Whether the key is blocked.expires- Expiry timestamp, if set.created_at- Timestamp when the key was created.updated_at- Timestamp when the key was last updated.
Security Note
The raw key value is only used to perform the lookup; it is never exported as an attribute or used as the data source ID.