litellm/terraform/provider/litellm
Louis Vauterin b9ba36c231
fix(provider): accept 2xx status codes in unified_access_group create (#42461)
* fix(provider): accept 2xx status in handleResponse for access group create

handleResponse (resource_team.go) only accepted exactly HTTP 200, but
POST /v1/access_group (and its /v1/unified_access_group alias) legitimately
answers 201 Created. litellm_access_group and litellm_unified_access_group
create both succeeded on the proxy and failed in the provider, leaving the
group out of state and forcing an import to recover on the next apply's
409 for the now-duplicate name.

Same fix and shape as #40723, which widened this exact check in
sendRequest/handleAPIResponse/handleMCPAPIResponse for mcp_server, model,
key and organization_member. handleResponse is the one shared status-check
helper that fix didn't reach -- it's a different function in a different
file (resource_team.go, not client.go/utils.go), so this is fully
independent of that PR and can land before, after, or alongside it with
no conflict.

handleResponse is also used by agent, budget, guardrail, organization,
prompt, search_tool, tag, team, team_block, key_block, team_member(_add)
and user -- all unaffected in practice, since every one of their own
endpoints already answers exactly 200. Widening the check costs them
nothing and only changes behavior for the two resources that were
actually broken.

Verified: go test ./... passes, including a new
TestHandleResponseAcceptsFullSuccessRange table test covering
200/201/202/204 (accepted) and 400/404/409/500 (still rejected), mirroring
#40723's own TestHandleAPIResponseAcceptsFullSuccessRange.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix: address Greptile review on PR 42461

- CHANGELOG: narrowed the fix's scope to unified_access_group only.
  litellm_access_group (legacy) calls /access_group/new, a completely
  different, unrelated endpoint (model_access_group_management_endpoints.py)
  that already returns 200 -- it was never affected. I'd wrongly assumed
  both resources shared the same /v1/access_group route; they don't.
- resource_team_test.go: removed the preamble comment above the new test,
  which restated what the table test already shows -- against repository
  guidance (AGENTS.md) that reserves comments for complex logic, tool
  inputs, or TODOs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* chore: retrigger CI

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-28 13:54:37 -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): add display_name to litellm_model resource and model data sources (#42987) 2026-09-24 17:06:30 -05:00
data_source_model_test.go feat(terraform): add display_name to litellm_model resource and model data sources (#42987) 2026-09-24 17:06:30 -05: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): make credential adoption opt-in, escape names in request URLs 2026-09-15 10:41:44 -07:00
resource_credential_crud.go feat(terraform): make credential adoption opt-in, escape names in request URLs 2026-09-15 10:41:44 -07:00
resource_credential_crud_test.go feat(terraform): make credential adoption opt-in, escape names in request URLs 2026-09-15 10:41:44 -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(jwt-key-mapping): accept token_id as an alternative to the plaintext key 2026-09-15 23:15:20 +00:00
resource_jwt_key_mapping_crud.go feat(jwt-key-mapping): accept token_id as an alternative to the plaintext key 2026-09-15 23:15:20 +00:00
resource_jwt_key_mapping_crud_test.go feat(jwt-key-mapping): accept token_id as an alternative to the plaintext key 2026-09-15 23:15:20 +00:00
resource_key.go feat(terraform): expose server_metadata on litellm_key so undeclared metadata is visible (#42453) 2026-09-22 13:22:43 -05: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 feat(terraform): expose server_metadata on litellm_key so undeclared metadata is visible (#42453) 2026-09-22 13:22:43 -05: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): add display_name to litellm_model resource and model data sources (#42987) 2026-09-24 17:06:30 -05:00
resource_model_crud.go feat(terraform): add display_name to litellm_model resource and model data sources (#42987) 2026-09-24 17:06:30 -05:00
resource_model_test.go feat(terraform): add display_name to litellm_model resource and model data sources (#42987) 2026-09-24 17:06:30 -05: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 fix(provider): accept 2xx status codes in unified_access_group create (#42461) 2026-09-28 13:54:37 -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 refactor(terraform): drop explanatory comments from team_member_add 2026-09-15 21:02:12 +00:00
resource_team_member_add_test.go feat(terraform): add tpm_limit, rpm_limit, budget_duration, allowed_models to litellm_team_member_add 2026-09-15 21:02:12 +00: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 fix(provider): accept 2xx status codes in unified_access_group create (#42461) 2026-09-28 13:54:37 -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 display_name to litellm_model resource and model data sources (#42987) 2026-09-24 17:06:30 -05:00
utils.go feat(terraform): add display_name to litellm_model resource and model data sources (#42987) 2026-09-24 17:06:30 -05:00