litellm/terraform/provider/litellm
ryan-crabbe-berri a109553909 fix(key): recover from a cascade-deleted key instead of failing the apply
Deleting a team cascade-deletes its keys, so `terraform apply -replace` on a
team left the key's `/key/update` 404ing and aborted the apply with the key
resource stuck. The update now confirms the key is really gone and recreates it
under the new team; a `team_id` change between two live teams stays an in-place
update, and an unrelated failure still errors out.

Rebased onto current staging, which added a typed `apiError` and `isNotFound`,
so the recovery matches on the status code plus a re-read rather than on the
error string. The metadata pre-read, which fails before `/key/update` is ever
reached when the key is gone, routes through the same recovery.

Original work by @matthowardcohere in #39747.

Claude-Session: https://claude.ai/code/session_01XT1qsbjLwnhiN5sQ2hNUxr
2026-09-12 11:58:44 -07:00
..
client.go fix(terraform): read key fields the proxy stores in metadata back from /key/info (#40513) 2026-09-10 03:10:42 +00:00
client_test.go feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
data_source_access_group.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_access_group_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_agent.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_agent_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_budget.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_budget_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_credential.go feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
data_source_fallback.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_fallback_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_guardrail.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_guardrail_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_key.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_key_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_mcp_server.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_mcp_server_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_model.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_model_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_organization.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_organization_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_project.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_project_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_prompt.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_prompt_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_search_tool.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_search_tool_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_tag.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_tag_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_team.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_team_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_unified_access_group.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_unified_access_group_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_user.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_user_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
data_source_vector_store.go feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
provider.go feat(terraform): add litellm_jwt_key_mapping resource (#38714) 2026-08-28 17:10:44 -07:00
provider_test.go feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
resource_access_group.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_access_group_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_agent.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_agent_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_budget.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_budget_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_credential.go feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
resource_credential_crud.go feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
resource_credential_crud_test.go feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
resource_fallback.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_fallback_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_guardrail.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_guardrail_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_jwt_key_mapping.go feat(terraform): add litellm_jwt_key_mapping resource (#38714) 2026-08-28 17:10:44 -07:00
resource_jwt_key_mapping_crud.go feat(terraform): add litellm_jwt_key_mapping resource (#38714) 2026-08-28 17:10:44 -07:00
resource_jwt_key_mapping_crud_test.go feat(terraform): add litellm_jwt_key_mapping resource (#38714) 2026-08-28 17:10:44 -07:00
resource_key.go fix(key): recover from a cascade-deleted key instead of failing the apply 2026-09-12 11:58:44 -07:00
resource_key_block.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_key_block_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_key_test.go fix(key): recover from a cascade-deleted key instead of failing the apply 2026-09-12 11:58:44 -07:00
resource_key_utils.go fix(terraform): send litellm_key model_max_budget as per-model BudgetConfig objects (#40450) 2026-09-09 19:46:26 -07:00
resource_mcp_server.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_mcp_server_crud.go feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
resource_mcp_server_crud_test.go feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
resource_model.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_model_crud.go feat(terraform): sync provider 0.3.0 from mirror and cut 0.4.0 2026-08-06 09:49:13 -07:00
resource_organization.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_organization_member.go feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
resource_organization_member_add.go feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
resource_organization_member_add_test.go feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
resource_organization_member_test.go feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
resource_organization_test.go feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
resource_project.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_project_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_prompt.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_prompt_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_search_tool.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_search_tool_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_tag.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_tag_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_team.go feat(terraform): allow custom team_id on litellm_team (#40459) 2026-09-09 19:45:02 -07:00
resource_team_block.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_team_block_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_team_member.go feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
resource_team_member_add.go feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
resource_team_member_test.go feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
resource_team_test.go feat(terraform): allow custom team_id on litellm_team (#40459) 2026-09-09 19:45:02 -07:00
resource_unified_access_group.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_unified_access_group_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_user.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_user_test.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_vector_store.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00
resource_vector_store_crud.go feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
resource_vector_store_crud_test.go feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241) 2026-07-07 09:16:59 -07:00
types.go feat(terraform): add litellm_jwt_key_mapping resource (#38714) 2026-08-28 17:10:44 -07:00
utils.go feat(terraform): resource and data source parity with the community provider (#38158) 2026-08-28 16:55:40 -07:00