Introduction

Sitecore Solr Terraform module provides a flexible and easy-to-use solution for configuring and managing Solr for Sitecore. It automates the process of installing Solr, setting up the required Solr cores, and configuring Sitecore to use Solr as the search provider. The module is highly configurable and allows for customization of various Solr and Sitecore settings to fit the specific needs of your Sitecore implementation.

Target Audience: Sitecore developers and administrators

Architecture

Below is the Architecture diagram of the end result that you are going to achieve when you use the module.

Compatibility

This module supports setup of Solr for Sitecore XP 9.0.0 to 10.3.0 and supports both XP single and Scaled instances.

Sitecore Solr Compatibility Table: https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB0227897

How to use the module

In your Terraform file, add the module as shown below by configuring the available parameters listed in next section.

module "sitecoresolr" {
  source  = "codeblitzmaster/sitecoresolr/azurerm"
  version = "1.0.0"
  # insert the parameters
}

Terraform Registry Module:
https://registry.terraform.io/modules/codeblitzmaster/sitecoresolr/azurerm/latest

Source Code:
https://github.com/codeblitzmaster/terraform-azurerm-sitecoresolr

Available Parameters

NameDescriptionTypeDefaultRequired
admin_usernameVM Admin Username [Note: Password would be auto generated]string"adminuser"no
clientCode name of the client. Must have 3 alphanumeric chars.stringn/ayes
environmentEnvironment code (LAB, DEV, TST, STG, PROD, DR).string"DEV"no
locationAzure region to use for deployment.stringn/ayes
projectCode name of the subproject. Must have 4 alphanumeric chars.stringn/ayes
resource_group_nameResource group name for deployment.stringn/ayes
sitecore_versionSupports Sitecore Version 9.0.0 to 10.3.0string"10.3.0"no
tagsThe tags to associate with your resources.map{
“company”: “Acme Corp.”,
“environment”: “DEV”
}
no
windows_vm_sizeAzure Windows Virtual Machine Sizestring"Standard_B2ms"no

Conclusion

Once the VM is provisioned, it will have Solr installed based on the version of Sitecore you had provided as input parameter. The Solr instance would also have the cores setup for Sitecore as part of the base setup.

As output we would receive following data:
VM Public IP Address
VM Admin Username & auto generated Password


Using Sitecore Solr Terraform module can provide several advantages, including:

  1. Infrastructure as Code: Terraform is a popular tool for creating and managing infrastructure as code. It allows you to define your Sitecore Solr infrastructure in code, which can be version controlled, reviewed, and easily reproduced. This reduces the risk of manual errors and makes it easier to manage and scale your infrastructure.
  2. Automated Provisioning: Terraform automates the provisioning of your Sitecore Solr infrastructure, including the creation of VM, networking, and other resources. This saves time and reduces the risk of human error.
  3. Consistency: Terraform ensures that your Sitecore Solr infrastructure is consistent across different environments. This means that your development, staging, and production environments can be created with the same infrastructure code, ensuring consistency and reducing the risk of errors.
  4. Scalability: Terraform makes it easy to scale your Sitecore Solr infrastructure up or down based on your requirements. You can quickly add or remove resources as needed, allowing you to optimize costs and performance.
  5. Reusability: Terraform modules can be reused across different projects, making it easier to share and maintain infrastructure code. This reduces duplication of effort and ensures consistency across different projects.

Overall, using Sitecore Solr Terraform module can simplify the process of managing your Sitecore Solr infrastructure, making it more efficient, consistent, and scalable.