Skip to content

libre-devops/terraform-azurerm-search-service

Repository files navigation

resource "azurerm_search_service" "this" {
  for_each                                 = { for instance in var.search_services : instance.name => instance }
  location                                 = each.value.location
  name                                     = each.value.name
  resource_group_name                      = each.value.rg_name
  sku                                      = lower(each.value.sku)
  allowed_ips                              = try(each.value.allowed_ips, [])
  authentication_failure_mode              = each.value.authentication_failure_mode
  customer_managed_key_enforcement_enabled = each.value.customer_managed_key_enforcement_enabled
  hosting_mode                             = each.value.hosting_mode
  local_authentication_enabled             = each.value.local_authentication_enabled
  partition_count                          = each.value.partition_count
  public_network_access_enabled            = each.value.public_network_access_enabled
  replica_count                            = each.value.replica_count
  semantic_search_sku                      = each.value.semantic_search_sku


  dynamic "identity" {
    for_each = each.value.identity_type == "SystemAssigned" ? [each.value.identity_type] : []
    content {
      type = each.value.identity_type
    }
  }

  dynamic "identity" {
    for_each = each.value.identity_type == "SystemAssigned, UserAssigned" ? [each.value.identity_type] : []
    content {
      type         = each.value.identity_type
      identity_ids = try(each.value.identity_ids, [])
    }
  }


  dynamic "identity" {
    for_each = each.value.identity_type == "UserAssigned" ? [each.value.identity_type] : []
    content {
      type         = each.value.identity_type
      identity_ids = length(try(each.value.identity_ids, [])) > 0 ? each.value.identity_ids : []
    }
  }
}

Requirements

No requirements.

Providers

Name Version
azurerm n/a

Modules

No modules.

Resources

Name Type
azurerm_search_service.this resource

Inputs

Name Description Type Default Required
search_services The search services to make
list(object({
name = string
rg_name = string
location = optional(string, "uksouth")
tags = map(string)
sku = string
allowed_ips = optional(list(string))
authentication_failure_mode = optional(string, "http403")
customer_managed_key_enforcement_enabled = optional(bool)
hosting_mode = optional(string, "default")
identity_ids = optional(list(string))
identity_type = optional(string)
local_authentication_enabled = optional(bool)
partition_count = optional(number)
public_network_access_enabled = optional(bool)
replica_count = optional(number)
semantic_search_sku = optional(string)
}))
n/a yes

Outputs

Name Description
search_service_identity_principal_ids The Principal IDs associated with the Managed Service Identities of all Search Service instances.
search_service_identity_tenant_ids The Tenant IDs associated with the Managed Service Identities of all Search Service instances.
search_service_ids The IDs of all the Search Service instances.
search_service_primary_keys The Primary Keys used for Search Service Administration.
search_service_query_keys The Query Keys of all Search Service instances.
search_service_secondary_keys The Secondary Keys used for Search Service Administration.

About

A module used to deploy Azure Search Service ๐Ÿ”Ž

Resources

License

Stars

Watchers

Forks

Packages

No packages published