azurerm_redis_cache_access_policy_assignment

Manages a Redis Cache Access Policy Assignment

Example Usage

data "azurerm_client_config" "test" {
}

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

resource "azurerm_redis_cache" "example" {
  name                = "example"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.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_cache_access_policy_assignment" "example" {
  name               = "example"
  redis_cache_id     = azurerm_redis_cache.example.id
  access_policy_name = "Data Contributor"
  object_id          = data.azurerm_client_config.test.object_id
  object_id_alias    = "ServicePrincipal"
}

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 Cache Policy Assignment can be imported using the resource id, e.g.

terraform import azurerm_redis_cache_access_policy_assignment.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Cache/redis/cache1/accessPolicyAssignments/assignment1