This page documents the language specification for the azure package. If you're looking for help working with the inputs, outputs, or functions of azure resources in a Pulumi program, please see the resource documentation for examples and API reference.

redis

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-azure repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-azurerm repo.

class pulumi_azure.redis.AwaitableGetCacheResult(capacity=None, enable_non_ssl_port=None, family=None, hostname=None, id=None, location=None, minimum_tls_version=None, name=None, patch_schedules=None, port=None, primary_access_key=None, primary_connection_string=None, private_static_ip_address=None, redis_configurations=None, resource_group_name=None, secondary_access_key=None, secondary_connection_string=None, shard_count=None, sku_name=None, ssl_port=None, subnet_id=None, tags=None, zones=None)
class pulumi_azure.redis.Cache(resource_name, opts=None, capacity=None, enable_non_ssl_port=None, family=None, location=None, minimum_tls_version=None, name=None, patch_schedules=None, private_static_ip_address=None, redis_configuration=None, resource_group_name=None, shard_count=None, sku_name=None, subnet_id=None, tags=None, zones=None, __props__=None, __name__=None, __opts__=None)

Manages a Redis Cache.

import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
# NOTE: the Name used for Redis needs to be globally unique
example_cache = azure.redis.Cache("exampleCache",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    capacity=2,
    family="C",
    sku_name="Standard",
    enable_non_ssl_port=False,
    minimum_tls_version="1.2",
    redis_configuration={})

Redis Value

Basic

Standard

Premium

enable_authentication

true

true

true

maxmemory_reserved

2

50

200

maxfragmentationmemory_reserved

2

50

200

maxmemory_delta

2

50

200

maxmemory_policy

volatile-lru

volatile-lru

volatile-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:

  • day_of_week (Required) the Weekday name - possible values include Monday, Tuesday, Wednesday etc.

  • start_hour_utc - (Optional) the Start Hour for maintenance in UTC - possible values range from 0 - 23.

Note: The Patch Window lasts for 5 hours from the start_hour_utc.

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • capacity (pulumi.Input[float]) – 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.

  • enable_non_ssl_port (pulumi.Input[bool]) – Enable the non-SSL port (6379) - disabled by default.

  • family (pulumi.Input[str]) – The SKU family/pricing group to use. Valid values are C (for Basic/Standard SKU family) and P (for Premium)

  • location (pulumi.Input[str]) – The location of the resource group.

  • minimum_tls_version (pulumi.Input[str]) – The minimum TLS version. Defaults to 1.0.

  • name (pulumi.Input[str]) – The name of the Redis instance. Changing this forces a new resource to be created.

  • patch_schedules (pulumi.Input[list]) – A list of patch_schedule blocks as defined below - only available for Premium SKU’s.

  • private_static_ip_address (pulumi.Input[str]) – The Static IP Address to assign to the Redis Cache when hosted inside the Virtual Network. Changing this forces a new resource to be created.

  • redis_configuration (pulumi.Input[dict]) – A redis_configuration as defined below - with some limitations by SKU - defaults/details are shown below.

  • resource_group_name (pulumi.Input[str]) – The name of the resource group in which to create the Redis instance.

  • shard_count (pulumi.Input[float]) – Only available when using the Premium SKU The number of Shards to create on the Redis Cluster.

  • sku_name (pulumi.Input[str]) – The SKU of Redis to use. Possible values are Basic, Standard and Premium.

  • subnet_id (pulumi.Input[str]) – Only available when using the Premium SKU The ID of the Subnet within which the Redis Cache should be deployed. This Subnet must only contain Azure Cache for Redis instances without any other type of resources. Changing this forces a new resource to be created.

  • tags (pulumi.Input[dict]) – A mapping of tags to assign to the resource.

  • zones (pulumi.Input[str]) – A list of a single item of the Availability Zone which the Redis Cache should be allocated in.

The patch_schedules object supports the following:

  • dayOfWeek (pulumi.Input[str])

  • startHourUtc (pulumi.Input[float])

The redis_configuration object supports the following:

  • aofBackupEnabled (pulumi.Input[bool])

  • aofStorageConnectionString0 (pulumi.Input[str])

  • aofStorageConnectionString1 (pulumi.Input[str])

  • enableAuthentication (pulumi.Input[bool]) - If set to false, the Redis instance will be accessible without authentication. Defaults to true.

  • maxclients (pulumi.Input[float]) - Returns the max number of connected clients at the same time.

  • maxfragmentationmemoryReserved (pulumi.Input[float]) - Value in megabytes reserved to accommodate for memory fragmentation. Defaults are shown below.

  • maxmemoryDelta (pulumi.Input[float]) - The max-memory delta for this Redis instance. Defaults are shown below.

  • maxmemoryPolicy (pulumi.Input[str]) - How Redis will select what to remove when maxmemory is reached. Defaults are shown below.

  • maxmemoryReserved (pulumi.Input[float]) - Value in megabytes reserved for non-cache usage e.g. failover. Defaults are shown below.

  • notifyKeyspaceEvents (pulumi.Input[str]) - Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way. Reference

  • rdbBackupEnabled (pulumi.Input[bool]) - Is Backup Enabled? Only supported on Premium SKU’s.

  • rdbBackupFrequency (pulumi.Input[float]) - The Backup Frequency in Minutes. Only supported on Premium SKU’s. Possible values are: 15, 30, 60, 360, 720 and 1440.

  • rdbBackupMaxSnapshotCount (pulumi.Input[float]) - The maximum number of snapshots to create as a backup. Only supported for Premium SKU’s.

  • rdbStorageConnectionString (pulumi.Input[str]) - The Connection String to the Storage Account. Only supported for Premium SKU’s. In the format: DefaultEndpointsProtocol=https;BlobEndpoint=${azurerm_storage_account.example.primary_blob_endpoint};AccountName=${azurerm_storage_account.example.name};AccountKey=${azurerm_storage_account.example.primary_access_key}.

capacity: pulumi.Output[float] = None

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.

enable_non_ssl_port: pulumi.Output[bool] = None

Enable the non-SSL port (6379) - disabled by default.

family: pulumi.Output[str] = None

The SKU family/pricing group to use. Valid values are C (for Basic/Standard SKU family) and P (for Premium)

hostname: pulumi.Output[str] = None

The Hostname of the Redis Instance

location: pulumi.Output[str] = None

The location of the resource group.

minimum_tls_version: pulumi.Output[str] = None

The minimum TLS version. Defaults to 1.0.

name: pulumi.Output[str] = None

The name of the Redis instance. Changing this forces a new resource to be created.

patch_schedules: pulumi.Output[list] = None

A list of patch_schedule blocks as defined below - only available for Premium SKU’s.

  • dayOfWeek (str)

  • startHourUtc (float)

port: pulumi.Output[float] = None

The non-SSL Port of the Redis Instance

primary_access_key: pulumi.Output[str] = None

The Primary Access Key for the Redis Instance

primary_connection_string: pulumi.Output[str] = None

The primary connection string of the Redis Instance.

private_static_ip_address: pulumi.Output[str] = None

The Static IP Address to assign to the Redis Cache when hosted inside the Virtual Network. Changing this forces a new resource to be created.

redis_configuration: pulumi.Output[dict] = None

A redis_configuration as defined below - with some limitations by SKU - defaults/details are shown below.

  • aofBackupEnabled (bool)

  • aofStorageConnectionString0 (str)

  • aofStorageConnectionString1 (str)

  • enableAuthentication (bool) - If set to false, the Redis instance will be accessible without authentication. Defaults to true.

  • maxclients (float) - Returns the max number of connected clients at the same time.

  • maxfragmentationmemoryReserved (float) - Value in megabytes reserved to accommodate for memory fragmentation. Defaults are shown below.

  • maxmemoryDelta (float) - The max-memory delta for this Redis instance. Defaults are shown below.

  • maxmemoryPolicy (str) - How Redis will select what to remove when maxmemory is reached. Defaults are shown below.

  • maxmemoryReserved (float) - Value in megabytes reserved for non-cache usage e.g. failover. Defaults are shown below.

  • notifyKeyspaceEvents (str) - Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way. Reference

  • rdbBackupEnabled (bool) - Is Backup Enabled? Only supported on Premium SKU’s.

  • rdbBackupFrequency (float) - The Backup Frequency in Minutes. Only supported on Premium SKU’s. Possible values are: 15, 30, 60, 360, 720 and 1440.

  • rdbBackupMaxSnapshotCount (float) - The maximum number of snapshots to create as a backup. Only supported for Premium SKU’s.

  • rdbStorageConnectionString (str) - The Connection String to the Storage Account. Only supported for Premium SKU’s. In the format: DefaultEndpointsProtocol=https;BlobEndpoint=${azurerm_storage_account.example.primary_blob_endpoint};AccountName=${azurerm_storage_account.example.name};AccountKey=${azurerm_storage_account.example.primary_access_key}.

resource_group_name: pulumi.Output[str] = None

The name of the resource group in which to create the Redis instance.

secondary_access_key: pulumi.Output[str] = None

The Secondary Access Key for the Redis Instance

secondary_connection_string: pulumi.Output[str] = None

The secondary connection string of the Redis Instance.

shard_count: pulumi.Output[float] = None

Only available when using the Premium SKU The number of Shards to create on the Redis Cluster.

sku_name: pulumi.Output[str] = None

The SKU of Redis to use. Possible values are Basic, Standard and Premium.

ssl_port: pulumi.Output[float] = None

The SSL Port of the Redis Instance

subnet_id: pulumi.Output[str] = None

Only available when using the Premium SKU The ID of the Subnet within which the Redis Cache should be deployed. This Subnet must only contain Azure Cache for Redis instances without any other type of resources. Changing this forces a new resource to be created.

tags: pulumi.Output[dict] = None

A mapping of tags to assign to the resource.

zones: pulumi.Output[str] = None

A list of a single item of the Availability Zone which the Redis Cache should be allocated in.

static get(resource_name, id, opts=None, capacity=None, enable_non_ssl_port=None, family=None, hostname=None, location=None, minimum_tls_version=None, name=None, patch_schedules=None, port=None, primary_access_key=None, primary_connection_string=None, private_static_ip_address=None, redis_configuration=None, resource_group_name=None, secondary_access_key=None, secondary_connection_string=None, shard_count=None, sku_name=None, ssl_port=None, subnet_id=None, tags=None, zones=None)

Get an existing Cache resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • capacity (pulumi.Input[float]) – 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.

  • enable_non_ssl_port (pulumi.Input[bool]) – Enable the non-SSL port (6379) - disabled by default.

  • family (pulumi.Input[str]) – The SKU family/pricing group to use. Valid values are C (for Basic/Standard SKU family) and P (for Premium)

  • hostname (pulumi.Input[str]) – The Hostname of the Redis Instance

  • location (pulumi.Input[str]) – The location of the resource group.

  • minimum_tls_version (pulumi.Input[str]) – The minimum TLS version. Defaults to 1.0.

  • name (pulumi.Input[str]) – The name of the Redis instance. Changing this forces a new resource to be created.

  • patch_schedules (pulumi.Input[list]) – A list of patch_schedule blocks as defined below - only available for Premium SKU’s.

  • port (pulumi.Input[float]) – The non-SSL Port of the Redis Instance

  • primary_access_key (pulumi.Input[str]) – The Primary Access Key for the Redis Instance

  • primary_connection_string (pulumi.Input[str]) – The primary connection string of the Redis Instance.

  • private_static_ip_address (pulumi.Input[str]) – The Static IP Address to assign to the Redis Cache when hosted inside the Virtual Network. Changing this forces a new resource to be created.

  • redis_configuration (pulumi.Input[dict]) – A redis_configuration as defined below - with some limitations by SKU - defaults/details are shown below.

  • resource_group_name (pulumi.Input[str]) – The name of the resource group in which to create the Redis instance.

  • secondary_access_key (pulumi.Input[str]) – The Secondary Access Key for the Redis Instance

  • secondary_connection_string (pulumi.Input[str]) – The secondary connection string of the Redis Instance.

  • shard_count (pulumi.Input[float]) – Only available when using the Premium SKU The number of Shards to create on the Redis Cluster.

  • sku_name (pulumi.Input[str]) – The SKU of Redis to use. Possible values are Basic, Standard and Premium.

  • ssl_port (pulumi.Input[float]) – The SSL Port of the Redis Instance

  • subnet_id (pulumi.Input[str]) – Only available when using the Premium SKU The ID of the Subnet within which the Redis Cache should be deployed. This Subnet must only contain Azure Cache for Redis instances without any other type of resources. Changing this forces a new resource to be created.

  • tags (pulumi.Input[dict]) – A mapping of tags to assign to the resource.

  • zones (pulumi.Input[str]) – A list of a single item of the Availability Zone which the Redis Cache should be allocated in.

The patch_schedules object supports the following:

  • dayOfWeek (pulumi.Input[str])

  • startHourUtc (pulumi.Input[float])

The redis_configuration object supports the following:

  • aofBackupEnabled (pulumi.Input[bool])

  • aofStorageConnectionString0 (pulumi.Input[str])

  • aofStorageConnectionString1 (pulumi.Input[str])

  • enableAuthentication (pulumi.Input[bool]) - If set to false, the Redis instance will be accessible without authentication. Defaults to true.

  • maxclients (pulumi.Input[float]) - Returns the max number of connected clients at the same time.

  • maxfragmentationmemoryReserved (pulumi.Input[float]) - Value in megabytes reserved to accommodate for memory fragmentation. Defaults are shown below.

  • maxmemoryDelta (pulumi.Input[float]) - The max-memory delta for this Redis instance. Defaults are shown below.

  • maxmemoryPolicy (pulumi.Input[str]) - How Redis will select what to remove when maxmemory is reached. Defaults are shown below.

  • maxmemoryReserved (pulumi.Input[float]) - Value in megabytes reserved for non-cache usage e.g. failover. Defaults are shown below.

  • notifyKeyspaceEvents (pulumi.Input[str]) - Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way. Reference

  • rdbBackupEnabled (pulumi.Input[bool]) - Is Backup Enabled? Only supported on Premium SKU’s.

  • rdbBackupFrequency (pulumi.Input[float]) - The Backup Frequency in Minutes. Only supported on Premium SKU’s. Possible values are: 15, 30, 60, 360, 720 and 1440.

  • rdbBackupMaxSnapshotCount (pulumi.Input[float]) - The maximum number of snapshots to create as a backup. Only supported for Premium SKU’s.

  • rdbStorageConnectionString (pulumi.Input[str]) - The Connection String to the Storage Account. Only supported for Premium SKU’s. In the format: DefaultEndpointsProtocol=https;BlobEndpoint=${azurerm_storage_account.example.primary_blob_endpoint};AccountName=${azurerm_storage_account.example.name};AccountKey=${azurerm_storage_account.example.primary_access_key}.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_azure.redis.FirewallRule(resource_name, opts=None, end_ip=None, name=None, redis_cache_name=None, resource_group_name=None, start_ip=None, __props__=None, __name__=None, __opts__=None)

Manages a Firewall Rule associated with a Redis Cache.

import pulumi
import pulumi_azure as azure
import pulumi_random as random

server = random.RandomId("server",
    keepers={
        "azi_id": 1,
    },
    byte_length=8)
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_cache = azure.redis.Cache("exampleCache",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    capacity=1,
    family="P",
    sku_name="Premium",
    enable_non_ssl_port=False,
    redis_configuration={
        "maxclients": 256,
        "maxmemoryReserved": 2,
        "maxmemoryDelta": 2,
        "maxmemoryPolicy": "allkeys-lru",
    })
example_firewall_rule = azure.redis.FirewallRule("exampleFirewallRule",
    redis_cache_name=example_cache.name,
    resource_group_name=example_resource_group.name,
    start_ip="1.2.3.4",
    end_ip="2.3.4.5")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • end_ip (pulumi.Input[str]) – The highest IP address included in the range.

  • name (pulumi.Input[str]) – The name of the Firewall Rule. Changing this forces a new resource to be created.

  • redis_cache_name (pulumi.Input[str]) – The name of the Redis Cache. Changing this forces a new resource to be created.

  • resource_group_name (pulumi.Input[str]) – The name of the resource group in which this Redis Cache exists.

  • start_ip (pulumi.Input[str]) – The lowest IP address included in the range

end_ip: pulumi.Output[str] = None

The highest IP address included in the range.

name: pulumi.Output[str] = None

The name of the Firewall Rule. Changing this forces a new resource to be created.

redis_cache_name: pulumi.Output[str] = None

The name of the Redis Cache. Changing this forces a new resource to be created.

resource_group_name: pulumi.Output[str] = None

The name of the resource group in which this Redis Cache exists.

start_ip: pulumi.Output[str] = None

The lowest IP address included in the range

static get(resource_name, id, opts=None, end_ip=None, name=None, redis_cache_name=None, resource_group_name=None, start_ip=None)

Get an existing FirewallRule resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • end_ip (pulumi.Input[str]) – The highest IP address included in the range.

  • name (pulumi.Input[str]) – The name of the Firewall Rule. Changing this forces a new resource to be created.

  • redis_cache_name (pulumi.Input[str]) – The name of the Redis Cache. Changing this forces a new resource to be created.

  • resource_group_name (pulumi.Input[str]) – The name of the resource group in which this Redis Cache exists.

  • start_ip (pulumi.Input[str]) – The lowest IP address included in the range

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_azure.redis.GetCacheResult(capacity=None, enable_non_ssl_port=None, family=None, hostname=None, id=None, location=None, minimum_tls_version=None, name=None, patch_schedules=None, port=None, primary_access_key=None, primary_connection_string=None, private_static_ip_address=None, redis_configurations=None, resource_group_name=None, secondary_access_key=None, secondary_connection_string=None, shard_count=None, sku_name=None, ssl_port=None, subnet_id=None, tags=None, zones=None)

A collection of values returned by getCache.

capacity = None

The size of the Redis Cache deployed.

enable_non_ssl_port = None

Whether the SSL port is enabled.

family = None

The SKU family/pricing group used. Possible values are C (for Basic/Standard SKU family) and P (for Premium)

hostname = None

The Hostname of the Redis Instance

id = None

The provider-assigned unique ID for this managed resource.

location = None

The location of the Redis Cache.

minimum_tls_version = None

The minimum TLS version.

patch_schedules = None

A list of patch_schedule blocks as defined below - only available for Premium SKU’s.

port = None

The non-SSL Port of the Redis Instance

primary_access_key = None

The Primary Access Key for the Redis Instance

primary_connection_string = None

The primary connection string of the Redis Instance.

redis_configurations = None

A redis_configuration block as defined below.

secondary_access_key = None

The Secondary Access Key for the Redis Instance

secondary_connection_string = None

The secondary connection string of the Redis Instance.

sku_name = None

The SKU of Redis used. Possible values are Basic, Standard and Premium.

ssl_port = None

The SSL Port of the Redis Instance

pulumi_azure.redis.get_cache(name=None, resource_group_name=None, zones=None, opts=None)

Use this data source to access information about an existing Redis Cache

import pulumi
import pulumi_azure as azure

example = azure.redis.get_cache(name="myrediscache",
    resource_group_name="redis-cache")
pulumi.export("primaryAccessKey", example.primary_access_key)
pulumi.export("hostname", example.hostname)
Parameters
  • name (str) – The name of the Redis cache

  • resource_group_name (str) – The name of the resource group the Redis cache instance is located in.