litellm/terraform/provider/docs/resources/search_tool.md
Shivam Rawat 3653e5893f
feat(terraform): resource and data source parity with the community provider (#38158)
* feat(terraform): close key/team schema gaps, fix team read envelope, add import support

* feat(terraform): add fallback resource/data source and key/team block resources

* feat(terraform): add access group and unified access group resources and data sources

* feat(terraform): add guardrail and prompt resources and data sources

* feat(terraform): add agent and search tool resources and data sources

* feat(terraform): add user and budget resources and data sources

* feat(terraform): add tag and project resources and data sources

* docs(terraform): changelog and readme for parity additions

* feat(terraform): add data sources for keys, teams, models, organizations, and mcp servers

* fix(terraform): key update 400 on empty budget_duration, key info envelope, config-supplied key

* fix(terraform): hash raw keys to SHA-256 tokens in key lookup URLs and block resource IDs
2026-08-28 16:55:40 -07:00

1.6 KiB

litellm_search_tool Resource

Manages a search tool configuration on the LiteLLM proxy. Search tools connect the proxy's /search endpoints to an external search provider such as Tavily, Perplexity, or Exa.

Example Usage

resource "litellm_search_tool" "tavily" {
  search_tool_name = "tavily-search"

  litellm_params = jsonencode({
    search_provider = "tavily"
    api_key         = var.tavily_api_key
  })

  search_tool_info = jsonencode({
    description = "Tavily web search"
  })
}

Argument Reference

The following arguments are supported:

  • search_tool_name - (Required) Name of the search tool.
  • litellm_params - (Required, Sensitive) Search tool parameters as a JSON object string (use jsonencode). Must include search_provider, and typically an api_key; may also carry api_base, timeout, max_retries, and other provider options. The API only returns masked values, so this is never read back; the configured value is authoritative.
  • search_tool_info - (Optional) Additional metadata as a JSON object string, e.g. a description.

Attribute Reference

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

  • id - The search tool ID assigned by LiteLLM.
  • created_at - Timestamp when the search tool was created.
  • updated_at - Timestamp when the search tool was last updated.

Import

Search tools can be imported using the search tool ID:

terraform import litellm_search_tool.example <search_tool_id>

Note: litellm_params cannot be recovered on import because the API only returns masked values; re-apply after import to set it.