CacheArgs

data class CacheArgs(val accessKeysAuthenticationEnabled: Output<Boolean>? = null, val capacity: Output<Int>? = null, val family: Output<String>? = null, val identity: Output<CacheIdentityArgs>? = null, val location: Output<String>? = null, val minimumTlsVersion: Output<String>? = null, val name: Output<String>? = null, val nonSslPortEnabled: Output<Boolean>? = null, val patchSchedules: Output<List<CachePatchScheduleArgs>>? = null, val privateStaticIpAddress: Output<String>? = null, val publicNetworkAccessEnabled: Output<Boolean>? = null, val redisConfiguration: Output<CacheRedisConfigurationArgs>? = null, val redisVersion: Output<String>? = null, val replicasPerMaster: Output<Int>? = null, val replicasPerPrimary: Output<Int>? = null, val resourceGroupName: Output<String>? = null, val shardCount: Output<Int>? = null, val skuName: Output<String>? = null, val subnetId: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val tenantSettings: Output<Map<String, String>>? = null, val zones: Output<List<String>>? = null) : ConvertibleToJava<CacheArgs>

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

Constructors

Link copied to clipboard
constructor(accessKeysAuthenticationEnabled: Output<Boolean>? = null, capacity: Output<Int>? = null, family: Output<String>? = null, identity: Output<CacheIdentityArgs>? = null, location: Output<String>? = null, minimumTlsVersion: Output<String>? = null, name: Output<String>? = null, nonSslPortEnabled: Output<Boolean>? = null, patchSchedules: Output<List<CachePatchScheduleArgs>>? = null, privateStaticIpAddress: Output<String>? = null, publicNetworkAccessEnabled: Output<Boolean>? = null, redisConfiguration: Output<CacheRedisConfigurationArgs>? = null, redisVersion: Output<String>? = null, replicasPerMaster: Output<Int>? = null, replicasPerPrimary: Output<Int>? = null, resourceGroupName: Output<String>? = null, shardCount: Output<Int>? = null, skuName: Output<String>? = null, subnetId: Output<String>? = null, tags: Output<Map<String, String>>? = null, tenantSettings: Output<Map<String, String>>? = null, zones: Output<List<String>>? = null)

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>? = null

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>? = null

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 identity: Output<CacheIdentityArgs>? = null

An identity block as defined below.

Link copied to clipboard
val location: Output<String>? = null

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

Link copied to clipboard
val minimumTlsVersion: Output<String>? = null

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>? = null

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

Link copied to clipboard
val nonSslPortEnabled: Output<Boolean>? = null

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 privateStaticIpAddress: Output<String>? = null

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
val publicNetworkAccessEnabled: Output<Boolean>? = null

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

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>? = null

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

Link copied to clipboard
val replicasPerMaster: Output<Int>? = null

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

Link copied to clipboard
val replicasPerPrimary: Output<Int>? = null

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
val resourceGroupName: Output<String>? = null

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
val shardCount: Output<Int>? = null

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>? = null

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

Link copied to clipboard
val subnetId: Output<String>? = null

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>>? = null

A mapping of tags to assign to the resource.

Link copied to clipboard
val tenantSettings: Output<Map<String, String>>? = null

A mapping of tenant settings to assign to the resource.

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

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

Functions

Link copied to clipboard
open override fun toJava(): CacheArgs