This module creates and manages Azure Managed Redis instances. Key features:
Once you have a Corewide Solutions Portal account, this one-time action will use your browser session to retrieve credentials:
shellterraform login solutions.corewide.com
Initialize mandatory providers:
Copy and paste into your Terraform configuration and insert the variables:
hclmodule "tf_azure_cache" {
source = "solutions.corewide.com/azure/tf-azure-cache/azurerm"
version = "~> 3.0.0"
# specify module inputs here or try one of the examples below
...
}
Initialize the setup:
shellterraform init
Corewide DevOps team strictly follows Semantic Versioning
Specification
to
provide our clients with products that have predictable upgrades between versions. We
recommend
pinning
patch versions of our modules using pessimistic
constraint operator (~>) to prevent breaking changes during upgrades.
To get new features during the upgrades (without breaking compatibility), use
~> 3.0 and run
terraform init -upgrade
For the safest setup, use strict pinning with version = "3.0.0"
|
Module
15% off
|
€550
|
| TOTAL | €550 |
This module creates and manages Azure Managed Redis instances. Key features:
All notable changes to this project are documented here.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
BREAKING CHANGE: Azure Cache for Redis has reached its end of availability (EOA) and was replaced by Azure Managed Redis. Management of the Azure Managed Redis is incompatible with the previous versions. Upgrade from an older version leads to cache cluster re-creation , see the Upgrade Notes section
(Last major version compatible with the Azure Cache for Redis due to its retirement in April 2026; the next one will be compatible with the Azure Managed Redis)
5.01.9 due to using cross-object referencing for input variable validations(Last version compatible with the Azure Terraform provider version 4.0)
4.57First stable version
v1.x to v2.xModule from v2.0 has changed Azure Terraform provider version, which isn't compatible with older versions. After the module version is upgraded, re-init the module to upgrade the provider version. Upgrade the Azure provider version at the project level:
hclterraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 5.0"
}
}
}
Upgrade project dependencies:
bashterraform init --upgrade
Update the declaration of the module according to the requirements and examples to match the designed configuration, then the configuration can be applied.
Apply the changes to make sure the state of the resources is up-to-date with the new provider version:
bashterraform apply
v2.x to v3.xDue to the cache service replacement of Azure Cache for Redis with Azure Managed Redis, the module from version 3.0 switches cache resources and updates cache cluster management, which is incompatible with the previous version. First, update the declaration of the module according to the requirements and examples to match the designed configuration, then re-init the module with an enabled upgrade:
bashterraform init -upgrade
Now the configuration can be applied, this will lead to the cache cluster re-creation.
Minimal setup with required parameters only:
hclresource "azurerm_resource_group" "foo" {
name = "foo"
location = "eastus"
}
module "redis" {
source = "solutions.corewide.com/azure/tf-azure-cache/azurerm"
version = "~> 3.0"
name_suffix = "bar"
region = azurerm_resource_group.foo.location
resource_group_name = azurerm_resource_group.foo.name
}
Setup with specific machine size, high availability enabled, and auth-less access from the VNet:
hclresource "azurerm_resource_group" "foo" {
name = "foo"
location = "eastus"
}
module "redis" {
source = "solutions.corewide.com/azure/tf-azure-cache/azurerm"
version = "~> 3.0"
name_suffix = "bar"
region = azurerm_resource_group.foo.location
resource_group_name = azurerm_resource_group.foo.name
machine_size = "Balanced_B5"
vnet_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/virtualNetworks/myvnet1"
subnet_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/virtualNetworks/myvnet1/subnets/mysubnet1"
public_access_enabled = false
high_availability_enabled = true
redis_configuration = {
authentication_enabled = false
}
}
| Variable | Description | Type | Default | Required | Sensitive |
|---|---|---|---|---|---|
name_suffix |
Name suffix for the created resources | string |
yes | no | |
region |
Azure region where the managed Redis will be created | string |
yes | no | |
resource_group_name |
Name of the resource group where managed Redis will be created | string |
yes | no | |
high_availability_enabled |
Whether to enable high availability for the managed Redis instance | bool |
false |
no | no |
machine_size |
The size of the managed Redis to deploy - SKU name | string |
Balanced_B0 |
no | no |
public_access_enabled |
Toggle public network availability | bool |
true |
no | no |
redis_configuration |
Redis default database configuration parameters | object |
{} |
no | no |
redis_configuration.authentication_enabled |
Whether access key authentication is enabled for the Redis database | bool |
true |
no | no |
redis_configuration.client_protocol |
Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Possible values are: Encrypted and Plaintext |
string |
Encrypted |
no | no |
redis_configuration.clustering_policy |
Clustering policy specified at create time. Possible values are EnterpriseCluster, OSSCluster, and NoCluster |
string |
OSSCluster |
no | no |
redis_configuration.eviction_policy |
Specifies the Redis eviction policy. Possible values are AllKeysLFU, AllKeysLRU, AllKeysRandom, VolatileLRU, VolatileLFU, VolatileTTL, VolatileRandom, and NoEviction |
string |
NoEviction |
no | no |
subnet_id |
The ID of the subnet which the managed Redis will be pointed to. Both subnet_id and vnet_id are requried for the integration via the private endpoint |
string |
no | no | |
tags |
Tags to be applied to the managed Redis resources | map(string) |
{} |
no | no |
vnet_id |
VNet ID to integrate the managed Redis into. Both vnet_id and subnet_id are requried for the integration via the private endpoint |
string |
no | no |
| Output | Description | Type | Sensitive |
|---|---|---|---|
connection_parameters |
Connection parameters for managed Redis instance | map |
yes |
connection_parameters.port |
Network port that the managed Redis is listening on | map |
yes |
connection_parameters.primary_access_key |
Primary access key for the managed Redis instance | map |
yes |
connection_parameters.private_host |
Redis instance private hostname accessible from resources within the assigned VNet | map |
yes |
connection_parameters.public_host |
Redis instance public hostname | map |
yes |
connection_parameters.secondary_access_key |
Secondary access key for the managed Redis instance | map |
yes |
instance |
Managed Redis instance attributes | resource |
yes |
| Dependency | Version | Kind |
|---|---|---|
terraform |
>= 1.9 |
CLI |
hashicorp/azurerm |
~> 5.0 |
provider |