litellm/terraform/provider/docs/resources
devin-ai-integration[bot] 592518202c
feat(terraform): add litellm_jwt_key_mapping resource (#38714)
* feat(terraform): add litellm_jwt_key_mapping resource

Adds a Terraform resource for the proxy's JWT to virtual key mappings, so a
JWT client identified by a claim such as client_id, azp or sub maps to a
virtual key and inherits its models, budgets, rate limits and spend tracking.

Covers the four mapping endpoints: /jwt/key/mapping/new, /info, /update and
/delete. is_active is applied through a follow-up update because the create
endpoint always starts a mapping active, a dropped description is sent as an
empty string because the update endpoint ignores absent fields, changing the
mapped key rotates it in place, and changing the claim name or value forces
replacement since the update endpoint cannot change them.

* fix(terraform): revert key on failed jwt_key_mapping update

Classic SDKv2 persists a failed Update's diff-applied values to state
regardless of the error, so a rejected key rotation left the new key in
state while the proxy kept the old one and the next plan falsely converged.
Revert key via GetChange and resync description/is_active/computed fields
from a post-failure Read, since Read alone can't recover key (the proxy
never returns it).

Also drop the case-insensitive "mapping not found" body match: the proxy
raises 404 for all three not-found paths (info, update, delete), so
checking the status code alone is sufficient.

Clarify the docs: referencing a litellm_key resource's write-only key is
not a null-then-400 situation, it's a static "Missing required argument"
error at plan time, in every apply ordering.

* fix(terraform): stop leaving an active mapping behind on failed cleanup

Two issues flagged by review:

- Create has no way to ask the proxy for an inactive mapping, so an
  is_active=false mapping is briefly active while the follow-up
  deactivation runs. If that deactivation call itself fails, the mapping
  used to stay active and untracked. It's now deleted instead, closing
  the exposure rather than leaving it open indefinitely.
- On a failed update, only `key` was reverted before the recovery read.
  If that read also failed, description/is_active kept the rejected
  values, so a later plan could report false convergence. Now all three
  are reverted before the read runs.

Both come with regression tests, mutation-verified against the pre-fix
code.

* fix(deps): bump restrictedpython to 8.5 for GHSA-ffg3-p8fm-mjx2

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* chore: retrigger ci

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(tests): stub anthropic judge credentials in funnel seeding test

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* revert(deps): keep uv.lock unchanged to keep the PR terraform-only

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Fabrice Pont <fabrice.pont@doctolib.com>
Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-28 17:10:44 -07: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): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -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(terraform): add litellm_jwt_key_mapping resource (#38714) 2026-08-28 17:10:44 -07:00
key.md feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07: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): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -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): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07: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