This is a template to get started with the 'azurerm_redis_enterprise_cluster' resource available in the 'azurerm' provider with Terraform.
- Tenant
- Subscription
- Resource Group
- Storage Account
- Storage Container
- VNET
- Subnet
- Redis Enterprise Cluster
- Private Link connecting subnet and cluster
- Storage Account
- Resource Group
- Subscription
The RediSearch module will be included. A private link, vnet and subnet connect to the instance. The public endpoint will be disabled.
Login to Azure using the Azure CLI
az login
Login with a Service Principal will also work
Login using an Azure Service Principal
az login --service-principal --username APP_ID --tenant TENANT_ID --password [password || /path/to/cert]
git clone https://github.com/redis-developer/acre-terraform
cd acre-terraform
terraform init
The output should include:
Terraform has been successfully initialized
The default variables deploy the smallest 'E10' instance into the 'East US' region.
Changes can be made by updating the variables.tf
file.
The 'plan' output will show you everything being created by the template.
terraform plan
The plan step does not make any changes in Azure
When the plan looks good, 'apply' the template.
terraform apply
Connecting to this instance will have to be done from within the subnet that was created. Only clients within the subnet can access the instance via the private link. The access key is sensitive, so viewing the outputs must be requested specifically.
terraform output redisgeek_config
Example output:
{
"hostname" = "redis-developer-8jy4.eastus.redisenterprise.cache.azure.net"
"access_key" = "DQYABC3uRMyDguE1236Xkvv3TprUcqBWTRkfgOPjs82Y="
"port" = "10000"
}
Remove the resources that were created.
terraform destroy
The cluster, deployed across 3-AZs, will have a 99.99 SLA that is financially backed by Azure. There are no "preview" features or modules included in this template. Deployment using a private endpoint is typical for production workloads. The storage account and storage container are there for exporting/importing RDB files.
Pull-requests are welcomed!
Distributed under the MIT License. See LICENSE
for more information.