Module redis

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.

Resources

Functions

Others

Resources

Resource Cache

class Cache extends CustomResource

Manages a Redis Cache.

Example Usage

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

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

Default Redis Configuration Values

Redis ValueBasicStandardPremium
enableAuthenticationtruetruetrue
maxmemoryReserved250200
maxfragmentationmemoryReserved250200
maxmemoryDelta250200
maxmemoryPolicyvolatile-lruvolatile-lruvolatile-lru

NOTE: The maxmemoryReserved, maxmemoryDelta and maxfragmentationmemory-reserved settings are only available for Standard and Premium caches. More details are available in the Relevant Links section below._


A patchSchedule block supports the following:

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

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

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

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

public static isInstance(obj: any): obj is Cache

Returns true if the given object is an instance of Cache. 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 (6379) - disabled by default.

property family

public family: pulumi.Output<string>;

The SKU family/pricing group to use. Valid values are C (for Basic/Standard SKU family) and P (for 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 minimumTlsVersion

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

The minimum TLS version. Defaults to 1.0.

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<CachePatchSchedule[] | undefined>;

A list of patchSchedule 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 primaryConnectionString

public primaryConnectionString: pulumi.Output<string>;

The primary connection string of 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<CacheRedisConfiguration>;

A redisConfiguration 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 secondaryConnectionString

public secondaryConnectionString: pulumi.Output<string>;

The secondary connection string of 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. Possible values are Basic, Standard and Premium.

property sslPort

public sslPort: pulumi.Output<number>;

The SSL Port of the Redis Instance

property subnetId

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

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.

property tags

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

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.

Resource FirewallRule

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 server = new random.RandomId("server", {
    keepers: {
        azi_id: 1,
    },
    byteLength: 8,
});
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleCache = new azure.redis.Cache("exampleCache", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    capacity: 1,
    family: "P",
    skuName: "Premium",
    enableNonSslPort: false,
    redis_configuration: {
        maxclients: 256,
        maxmemoryReserved: 2,
        maxmemoryDelta: 2,
        maxmemoryPolicy: "allkeys-lru",
    },
});
const exampleFirewallRule = new azure.redis.FirewallRule("exampleFirewallRule", {
    redisCacheName: exampleCache.name,
    resourceGroupName: exampleResourceGroup.name,
    startIp: "1.2.3.4",
    endIp: "2.3.4.5",
});

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

public static isInstance(obj: any): obj is FirewallRule

Returns true if the given object is an instance of FirewallRule. 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.

Functions

Function getCache

getCache(args: GetCacheArgs, opts?: pulumi.InvokeOptions): Promise<GetCacheResult>

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

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

const example = azure.redis.getCache({
    name: "myrediscache",
    resourceGroupName: "redis-cache",
});
export const primaryAccessKey = example.then(example => example.primaryAccessKey);
export const hostname = example.then(example => example.hostname);

Others

interface CacheArgs

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 (6379) - disabled by default.

property family

family: pulumi.Input<string>;

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

property location

location?: pulumi.Input<string>;

The location of the resource group.

property minimumTlsVersion

minimumTlsVersion?: pulumi.Input<string>;

The minimum TLS version. Defaults to 1.0.

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<CachePatchSchedule>[]>;

A list of patchSchedule 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<CacheRedisConfiguration>;

A redisConfiguration 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. Possible values are Basic, Standard and Premium.

property subnetId

subnetId?: pulumi.Input<string>;

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.

property tags

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

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

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 (6379) - disabled by default.

property family

family?: pulumi.Input<string>;

The SKU family/pricing group to use. Valid values are C (for Basic/Standard SKU family) and P (for 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 minimumTlsVersion

minimumTlsVersion?: pulumi.Input<string>;

The minimum TLS version. Defaults to 1.0.

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<CachePatchSchedule>[]>;

A list of patchSchedule 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 primaryConnectionString

primaryConnectionString?: pulumi.Input<string>;

The primary connection string of 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<CacheRedisConfiguration>;

A redisConfiguration 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 secondaryConnectionString

secondaryConnectionString?: pulumi.Input<string>;

The secondary connection string of 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. Possible values are Basic, Standard and Premium.

property sslPort

sslPort?: pulumi.Input<number>;

The SSL Port of the Redis Instance

property subnetId

subnetId?: pulumi.Input<string>;

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.

property tags

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

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

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

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

interface GetCacheArgs

interface GetCacheArgs

A collection of arguments for invoking getCache.

property name

name: string;

The name of the Redis cache

property resourceGroupName

resourceGroupName: string;

The name of the resource group the Redis cache instance is located in.

property zones

zones?: string[];

interface GetCacheResult

interface GetCacheResult

A collection of values returned by getCache.

property capacity

capacity: number;

The size of the Redis Cache deployed.

property enableNonSslPort

enableNonSslPort: boolean;

Whether the SSL port is enabled.

property family

family: string;

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

property hostname

hostname: string;

The Hostname of the Redis Instance

property id

id: string;

The provider-assigned unique ID for this managed resource.

property location

location: string;

The location of the Redis Cache.

property minimumTlsVersion

minimumTlsVersion: string;

The minimum TLS version.

property name

name: string;

property patchSchedules

patchSchedules: GetCachePatchSchedule[];

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

property port

port: number;

The non-SSL Port of the Redis Instance

property primaryAccessKey

primaryAccessKey: string;

The Primary Access Key for the Redis Instance

property primaryConnectionString

primaryConnectionString: string;

The primary connection string of the Redis Instance.

property privateStaticIpAddress

privateStaticIpAddress: string;

property redisConfigurations

redisConfigurations: GetCacheRedisConfiguration[];

A redisConfiguration block as defined below.

property resourceGroupName

resourceGroupName: string;

property secondaryAccessKey

secondaryAccessKey: string;

The Secondary Access Key for the Redis Instance

property secondaryConnectionString

secondaryConnectionString: string;

The secondary connection string of the Redis Instance.

property shardCount

shardCount: number;

property skuName

skuName: string;

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

property sslPort

sslPort: number;

The SSL Port of the Redis Instance

property subnetId

subnetId: string;

property tags

tags: {[key: string]: string};

property zones

zones: string[];