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
Name | Description | Type | Default | Required |
---|---|---|---|---|
admin_username | VM Admin Username [Note: Password would be auto generated] | string | "adminuser" | no |
client | Code name of the client. Must have 3 alphanumeric chars. | string | n/a | yes |
environment | Environment code (LAB, DEV, TST, STG, PROD, DR). | string | "DEV" | no |
location | Azure region to use for deployment. | string | n/a | yes |
project | Code name of the subproject. Must have 4 alphanumeric chars. | string | n/a | yes |
resource_group_name | Resource group name for deployment. | string | n/a | yes |
sitecore_version | Supports Sitecore Version 9.0.0 to 10.3.0 | string | "10.3.0" | no |
tags | The tags to associate with your resources. | map | { “company”: “Acme Corp.”, “environment”: “DEV” } | no |
windows_vm_size | Azure Windows Virtual Machine Size | string | "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:
- 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.
- 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.
- 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.
- 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.
- 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.