Azure Redis Cache
This page shows how to write Terraform and Azure Resource Manager for Redis Cache and write them securely.
azurerm_redis_cache (Terraform)
The Cache in Redis can be configured in Terraform with the resource name azurerm_redis_cache. The following sections describe 9 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_redis_cache" "standard_c3" {
name = "example-cache"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
capacity = 3
family = "C"
resource "azurerm_redis_cache" "example" {
name = "example-cache-chrrice1234"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
capacity = 2
family = "C"
resource "azurerm_redis_cache" "pcarey-redis-tfe" {
name = "pcarey-redis-tfe"
location = var.location
resource_group_name = var.resource_group_name
capacity = 3
family = "C"
resource "azurerm_redis_cache" "post-office-redis" {
name = "redis"
location = azurerm_resource_group.post-office-rg.location
resource_group_name = azurerm_resource_group.post-office-rg.name
capacity = 2
family = "C"
resource "azurerm_redis_cache" "standard_c3" {
name = "example-cache"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
capacity = 3
family = "C"
resource "azurerm_redis_cache" "negative1" {
name = "example-cache"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
capacity = 2
family = "C"
resource "azurerm_redis_cache" "negative1" {
name = "example-cache"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
capacity = 2
family = "C"
resource "azurerm_redis_cache" "main" {
name = var.name
location = var.location
resource_group_name = var.resource_group_name
capacity = var.capacity
family = var.family
resource "azurerm_redis_cache" "redis_cach" {
capacity = 0
family = ""
location = ""
name = ""
Parameters
-
capacityrequired - number -
enable_non_ssl_portoptional - bool -
familyrequired - string -
hostnameoptional computed - string -
idoptional computed - string -
locationrequired - string -
minimum_tls_versionoptional - string -
namerequired - string -
portoptional computed - number -
primary_access_keyoptional computed - string -
primary_connection_stringoptional computed - string -
private_static_ip_addressoptional computed - string -
public_network_access_enabledoptional - bool -
resource_group_namerequired - string -
secondary_access_keyoptional computed - string -
secondary_connection_stringoptional computed - string -
shard_countoptional - number -
sku_namerequired - string -
ssl_portoptional computed - number -
subnet_idoptional - string -
tagsoptional - map from string to string -
zonesoptional - list of string -
patch_schedulelist block-
day_of_weekrequired - string -
start_hour_utcoptional - number
-
-
redis_configurationlist block-
aof_backup_enabledoptional - bool -
aof_storage_connection_string_0optional - string -
aof_storage_connection_string_1optional - string -
enable_authenticationoptional - bool -
maxclientsoptional computed - number -
maxfragmentationmemory_reservedoptional computed - number -
maxmemory_deltaoptional computed - number -
maxmemory_policyoptional - string -
maxmemory_reservedoptional computed - number -
notify_keyspace_eventsoptional - string -
rdb_backup_enabledoptional - bool -
rdb_backup_frequencyoptional - number -
rdb_backup_max_snapshot_countoptional - number -
rdb_storage_connection_stringoptional - string
-
-
timeoutssingle block
Explanation in Terraform Registry
Manages a Redis Cache.
Microsoft.Cache/Redis (Azure Resource Manager)
The Redis in Microsoft.Cache can be configured in Azure Resource Manager with the resource name Microsoft.Cache/Redis. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
"type": "Microsoft.Cache/Redis",
"apiVersion": "2019-07-01",
"name": "[parameters('Redis_chatsvcagg_local_name')]",
"location": "West US 2",
"properties": {
"sku": {
Frequently asked questions
What is Azure Redis Cache?
Azure Redis Cache is a resource for Redis of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure Redis Cache?
For Terraform, the gilyas/infracost, ricec/tf-redis-logging and pcareyrh/tfe_deploy source code examples are useful. See the Terraform Example section for further details.
For Azure Resource Manager, the jcravener/AzureWorkroom source code example is useful. See the Azure Resource Manager Example section for further details.