This Terraform module is designed to create an Azure Cognitive Search service.
Due to the lack of native Terraform implementation for managing query keys, destroy operation is not supported and Terraform state needs to be refreshed after any query key modification to keep it up-to-date.
Module version | Terraform version | OpenTofu version | AzureRM version |
---|---|---|---|
>= 8.x.x | Unverified | 1.8.x | >= 4.0 |
>= 7.x.x | 1.3.x | >= 3.0 | |
>= 6.x.x | 1.x | >= 3.0 | |
>= 5.x.x | 0.15.x | >= 2.0 | |
>= 4.x.x | 0.13.x / 0.14.x | >= 2.0 | |
>= 3.x.x | 0.12.x | >= 2.0 | |
>= 2.x.x | 0.12.x | < 2.0 | |
< 2.x.x | 0.11.x | < 2.0 |
If you want to contribute to this repository, feel free to use our pre-commit git hook configuration which will help you automatically update and format some files for you by enforcing our Terraform code module best-practices.
More details are available in the CONTRIBUTING.md file.
This module is optimized to work with the Claranet terraform-wrapper tool
which set some terraform variables in the environment needed by this module.
More details about variables set by the terraform-wrapper
available in the documentation.
module "azure_region" {
source = "claranet/regions/azurerm"
version = "x.x.x"
azure_region = var.azure_region
}
module "rg" {
source = "claranet/rg/azurerm"
version = "x.x.x"
location = module.azure_region.location
client_name = var.client_name
environment = var.environment
stack = var.stack
}
module "logs" {
source = "claranet/run/azurerm//modules/logs"
version = "x.x.x"
client_name = var.client_name
environment = var.environment
stack = var.stack
location = module.azure_region.location
location_short = module.azure_region.location_short
resource_group_name = module.rg.resource_group_name
}
module "search_service" {
source = "claranet/search-service/azurerm"
version = "x.x.x"
location = module.azure_region.location
location_short = module.azure_region.location_short
client_name = var.client_name
environment = var.environment
stack = var.stack
resource_group_name = module.rg.resource_group_name
logs_destinations_ids = [module.logs.log_analytics_workspace_id]
}
Name | Version |
---|---|
azurecaf | ~> 1.2, >= 1.2.22 |
azurerm | ~> 3.78 |
null | ~> 3.0 |
Name | Source | Version |
---|---|---|
logging | claranet/diagnostic-settings/azurerm | ~> 7.0.0 |
Name | Type |
---|---|
azurerm_search_service.search_service | resource |
null_resource.query_key | resource |
azurecaf_name.search | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
ad_authentication_enabled | Whether Azure Active Directory authentication is enabled. | bool |
false |
no |
allowed_ips | List of IPs or CIDRs to allow for service access | list(string) |
[] |
no |
authentication_failure_mode | Specifies the response that the Search Service should return for requests that fail authentication (possible values are null , http401WithBearerChallenge or http403 ) |
string |
"http401WithBearerChallenge" |
no |
client_name | Client name/account used in naming | string |
n/a | yes |
custom_diagnostic_settings_name | Custom name of the diagnostics settings, name will be 'default' if not set. | string |
"default" |
no |
custom_name | Custom name for the Search Service. Generated if not set. | string |
"" |
no |
default_tags_enabled | Option to enable or disable default tags. | bool |
true |
no |
environment | Project environment | string |
n/a | yes |
extra_tags | Extra tags to set on each created resource. | map(string) |
{} |
no |
local_authentication_enabled | Whether API key authentication is enabled. | bool |
true |
no |
location | Azure location. | string |
n/a | yes |
location_short | Short string for Azure location. | string |
n/a | yes |
logs_categories | Log categories to send to destinations. | list(string) |
null |
no |
logs_destinations_ids | List of destination resources IDs for logs diagnostic destination. Can be Storage Account , Log Analytics Workspace and Event Hub . No more than one of each can be set.If you want to specify an Azure EventHub to send logs and metrics to, you need to provide a formated string with both the EventHub Namespace authorization send ID and the EventHub name (name of the queue to use in the Namespace) separated by the ` |
` character. | list(string) |
n/a |
logs_metrics_categories | Metrics categories to send to destinations. | list(string) |
null |
no |
name_prefix | Optional prefix for the generated name | string |
"" |
no |
name_suffix | Optional suffix for the generated name | string |
"" |
no |
partition_count | Provides index storage and I/O for read/write operations (for example, when rebuilding or refreshing an index). | number |
1 |
no |
public_network_access_enabled | Whether or not public network access is allowed for this resource. | bool |
true |
no |
query_keys | Names of the query keys to create | list(string) |
[] |
no |
replica_count | Instances of the search service, used primarily to load balance query operations. Each replica always hosts one copy of an index | number |
3 |
no |
resource_group_name | Resource group name | string |
n/a | yes |
semantic_search_sku | Specifies the Semantic Search SKU which should be used for this Search Service. | string |
null |
no |
sku | The SKU which should be used for this Search Service. Possible values are basic , free , standard , standard2 and standard3 . |
string |
"standard" |
no |
stack | Project stack name | string |
n/a | yes |
terraform_timeouts | (Optional) Allows to specify timeouts for certain Terraform actions (create, read, update, delete). | object({ |
null |
no |
use_caf_naming | Use the Azure CAF naming provider to generate default resource name. custom_name override this if set. Legacy default name is used if this is set to false . |
bool |
true |
no |
Name | Description |
---|---|
search_service_id | The ID of the Search Service. |
search_service_identity_principal_id | Service principal ID for the Search Service identity |
search_service_name | The name of the Search Service. |
search_service_primary_key | The Primary Key used for Search Service Administration. |
search_service_query_keys | Query keys |
search_service_query_keys_map | Query keys, returned as a map with array of values. |
search_service_secondary_key | The Secondary Key used for Search Service Administration. |
search_service_url | URL of the Search Service. |
Azure Cognitive Search service: docs.microsoft.com/en-us/azure/search/