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

redis_cache_test.tf#L11
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"
main.tf#L11
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"
redis.tf#L3
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"
redis.tf#L1
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"
redis_cache_test.tf#L11
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"
negative.tf#L1
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"
negative.tf#L1
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"
redis_cache.tf#L1
resource "azurerm_redis_cache" "main" {
  name                = var.name
  location            = var.location
  resource_group_name = var.resource_group_name
  capacity            = var.capacity
  family              = var.family
Redis.tf#L2
resource "azurerm_redis_cache" "redis_cach" {

  capacity = 0
  family = ""
  location = ""
  name = ""

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

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

msg-redis-non-prod.json#L24
      "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.

security-icon

Automate config file reviews on your commits

Fix issues in your infrastructure as code with auto-generated patches.