github.com/recobe182/terraform@v0.8.5-0.20170117231232-49ab22a935b7/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 37 ## Example Usage (Standard) 38 39 ``` 40 resource "azurerm_resource_group" "test" { 41 name = "acceptanceTestResourceGroup1" 42 location = "West US" 43 } 44 45 resource "azurerm_redis_cache" "test" { 46 name = "test" 47 location = "${azurerm_resource_group.test.location}" 48 resource_group_name = "${azurerm_resource_group.test.name}" 49 capacity = 1 50 family = "C" 51 sku_name = "Standard" 52 enable_non_ssl_port = false 53 54 redis_configuration { 55 maxclients = "1000" 56 } 57 } 58 59 ``` 60 61 ## Example Usage (Premium with Clustering) 62 ``` 63 resource "azurerm_resource_group" "test" { 64 name = "acceptanceTestResourceGroup1" 65 location = "West US" 66 } 67 68 resource "azurerm_redis_cache" "test" { 69 name = "clustered-test" 70 location = "${azurerm_resource_group.test.location}" 71 resource_group_name = "${azurerm_resource_group.test.name}" 72 capacity = 1 73 family = "P" 74 sku_name = "Premium" 75 enable_non_ssl_port = false 76 shard_count = 3 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) 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). 99 100 * `family` - (Required) The pricing group for the Redis Family - either "C" or "P" at present. 101 102 * `sku_name` - (Required) The SKU of Redis to use - can be either Basic, Standard or Premium. 103 104 * `enable_non_ssl_port` - (Optional) Enable the non-SSL port (6789) - disabled by default. 105 106 * `shard_count` - (Optional) *Only available when using the Premium SKU* The number of Shards to create on the Redis Cluster. 107 108 * `redis_configuration` - (Required) Potential Redis configuration values - with some limitations by SKU - defaults/details are shown below. 109 ``` 110 redis_configuration { 111 maxclients = "512" 112 maxmemory_reserve" = "10" 113 maxmemory_delta = "2" 114 maxmemory_policy = "allkeys-lru" 115 } 116 ``` 117 118 ## Default Redis Configuration Values 119 | Redis Value | Basic | Standard | Premium | 120 | ------------------ | ------------ | ------------ | ------------ | 121 | maxclients | 256 | 1000 | 7500 | 122 | maxmemory_reserved | 2 | 50 | 200 | 123 | maxmemory_delta | 2 | 50 | 200 | 124 | maxmemory_policy | volatile-lru | volatile-lru | volatile-lru | 125 126 _*Important*: The maxmemory_reserved setting is only available for Standard and Premium caches. More details are available in the Relevant Links section below._ 127 128 ## Attributes Reference 129 130 The following attributes are exported: 131 132 * `id` - The Route ID. 133 134 * `hostname` - The Hostname of the Redis Instance 135 136 * `ssl_port` - The non-SSL Port of the Redis Instance 137 138 * `port` - The SSL Port of the Redis Instance 139 140 * `primary_access_key` - The Primary Access Key for the Redis Instance 141 142 * `secondary_access_key` - The Secondary Access Key for the Redis Instance 143 144 ## Relevant Links 145 - [Azure Redis Cache: SKU specific configuration limitations](https://azure.microsoft.com/en-us/documentation/articles/cache-configure/#advanced-settings) 146 - [Redis: Available Configuration Settings](http://redis.io/topics/config)