The following arguments are supported:
Note
Downgrading the SKU will force a new resource to be created.
Note:
Configuring the number of replicas per master is only available when using the Premium SKU and cannot be used in conjunction with shards.
Please Note
: Availability Zones are in Preview and only supported in several regions at this time - as such you must be opted into the Preview to use this functionality. You can opt into the Availability Zones Preview in the Azure Portal.
An identity block supports the following:
NOTE:
This is required when type is set to UserAssigned or SystemAssigned, UserAssigned.
A redis_configuration block supports the following:
Example usage:
redis_configuration {
aof_backup_enabled = true
aof_storage_connection_string_0 = "DefaultEndpointsProtocol=https;
BlobEndpoint=${azurerm_storage_account.nc-cruks-storage-account.primary_blob_endpoint};
AccountName=${azurerm_storage_account.mystorageaccount.name};
AccountKey=${azurerm_storage_account.mystorageaccount.primary_access_key}"
aof_storage_connection_string_1 = "DefaultEndpointsProtocol=https;
BlobEndpoint=${azurerm_storage_account.mystorageaccount.primary_blob_endpoint};
AccountName=${azurerm_storage_account.mystorageaccount.name};
AccountKey=${azurerm_storage_account.mystorageaccount.secondary_access_key}"}
NOTE:
enable_authentication can only be set to false if a subnet_id is specified; and only works if there aren't existing instances within
the subnet with enable_authentication set to true.
NOTE:
If rdb_backup_enabled set to true, rdb_storage_connection_string must also be set.
NOTE:
There's a bug in the Redis API where the original storage connection string isn't being returned, which is being tracked in this issue. In the interim you can use the ignore_changes attribute to ignore changes to this field e.g.:
resource "azurerm_redis_cache" "example" {
# ...
ignore_changes = [redis_configuration.0.rdb_storage_connection_string]
}
redis_configuration {
maxmemory_reserved = 10
maxmemory_delta = 2
maxmemory_policy = "allkeys-lru"
}
Redis ValueBasicStandardPremiumenable_authenticationtruetruetruemaxmemory_reserved250200maxfragmentationmemory_
reserved250200maxmemory_delta250200maxmemory_policyvolatile-lruvolatile-lruvolatile-lru
NOTE:
The maxmemory_reserved, maxmemory_delta and maxfragmentationmemory_reserved settings are only available for Standard and Premium caches.
More details are available in the Relevant Links section below.
A patch_schedule block supports the following:
Note:
The Patch Window lasts for 5 hours from the start_hour_utc.
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
# NOTE: the Name used for Redis needs to be globally unique
resource "azurerm_redis_cache" "example" {
name = "example-cache"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
capacity = 2
family = "C"
sku_name = "Standard"
enable_non_ssl_port = false
minimum_tls_version = "1.2"
redis_configuration {
}
}
az redis create --location
--name
--resource-group
--sku {Basic, Premium, Standard}
--vm-size {c0, c1, c2, c3, c4, c5, c6, p1, p2, p3, p4, p5}
[--enable-non-ssl-port]
[--mi-system-assigned]
[--mi-user-assigned]
[--minimum-tls-version {1.0, 1.1, 1.2}]
[--redis-configuration]
[--redis-version]
[--replicas-per-master]
[--shard-count]
[--static-ip]
[--subnet-id]
[--tags]
[--tenant-settings]
[--zones {1, 2, 3}]
az redis create --location westus2 --name MyRedisCache --resource-group MyResourceGroup --sku Basic --vm-size c0
Categorized by Availability, Security & Compliance and Cost