Manages a Search Service.
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_search_service" "example" {
name = "example-resource"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
sku = "standard"
}
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_search_service" "example" {
name = "example-resource"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
sku = "standard"
local_authentication_enabled = true
authentication_failure_mode = "http403"
}
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_search_service" "example" {
name = "example-resource"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
sku = "standard"
local_authentication_enabled = false
}
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 include basic
, free
, standard
, standard2
, standard3
, storage_optimized_l1
and storage_optimized_l2
. Changing this forces a new Search Service to be created.
allowed_ips
- (Optional) Specifies a list of inbound IPv4 or CIDRs that are allowed to access the Search Service. If the incoming IP request is from an IP address which is not included in the allowed_ips
it will be blocked by the Search Services firewall.authentication_failure_mode
- (Optional) Specifies the response that the Search Service should return for requests that fail authentication. Possible values include http401WithBearerChallenge
or http403
.customer_managed_key_enforcement_enabled
- (Optional) Specifies whether the Search Service should enforce that non-customer resources are encrypted. Defaults to false
.
hosting_mode
- (Optional) Specifies the Hosting Mode, which allows for High Density partitions (that allow for up to 1000 indexes) should be supported. Possible values are highDensity
or default
. Defaults to default
. Changing this forces a new Search Service to be created.
identity
- (Optional) An identity
block as defined below.
local_authentication_enabled
- (Optional) Specifies whether the Search Service allows authenticating using API Keys? Defaults to true
.
partition_count
- (Optional) Specifies the number of partitions which should be created. This field cannot be set when using a free
or basic
sku (see the Microsoft documentation). Possible values include 1
, 2
, 3
, 4
, 6
, or 12
. Defaults to 1
.
public_network_access_enabled
- (Optional) Specifies whether Public Network Access is allowed for this resource. Defaults to true
.
replica_count
- (Optional) Specifies the number of Replica's which should be created for this Search Service. This field cannot be set when using a free
sku (see the Microsoft documentation).
semantic_search_sku
- (Optional) Specifies the Semantic Search SKU which should be used for this Search Service. Possible values include free
and standard
.
tags
- (Optional) Specifies a mapping of tags which should be assigned to this Search Service.An identity
block supports the following:
type
- (Required) Specifies the type of Managed Service Identity that should be configured on this Search Service. The only possible value is SystemAssigned
.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.
An identity
block exports the following:
principal_id
- The Principal ID associated with this Managed Service Identity.
tenant_id
- The Tenant ID associated with this Managed Service Identity.
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 60 minutes) Used when creating the Search Service.read
- (Defaults to 5 minutes) Used when retrieving the Search Service.update
- (Defaults to 60 minutes) Used when updating the Search Service.delete
- (Defaults to 60 minutes) Used when deleting the Search Service.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