azurerm_redis_linked_server

Manages a Redis Linked Server (ie Geo Location)

Example Usage

resource "azurerm_resource_group" "example-primary" {
  name     = "example-resources-primary"
  location = "East US"
}

resource "azurerm_redis_cache" "example-primary" {
  name                = "example-cache1"
  location            = azurerm_resource_group.example-primary.location
  resource_group_name = azurerm_resource_group.example-primary.name
  capacity            = 1
  family              = "P"
  sku_name            = "Premium"
  enable_non_ssl_port = false

  redis_configuration {
    maxmemory_reserved = 2
    maxmemory_delta    = 2
    maxmemory_policy   = "allkeys-lru"
  }
}

resource "azurerm_resource_group" "example-secondary" {
  name     = "example-resources-secondary"
  location = "West US"
}

resource "azurerm_redis_cache" "example-secondary" {
  name                = "example-cache2"
  location            = azurerm_resource_group.example-secondary.location
  resource_group_name = azurerm_resource_group.example-secondary.name
  capacity            = 1
  family              = "P"
  sku_name            = "Premium"
  enable_non_ssl_port = false

  redis_configuration {
    maxmemory_reserved = 2
    maxmemory_delta    = 2
    maxmemory_policy   = "allkeys-lru"
  }
}

resource "azurerm_redis_linked_server" "example-link" {
  target_redis_cache_name     = azurerm_redis_cache.example-primary.name
  resource_group_name         = azurerm_redis_cache.example-primary.resource_group_name
  linked_redis_cache_id       = azurerm_redis_cache.example-secondary.id
  linked_redis_cache_location = azurerm_redis_cache.example-secondary.location
  server_role                 = "Secondary"
}

Arguments Reference

The following arguments are supported:

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

Redis can be imported using the resource id, e.g.

terraform import azurerm_redis_linked_server.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Cache/redis/cache1/linkedServers/cache2