Module redis

@pulumi/azure > redis

class Cache

extends CustomResource

Manages a Redis Cache.

Example Usage (Basic)

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "West US",
});
// NOTE: the Name used for Redis needs to be globally unique
const testCache = new azure.redis.Cache("test", {
    capacity: 0,
    enableNonSslPort: false,
    family: "C",
    location: testResourceGroup.location,
    resourceGroupName: testResourceGroup.name,
    skuName: "Basic",
});

Example Usage (Standard)

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "West US",
});
// NOTE: the Name used for Redis needs to be globally unique
const testCache = new azure.redis.Cache("test", {
    capacity: 2,
    enableNonSslPort: false,
    family: "C",
    location: testResourceGroup.location,
    resourceGroupName: testResourceGroup.name,
    skuName: "Standard",
});

Example Usage (Premium with Clustering)

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "West US",
});
// NOTE: the Name used for Redis needs to be globally unique
const testCache = new azure.redis.Cache("test", {
    capacity: 1,
    enableNonSslPort: false,
    family: "P",
    location: testResourceGroup.location,
    redisConfiguration: {
        maxmemoryDelta: 2,
        maxmemoryPolicy: "allkeys-lru",
        maxmemoryReserved: 2,
    },
    resourceGroupName: testResourceGroup.name,
    shardCount: 3,
    skuName: "Premium",
});

Example Usage (Premium with Backup)

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "West US",
});
const testAccount = new azure.storage.Account("test", {
    accountReplicationType: "GRS",
    accountTier: "Standard",
    location: testResourceGroup.location,
    resourceGroupName: testResourceGroup.name,
});
// NOTE: the Name used for Redis needs to be globally unique
const testCache = new azure.redis.Cache("test", {
    capacity: 3,
    enableNonSslPort: false,
    family: "P",
    location: testResourceGroup.location,
    redisConfiguration: {
        rdbBackupEnabled: true,
        rdbBackupFrequency: 60,
        rdbBackupMaxSnapshotCount: 1,
        rdbStorageConnectionString: pulumi.all([testAccount.primaryBlobEndpoint, testAccount.name, testAccount.primaryAccessKey]).apply(([primaryBlobEndpoint, name, primaryAccessKey]) => `DefaultEndpointsProtocol=https;BlobEndpoint=${primaryBlobEndpoint};AccountName=${name};AccountKey=${primaryAccessKey}`),
    },
    resourceGroupName: testResourceGroup.name,
    skuName: "Premium",
});

Default Redis Configuration Values

Redis Value Basic Standard Premium
maxmemory_reserved 2 50 200
maxmemory_delta 2 50 200
maxmemory_policy volatile-lru volatile-lru volatile-lru

*Important*: The maxmemory_reserved and maxmemory_delta settings are only available for Standard and Premium caches. More details are available in the Relevant Links section below.

  • patch_schedule 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.

constructor

new Cache(name: string, args: CacheArgs, opts?: pulumi.CustomResourceOptions)

Create a Cache resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: CacheState, opts?: pulumi.CustomResourceOptions): Cache

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property capacity

public capacity: pulumi.Output<number>;

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.

property enableNonSslPort

public enableNonSslPort: pulumi.Output<boolean | undefined>;

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

property family

public family: pulumi.Output<string>;

The SKU family to use. Valid values are C and P, where C = Basic/Standard, P = Premium.

property hostname

public hostname: pulumi.Output<string>;

The Hostname of the Redis Instance

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property location

public location: pulumi.Output<string>;

The location of the resource group.

property name

public name: pulumi.Output<string>;

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

property patchSchedules

public patchSchedules: pulumi.Output<{
    dayOfWeek: string;
    startHourUtc: number;
}[] | undefined>;

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

property port

public port: pulumi.Output<number>;

The non-SSL Port of the Redis Instance

property primaryAccessKey

public primaryAccessKey: pulumi.Output<string>;

The Primary Access Key for the Redis Instance

property privateStaticIpAddress

public privateStaticIpAddress: pulumi.Output<string>;

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.

property redisConfiguration

public redisConfiguration: pulumi.Output<{
    maxclients: number;
    maxmemoryDelta: number;
    maxmemoryPolicy: string;
    maxmemoryReserved: number;
    notifyKeyspaceEvents: string;
    rdbBackupEnabled: boolean;
    rdbBackupFrequency: number;
    rdbBackupMaxSnapshotCount: number;
    rdbStorageConnectionString: string;
}>;

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

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

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

property secondaryAccessKey

public secondaryAccessKey: pulumi.Output<string>;

The Secondary Access Key for the Redis Instance

property shardCount

public shardCount: pulumi.Output<number | undefined>;

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

property skuName

public skuName: pulumi.Output<string>;

The SKU of Redis to use - can be either Basic, Standard or Premium.

property sslPort

public sslPort: pulumi.Output<number>;

The SSL Port of the Redis Instance

property subnetId

public subnetId: pulumi.Output<string | undefined>;

The ID of the Subnet within which the Redis Cache should be deployed. Changing this forces a new resource to be created.

property tags

public tags: pulumi.Output<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property zones

public zones: pulumi.Output<string | undefined>;

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

class FirewallRule

extends CustomResource

Manages a Firewall Rule associated with a Redis Cache.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
import * as random from "@pulumi/random";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "West Europe",
});
const server = new random.RandomId("server", {
    byteLength: 8,
    keepers: {
        azi_id: 1,
    },
});
const testCache = new azure.redis.Cache("test", {
    capacity: 1,
    enableNonSslPort: false,
    family: "P",
    location: testResourceGroup.location,
    redisConfiguration: {
        maxclients: 256,
        maxmemoryDelta: 2,
        maxmemoryPolicy: "allkeys-lru",
        maxmemoryReserved: 2,
    },
    resourceGroupName: testResourceGroup.name,
    skuName: "Premium",
});
const testFirewallRule = new azure.redis.FirewallRule("test", {
    endIp: "2.3.4.5",
    redisCacheName: testCache.name,
    resourceGroupName: testResourceGroup.name,
    startIp: "1.2.3.4",
});

constructor

new FirewallRule(name: string, args: FirewallRuleArgs, opts?: pulumi.CustomResourceOptions)

Create a FirewallRule resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: FirewallRuleState, opts?: pulumi.CustomResourceOptions): FirewallRule

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property endIp

public endIp: pulumi.Output<string>;

The highest IP address included in the range.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

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

property redisCacheName

public redisCacheName: pulumi.Output<string>;

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

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

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

property startIp

public startIp: pulumi.Output<string>;

The lowest IP address included in the range

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

interface CacheArgs

The set of arguments for constructing a Cache resource.

property capacity

capacity: pulumi.Input<number>;

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.

property enableNonSslPort

enableNonSslPort?: pulumi.Input<boolean>;

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

property family

family: pulumi.Input<string>;

The SKU family to use. Valid values are C and P, where C = Basic/Standard, P = Premium.

property location

location: pulumi.Input<string>;

The location of the resource group.

property name

name?: pulumi.Input<string>;

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

property patchSchedules

patchSchedules?: pulumi.Input<pulumi.Input<{
    dayOfWeek: pulumi.Input<string>;
    startHourUtc: pulumi.Input<number>;
}>[]>;

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

property privateStaticIpAddress

privateStaticIpAddress?: pulumi.Input<string>;

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.

property redisConfiguration

redisConfiguration: pulumi.Input<{
    maxclients: pulumi.Input<number>;
    maxmemoryDelta: pulumi.Input<number>;
    maxmemoryPolicy: pulumi.Input<string>;
    maxmemoryReserved: pulumi.Input<number>;
    notifyKeyspaceEvents: pulumi.Input<string>;
    rdbBackupEnabled: pulumi.Input<boolean>;
    rdbBackupFrequency: pulumi.Input<number>;
    rdbBackupMaxSnapshotCount: pulumi.Input<number>;
    rdbStorageConnectionString: pulumi.Input<string>;
}>;

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

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

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

property shardCount

shardCount?: pulumi.Input<number>;

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

property skuName

skuName: pulumi.Input<string>;

The SKU of Redis to use - can be either Basic, Standard or Premium.

property subnetId

subnetId?: pulumi.Input<string>;

The ID of the Subnet within which the Redis Cache should be deployed. Changing this forces a new resource to be created.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property zones

zones?: pulumi.Input<string>;

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

interface CacheState

Input properties used for looking up and filtering Cache resources.

property capacity

capacity?: pulumi.Input<number>;

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.

property enableNonSslPort

enableNonSslPort?: pulumi.Input<boolean>;

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

property family

family?: pulumi.Input<string>;

The SKU family to use. Valid values are C and P, where C = Basic/Standard, P = Premium.

property hostname

hostname?: pulumi.Input<string>;

The Hostname of the Redis Instance

property location

location?: pulumi.Input<string>;

The location of the resource group.

property name

name?: pulumi.Input<string>;

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

property patchSchedules

patchSchedules?: pulumi.Input<pulumi.Input<{
    dayOfWeek: pulumi.Input<string>;
    startHourUtc: pulumi.Input<number>;
}>[]>;

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

property port

port?: pulumi.Input<number>;

The non-SSL Port of the Redis Instance

property primaryAccessKey

primaryAccessKey?: pulumi.Input<string>;

The Primary Access Key for the Redis Instance

property privateStaticIpAddress

privateStaticIpAddress?: pulumi.Input<string>;

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.

property redisConfiguration

redisConfiguration?: pulumi.Input<{
    maxclients: pulumi.Input<number>;
    maxmemoryDelta: pulumi.Input<number>;
    maxmemoryPolicy: pulumi.Input<string>;
    maxmemoryReserved: pulumi.Input<number>;
    notifyKeyspaceEvents: pulumi.Input<string>;
    rdbBackupEnabled: pulumi.Input<boolean>;
    rdbBackupFrequency: pulumi.Input<number>;
    rdbBackupMaxSnapshotCount: pulumi.Input<number>;
    rdbStorageConnectionString: pulumi.Input<string>;
}>;

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

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

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

property secondaryAccessKey

secondaryAccessKey?: pulumi.Input<string>;

The Secondary Access Key for the Redis Instance

property shardCount

shardCount?: pulumi.Input<number>;

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

property skuName

skuName?: pulumi.Input<string>;

The SKU of Redis to use - can be either Basic, Standard or Premium.

property sslPort

sslPort?: pulumi.Input<number>;

The SSL Port of the Redis Instance

property subnetId

subnetId?: pulumi.Input<string>;

The ID of the Subnet within which the Redis Cache should be deployed. Changing this forces a new resource to be created.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property zones

zones?: pulumi.Input<string>;

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

interface FirewallRuleArgs

The set of arguments for constructing a FirewallRule resource.

property endIp

endIp: pulumi.Input<string>;

The highest IP address included in the range.

property name

name?: pulumi.Input<string>;

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

property redisCacheName

redisCacheName: pulumi.Input<string>;

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

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

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

property startIp

startIp: pulumi.Input<string>;

The lowest IP address included in the range

interface FirewallRuleState

Input properties used for looking up and filtering FirewallRule resources.

property endIp

endIp?: pulumi.Input<string>;

The highest IP address included in the range.

property name

name?: pulumi.Input<string>;

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

property redisCacheName

redisCacheName?: pulumi.Input<string>;

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

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

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

property startIp

startIp?: pulumi.Input<string>;

The lowest IP address included in the range