Cache
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
Whether access key authentication is enabled? Defaults to true
. active_directory_authentication_enabled
must be set to true
to disable access key authentication.
An identity
block as defined below.
The minimum TLS version. Possible values are 1.0
, 1.1
and 1.2
. Defaults to 1.0
.
Enable the non-SSL port (6379) - disabled by default.
A list of patch_schedule
blocks as defined below.
The Primary Access Key for the Redis Instance
The primary connection string of the Redis Instance.
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.
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
.
A redis_configuration
block as defined below - with some limitations by SKU - defaults/details are shown below.
Redis version. Only major version needed. Possible values are 4
and 6
. Defaults to 6
.
Amount of replicas to create per master for this Redis Cache.
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.
The name of the resource group in which to create the Redis instance. Changing this forces a new resource to be created.
The Secondary Access Key for the Redis Instance
The secondary connection string of the Redis Instance.
Only available when using the Premium SKU The number of Shards to create on the Redis Cluster.
A mapping of tenant settings to assign to the resource.