github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/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 ```hcl 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 ```hcl 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 = 2 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 ```hcl 62 resource "azurerm_resource_group" "test" { 63 name = "acceptanceTestResourceGroup1" 64 location = "West US" 65 } 66 67 resource "azurerm_redis_cache" "test" { 68 name = "clustered-test" 69 location = "${azurerm_resource_group.test.location}" 70 resource_group_name = "${azurerm_resource_group.test.name}" 71 capacity = 1 72 family = "P" 73 sku_name = "Premium" 74 enable_non_ssl_port = false 75 shard_count = 3 76 77 redis_configuration { 78 maxclients = "7500" 79 maxmemory_reserved = "2" 80 maxmemory_delta = "2" 81 maxmemory_policy = "allkeys-lru" 82 } 83 } 84 ``` 85 86 ## Argument Reference 87 88 The following arguments are supported: 89 90 * `name` - (Required) The name of the Redis instance. Changing this forces a 91 new resource to be created. 92 93 * `location` - (Required) The location of the resource group. 94 95 * `resource_group_name` - (Required) The name of the resource group in which to 96 create the Redis instance. 97 98 * `capacity` - (Required) The size of the Redis cache to deploy. Valid values for a SKU `family` of C (Basic/Standard) are `0, 1, 2, 3, 4, 5, 6`, and for P (Premium) `family` are `1, 2, 3, 4`. 99 100 * `family` - (Required) The SKU family to use. Valid values are `C` and `P`, where C = Basic/Standard, P = Premium. 101 102 The pricing group for the Redis Family - either "C" or "P" at present. 103 104 * `sku_name` - (Required) The SKU of Redis to use - can be either Basic, Standard or Premium. 105 106 * `enable_non_ssl_port` - (Optional) Enable the non-SSL port (6789) - disabled by default. 107 108 * `shard_count` - (Optional) *Only available when using the Premium SKU* The number of Shards to create on the Redis Cluster. 109 110 * `redis_configuration` - (Required) Potential Redis configuration values - with some limitations by SKU - defaults/details are shown below. 111 112 ```hcl 113 redis_configuration { 114 maxclients = "512" 115 maxmemory_reserve = "10" 116 maxmemory_delta = "2" 117 maxmemory_policy = "allkeys-lru" 118 } 119 ``` 120 121 ## Default Redis Configuration Values 122 | Redis Value | Basic | Standard | Premium | 123 | ------------------ | ------------ | ------------ | ------------ | 124 | maxclients | 256 | 1000 | 7500 | 125 | maxmemory_reserved | 2 | 50 | 200 | 126 | maxmemory_delta | 2 | 50 | 200 | 127 | maxmemory_policy | volatile-lru | volatile-lru | volatile-lru | 128 129 _*Important*: The maxmemory_reserved setting is only available for Standard and Premium caches. More details are available in the Relevant Links section below._ 130 131 ## Attributes Reference 132 133 The following attributes are exported: 134 135 * `id` - The Route ID. 136 137 * `hostname` - The Hostname of the Redis Instance 138 139 * `ssl_port` - The SSL Port of the Redis Instance 140 141 * `port` - The non-SSL Port of the Redis Instance 142 143 * `primary_access_key` - The Primary Access Key for the Redis Instance 144 145 * `secondary_access_key` - The Secondary Access Key for the Redis Instance 146 147 ## Relevant Links 148 - [Azure Redis Cache: SKU specific configuration limitations](https://azure.microsoft.com/en-us/documentation/articles/cache-configure/#advanced-settings) 149 - [Redis: Available Configuration Settings](http://redis.io/topics/config)