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
-
capacity
required - number -
enable_non_ssl_port
optional - bool -
family
required - string -
hostname
optional computed - string -
id
optional computed - string -
location
required - string -
minimum_tls_version
optional - string -
name
required - string -
port
optional computed - number -
primary_access_key
optional computed - string -
primary_connection_string
optional computed - string -
private_static_ip_address
optional computed - string -
public_network_access_enabled
optional - bool -
resource_group_name
required - string -
secondary_access_key
optional computed - string -
secondary_connection_string
optional computed - string -
shard_count
optional - number -
sku_name
required - string -
ssl_port
optional computed - number -
subnet_id
optional - string -
tags
optional - map from string to string -
zones
optional - list of string -
patch_schedule
list block-
day_of_week
required - string -
start_hour_utc
optional - number
-
-
redis_configuration
list block-
aof_backup_enabled
optional - bool -
aof_storage_connection_string_0
optional - string -
aof_storage_connection_string_1
optional - string -
enable_authentication
optional - bool -
maxclients
optional computed - number -
maxfragmentationmemory_reserved
optional computed - number -
maxmemory_delta
optional computed - number -
maxmemory_policy
optional - string -
maxmemory_reserved
optional computed - number -
notify_keyspace_events
optional - string -
rdb_backup_enabled
optional - bool -
rdb_backup_frequency
optional - number -
rdb_backup_max_snapshot_count
optional - number -
rdb_storage_connection_string
optional - string
-
-
timeouts
single 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.