Cache

class Cache : KotlinCustomResource

Manages a Redis Cache.

Note: Redis version 4 is being retired and no longer supports creating new instances. Version 4 will be removed in a future release. Redis Version 4 Retirement

Example Usage

This example provisions a Standard Redis Cache.

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
// NOTE: the Name used for Redis needs to be globally unique
const exampleCache = new azure.redis.Cache("example", {
name: "example-cache",
location: example.location,
resourceGroupName: example.name,
capacity: 2,
family: "C",
skuName: "Standard",
nonSslPortEnabled: false,
minimumTlsVersion: "1.2",
redisConfiguration: {},
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
# NOTE: the Name used for Redis needs to be globally unique
example_cache = azure.redis.Cache("example",
name="example-cache",
location=example.location,
resource_group_name=example.name,
capacity=2,
family="C",
sku_name="Standard",
non_ssl_port_enabled=False,
minimum_tls_version="1.2",
redis_configuration={})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
// NOTE: the Name used for Redis needs to be globally unique
var exampleCache = new Azure.Redis.Cache("example", new()
{
Name = "example-cache",
Location = example.Location,
ResourceGroupName = example.Name,
Capacity = 2,
Family = "C",
SkuName = "Standard",
NonSslPortEnabled = false,
MinimumTlsVersion = "1.2",
RedisConfiguration = null,
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/redis"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
// NOTE: the Name used for Redis needs to be globally unique
_, err = redis.NewCache(ctx, "example", &redis.CacheArgs{
Name: pulumi.String("example-cache"),
Location: example.Location,
ResourceGroupName: example.Name,
Capacity: pulumi.Int(2),
Family: pulumi.String("C"),
SkuName: pulumi.String("Standard"),
NonSslPortEnabled: pulumi.Bool(false),
MinimumTlsVersion: pulumi.String("1.2"),
RedisConfiguration: &redis.CacheRedisConfigurationArgs{},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.redis.Cache;
import com.pulumi.azure.redis.CacheArgs;
import com.pulumi.azure.redis.inputs.CacheRedisConfigurationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
// NOTE: the Name used for Redis needs to be globally unique
var exampleCache = new Cache("exampleCache", CacheArgs.builder()
.name("example-cache")
.location(example.location())
.resourceGroupName(example.name())
.capacity(2)
.family("C")
.skuName("Standard")
.nonSslPortEnabled(false)
.minimumTlsVersion("1.2")
.redisConfiguration()
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
# NOTE: the Name used for Redis needs to be globally unique
exampleCache:
type: azure:redis:Cache
name: example
properties:
name: example-cache
location: ${example.location}
resourceGroupName: ${example.name}
capacity: 2
family: C
skuName: Standard
nonSslPortEnabled: false
minimumTlsVersion: '1.2'
redisConfiguration: {}

Relevant Links

Import

Redis Cache's can be imported using the resource id, e.g.

$ pulumi import azure:redis/cache:Cache cache1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Cache/redis/cache1

Properties

Link copied to clipboard

Whether access key authentication is enabled? Defaults to true. active_directory_authentication_enabled must be set to true to disable access key authentication.

Link copied to clipboard
val capacity: Output<Int>

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, 5.

Link copied to clipboard
val family: Output<String>

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

Link copied to clipboard
val hostname: Output<String>

The Hostname of the Redis Instance

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val identity: Output<CacheIdentity>?

An identity block as defined below.

Link copied to clipboard
val location: Output<String>

The location of the resource group. Changing this forces a new resource to be created.

Link copied to clipboard

The minimum TLS version. Possible values are 1.0, 1.1 and 1.2. Defaults to 1.0.

Link copied to clipboard
val name: Output<String>

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

Link copied to clipboard

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

Link copied to clipboard

A list of patch_schedule blocks as defined below.

Link copied to clipboard
val port: Output<Int>

The non-SSL Port of the Redis Instance

Link copied to clipboard

The Primary Access Key for the Redis Instance

Link copied to clipboard

The primary connection string of the Redis Instance.

Link copied to clipboard

The Static IP Address to assign to the Redis Cache when hosted inside the Virtual Network. This argument implies the use of subnet_id. Changing this forces a new resource to be created.

Link copied to clipboard

Whether or not public network access is allowed for this Redis Cache. true means this resource could be accessed by both public and private endpoint. false means only private endpoint access is allowed. Defaults to true.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard
val redisVersion: Output<String>?

Redis version. Only major version needed. Possible values are 4 and 6. Defaults to 6.

Link copied to clipboard
val replicasPerMaster: Output<Int>

Amount of replicas to create per master for this Redis Cache.

Link copied to clipboard
val replicasPerPrimary: Output<Int>

Amount of replicas to create per primary for this Redis Cache. If both replicas_per_primary and replicas_per_master are set, they need to be equal.

Link copied to clipboard

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

Link copied to clipboard

The Secondary Access Key for the Redis Instance

Link copied to clipboard

The secondary connection string of the Redis Instance.

Link copied to clipboard
val shardCount: Output<Int>?

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

Link copied to clipboard
val skuName: Output<String>

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

Link copied to clipboard
val sslPort: Output<Int>

The SSL Port of the Redis Instance

Link copied to clipboard
val subnetId: Output<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.

Link copied to clipboard
val tags: Output<Map<String, String>>?

A mapping of tags to assign to the resource.

Link copied to clipboard

A mapping of tenant settings to assign to the resource.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val zones: Output<List<String>>?

Specifies a list of Availability Zones in which this Redis Cache should be located. Changing this forces a new Redis Cache to be created.