» azurerm_search_service

Manages a Search Service.

» Example Usage

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_search_service" "example" {
  name                = "example-search-service"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
  sku                 = "standard"
}

» Arguments Reference

The following arguments are supported:

  • location - (Required) The Azure Region where the Search Service should exist. Changing this forces a new Search Service to be created.

  • name - (Required) The Name which should be used for this Search Service. Changing this forces a new Search Service to be created.

  • resource_group_name - (Required) The name of the Resource Group where the Search Service should exist. Changing this forces a new Search Service to be created.

  • sku - (Required) The SKU which should be used for this Search Service. Possible values are basic, free, standard, standard2 and standard3 Changing this forces a new Search Service to be created.


  • partition_count - (Optional) The number of partitions which should be created.

  • replica_count - (Optional) The number of replica's which should be created.

  • tags - (Optional) A mapping of tags which should be assigned to the Search Service.

» Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

  • id - The ID of the Search Service.

  • primary_key - The Primary Key used for Search Service Administration.

  • query_keys - A query_keys block as defined below.

  • secondary_key - The Secondary Key used for Search Service Administration.


A query_keys block exports the following:

  • key - The value of this Query Key.

  • name - The name of this Query Key.

» Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the Search Service.
  • read - (Defaults to 5 minutes) Used when retrieving the Search Service.
  • update - (Defaults to 30 minutes) Used when updating the Search Service.
  • delete - (Defaults to 30 minutes) Used when deleting the Search Service.

» Import

Search Services can be imported using the resource id, e.g.

terraform import azurerm_search_service.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Search/searchServices/service1