litellm/terraform/provider/docs/resources/team_member.md
Yassin Kortam ce2582e9d0
feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI (#32241)
* feat(terraform): vendor terraform-provider-litellm as source of truth with endpoint drift CI

* fix(terraform): address review feedback on vendored provider

Replace deprecated io/ioutil with io. Remove the unused org/team CRUD
client methods so the endpoint audit only tracks live call sites
(54 -> 46). Redact request/response logs by parsing the JSON and
recursively masking sensitive fields, which fixes the nested-object
leak in the old credential_values regex, with a regex fallback for
non-JSON payloads; covered by new unit tests. Docs: stop showing
api_key inside vector store litellm_params and document that Sensitive
attributes still persist in plaintext state, recommending
litellm_credential_name and an encrypted state backend.

* fix(terraform): stop persisting server-returned litellm_params into vector store state

The vector store Read wrote litellm_params straight back from the API
response into state. The proxy redacts secrets in those responses, so
the readback overwrote user config with redaction sentinels and caused
perpetual diffs, and against a server that returns raw values it would
persist secrets into a non-Sensitive attribute. Read now preserves the
config value like the credential and model resources do, litellm_params
is marked Sensitive, and a regression test pins that a server-returned
api_key never lands in state

* fix(terraform): send role on team member update and stop persisting server env into MCP state

The team member update payload omitted role, and the proxy leaves role
unchanged when the field is absent, so a role downgrade reported as
applied by Terraform never took effect on the proxy. The update now
always sends the configured role (the attribute is Required).

The MCP server resource wrote env straight back from API responses
into a non-Sensitive attribute, pulling admin-visible secrets into
state and, for sanitized responses, blanking user config. Read now
preserves the config value, env is marked Sensitive, and the docs warn
against passing secrets via args. Regression tests cover both fixes
and fail against the previous behavior.
2026-07-07 09:16:59 -07:00

1.7 KiB

litellm_team_member Resource

Manages individual team member configurations in LiteLLM. This resource allows you to add, update, and remove team members with specific permissions and budget limits.

Example Usage

resource "litellm_team_member" "engineer" {
  team_id            = litellm_team.engineering.id
  user_id            = "user_3"
  user_email         = "engineer@example.com"
  role               = "user"
  max_budget_in_team = 200.0
}

Argument Reference

The following arguments are supported:

  • team_id - (Required) The ID of the team this member belongs to.

  • user_id - (Required) Unique identifier for the user.

  • user_email - (Required) Email address of the user.

  • role - (Required) The role of the team member. Valid values are:

    • org_admin
    • internal_user
    • internal_user_viewer
    • admin
    • user
  • max_budget_in_team - (Optional) Maximum budget allocated to this team member within the team's budget.

Attribute Reference

In addition to the arguments above, the following attributes are exported:

  • id - The unique identifier for the team member configuration. This is typically a composite of the team_id and user_id.

Import

Team members can be imported using the format team_id:user_id:

terraform import litellm_team_member.engineer <team_id>:<user_id>

Note: The team_id and user_id should match the values used in the resource configuration.

Security Note

Ensure that sensitive information such as user emails and IDs are handled securely. It's recommended to use variables or a secure secret management solution rather than hardcoding these values in your Terraform configuration files.