github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/website/source/docs/providers/azurerm/r/redis_cache.html.markdown (about)

     1  ---
     2  layout: "azurerm"
     3  page_title: "Azure Resource Manager: azurerm_redis_cache"
     4  sidebar_current: "docs-azurerm-resource-redis-cache"
     5  description: |-
     6    Creates a new Redis Cache Resource
     7  ---
     8  
     9  # azurerm\_redis\_cache
    10  
    11  Creates a new Redis Cache Resource
    12  
    13  ## Example Usage (Basic)
    14  
    15  ```
    16  resource "azurerm_resource_group" "test" {
    17    name     = "acceptanceTestResourceGroup1"
    18    location = "West US"
    19  }
    20  
    21  resource "azurerm_redis_cache" "test" {
    22    name                = "test"
    23    location            = "${azurerm_resource_group.test.location}"
    24    resource_group_name = "${azurerm_resource_group.test.name}"
    25    capacity            = 0
    26    family              = "C"
    27    sku_name            = "Basic"
    28    enable_non_ssl_port = false
    29  
    30    redis_configuration {
    31      maxclients = "256"
    32    }
    33  }
    34  ```
    35  
    36  ## Example Usage (Standard)
    37  
    38  ```
    39  resource "azurerm_resource_group" "test" {
    40    name     = "acceptanceTestResourceGroup1"
    41    location = "West US"
    42  }
    43  
    44  resource "azurerm_redis_cache" "test" {
    45    name                = "test"
    46    location            = "${azurerm_resource_group.test.location}"
    47    resource_group_name = "${azurerm_resource_group.test.name}"
    48    capacity            = 1
    49    family              = "C"
    50    sku_name            = "Standard"
    51    enable_non_ssl_port = false
    52  
    53    redis_configuration {
    54      maxclients = "1000"
    55    }
    56  }
    57  ```
    58  
    59  ## Example Usage (Premium with Clustering)
    60  ```
    61  resource "azurerm_resource_group" "test" {
    62    name     = "acceptanceTestResourceGroup1"
    63    location = "West US"
    64  }
    65  
    66  resource "azurerm_redis_cache" "test" {
    67    name                = "clustered-test"
    68    location            = "${azurerm_resource_group.test.location}"
    69    resource_group_name = "${azurerm_resource_group.test.name}"
    70    capacity            = 1
    71    family              = "P"
    72    sku_name            = "Premium"
    73    enable_non_ssl_port = false
    74    shard_count         = 3
    75  
    76    redis_configuration {
    77      maxclients         = "7500"
    78      maxmemory_reserved = "2"
    79      maxmemory_delta    = "2"
    80      maxmemory_policy   = "allkeys-lru"
    81    }
    82  }
    83  ```
    84  
    85  ## Argument Reference
    86  
    87  The following arguments are supported:
    88  
    89  * `name` - (Required) The name of the Redis instance. Changing this forces a
    90      new resource to be created.
    91  
    92  * `location` - (Required) The location of the resource group.
    93  
    94  * `resource_group_name` - (Required) The name of the resource group in which to
    95      create the Redis instance.
    96  
    97  * `capacity` - (Required) This corresponds to the size of the Redis instance you wish to use (e.g. a C0 would be 0, P3 would be 3 etc).
    98  
    99  * `family` - (Required) The pricing group for the Redis Family - either "C" or "P" at present.
   100  
   101  * `sku_name` - (Required) The SKU of Redis to use - can be either Basic, Standard or Premium.
   102  
   103  * `enable_non_ssl_port` - (Optional) Enable the non-SSL port (6789) - disabled by default.
   104  
   105  * `shard_count` - (Optional) *Only available when using the Premium SKU* The number of Shards to create on the Redis Cluster.
   106  
   107  * `redis_configuration` - (Required) Potential Redis configuration values - with some limitations by SKU - defaults/details are shown below.
   108  ```
   109  redis_configuration {
   110    maxclients         = "512"
   111    maxmemory_reserve" = "10"
   112    maxmemory_delta    = "2"
   113    maxmemory_policy   = "allkeys-lru"
   114  }
   115  ```
   116  
   117  ## Default Redis Configuration Values
   118  | Redis Value        | Basic        | Standard     | Premium      |
   119  | ------------------ | ------------ | ------------ | ------------ |
   120  | maxclients         | 256          | 1000         | 7500         |
   121  | maxmemory_reserved | 2            | 50           | 200          |
   122  | maxmemory_delta    | 2            | 50           | 200          |
   123  | maxmemory_policy   | volatile-lru | volatile-lru | volatile-lru |
   124  
   125  _*Important*: The maxmemory_reserved setting is only available for Standard and Premium caches. More details are available in the Relevant Links section below._
   126  
   127  ## Attributes Reference
   128  
   129  The following attributes are exported:
   130  
   131  * `id` - The Route ID.
   132  
   133  * `hostname` - The Hostname of the Redis Instance
   134  
   135  * `ssl_port` - The non-SSL Port of the Redis Instance
   136  
   137  * `port` - The SSL Port of the Redis Instance
   138  
   139  * `primary_access_key` - The Primary Access Key for the Redis Instance
   140  
   141  * `secondary_access_key` - The Secondary Access Key for the Redis Instance
   142  
   143  ## Relevant Links
   144   - [Azure Redis Cache: SKU specific configuration limitations](https://azure.microsoft.com/en-us/documentation/articles/cache-configure/#advanced-settings)
   145   - [Redis: Available Configuration Settings](http://redis.io/topics/config)