litellm/terraform/provider/docs/resources
Louis Vauterin 3f7a344337 feat(jwt-key-mapping): accept token_id as an alternative to the plaintext key
A JWT key mapping can now name its virtual key by the SHA-256 hash the proxy
already stores, instead of only by the plaintext key.

litellm_key makes its generated key write-only so raw keys stay out of Terraform
state, and write-only attributes cannot be referenced at all, so the natural
wiring fails while planning, in every apply ordering:

  Error: Missing required argument
    with litellm_jwt_key_mapping.example
    key = litellm_key.example.key
    The argument "key" is required, but no definition was found.

The only way out today is supplying the plaintext from a variable or a secret
manager, which means the mapped key cannot be one the proxy generated and the
configuration has to carry a credential. The value the mapping stores is
hash_token(key), which is the same hash litellm_key already exports as
token_id, and a hash is not a credential, so accepting it closes the gap:

  resource "litellm_jwt_key_mapping" "service" {
    jwt_claim_name  = "client_id"
    jwt_claim_value = "reporting-service"
    token_id        = litellm_key.service.token_id
  }

CreateJWTKeyMappingRequest and UpdateJWTKeyMappingRequest gain an optional
token. Create requires exactly one of key or token, update accepts at most one,
and omitting both still leaves the mapped key alone. A supplied token must be 64
lowercase hex characters, because hash_token() hashes unconditionally and a
plaintext key sent as token would be stored as a hash of a hash, then silently
match nothing at auth time. Both rejections are 400s raised before the row is
written.

On the provider side, key becomes Optional with ExactlyOneOf{key, token_id} and
token_id is added next to it. token_id is not marked sensitive since a hash is
not a credential, both fields are omitempty on the wire so the proxy receives
only the one that was configured, and a failed update reverts token_id for the
same reason it already reverts key.

key keeps working unchanged and existing state is untouched. The only change to
it is Required to Optional, which no existing configuration can violate.
2026-09-15 23:15:20 +00:00
..
access_group.md feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
agent.md feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
budget.md feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
credential.md feat(terraform): make credential adoption opt-in, escape names in request URLs 2026-09-15 10:41:44 -07:00
fallback.md feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
guardrail.md feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
jwt_key_mapping.md feat(jwt-key-mapping): accept token_id as an alternative to the plaintext key 2026-09-15 23:15:20 +00:00
key.md fix(terraform): send changed litellm_key duration on /key/update so expires is recomputed (#40511) 2026-09-10 02:57:07 +00:00
key_block.md feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
mcp_server.md feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
model.md feat(terraform): sync provider 0.3.0 from mirror and cut 0.4.0 2026-08-06 09:49:13 -07:00
project.md feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
prompt.md feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
search_tool.md feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
tag.md feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
team.md feat(terraform): allow custom team_id on litellm_team (#40459) 2026-09-09 19:45:02 -07:00
team_block.md feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
team_member.md feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
team_member_add.md feat(terraform): add tpm_limit, rpm_limit, budget_duration, allowed_models to litellm_team_member_add 2026-09-15 21:02:12 +00:00
unified_access_group.md feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
user.md feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
vector_store.md feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00