Cluster class

Provides an ElastiCache Cluster resource, which manages a Memcached cluster, a single-node Redis instance, or a read replica in a Redis (Cluster Mode Enabled) replication group. For more information, refer to the AWS document What is Amazon ElastiCache?.

For working with Redis (Cluster Mode Enabled) replication groups, see the aws.elasticache.ReplicationGroup resource.

> Note: When you change an attribute, such as numCacheNodes, by default it is applied in the next maintenance window. Because of this, this provider may report a difference in its planning phase because the actual modification has not yet taken place. You can use the applyImmediately flag to instruct the service to apply the change immediately. Using applyImmediately can result in a brief downtime as the server reboots. See the "Changes take effect" section of the "Details" column in the AWS Documentation on Engine specific parameters for ElastiCache for Memcached or ElastiCache for Redis OSS for more information.

> Note: Any attribute changes that re-create the resource will be applied immediately, regardless of the value of applyImmediately.

Example Usage

Memcached Cluster

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

const example = new aws.elasticache.Cluster("example", {
    clusterId: "cluster-example",
    engine: "memcached",
    nodeType: "cache.m4.large",
    numCacheNodes: 2,
    parameterGroupName: "default.memcached1.4",
    port: 11211,
});
import pulumi
import pulumi_aws as aws

example = aws.elasticache.Cluster("example",
    cluster_id="cluster-example",
    engine="memcached",
    node_type="cache.m4.large",
    num_cache_nodes=2,
    parameter_group_name="default.memcached1.4",
    port=11211)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.ElastiCache.Cluster("example", new()
    {
        ClusterId = "cluster-example",
        Engine = "memcached",
        NodeType = "cache.m4.large",
        NumCacheNodes = 2,
        ParameterGroupName = "default.memcached1.4",
        Port = 11211,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/elasticache"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := elasticache.NewCluster(ctx, "example", &elasticache.ClusterArgs{
			ClusterId:          pulumi.String("cluster-example"),
			Engine:             pulumi.String("memcached"),
			NodeType:           pulumi.String("cache.m4.large"),
			NumCacheNodes:      pulumi.Int(2),
			ParameterGroupName: pulumi.String("default.memcached1.4"),
			Port:               pulumi.Int(11211),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_elasticache_cluster" "example" {
  cluster_id           = "cluster-example"
  engine               = "memcached"
  node_type            = "cache.m4.large"
  num_cache_nodes      = 2
  parameter_group_name = "default.memcached1.4"
  port                 = 11211
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.elasticache.Cluster;
import com.pulumi.aws.elasticache.ClusterArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 Cluster("example", ClusterArgs.builder()
            .clusterId("cluster-example")
            .engine("memcached")
            .nodeType("cache.m4.large")
            .numCacheNodes(2)
            .parameterGroupName("default.memcached1.4")
            .port(11211)
            .build());

    }
}
resources:
  example:
    type: aws:elasticache:Cluster
    properties:
      clusterId: cluster-example
      engine: memcached
      nodeType: cache.m4.large
      numCacheNodes: 2
      parameterGroupName: default.memcached1.4
      port: 11211

Redis Instance

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

const example = new aws.elasticache.Cluster("example", {
    clusterId: "cluster-example",
    engine: "redis",
    nodeType: "cache.m4.large",
    numCacheNodes: 1,
    parameterGroupName: "default.redis3.2",
    engineVersion: "3.2.10",
    port: 6379,
});
import pulumi
import pulumi_aws as aws

example = aws.elasticache.Cluster("example",
    cluster_id="cluster-example",
    engine="redis",
    node_type="cache.m4.large",
    num_cache_nodes=1,
    parameter_group_name="default.redis3.2",
    engine_version="3.2.10",
    port=6379)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.ElastiCache.Cluster("example", new()
    {
        ClusterId = "cluster-example",
        Engine = "redis",
        NodeType = "cache.m4.large",
        NumCacheNodes = 1,
        ParameterGroupName = "default.redis3.2",
        EngineVersion = "3.2.10",
        Port = 6379,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/elasticache"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := elasticache.NewCluster(ctx, "example", &elasticache.ClusterArgs{
			ClusterId:          pulumi.String("cluster-example"),
			Engine:             pulumi.String("redis"),
			NodeType:           pulumi.String("cache.m4.large"),
			NumCacheNodes:      pulumi.Int(1),
			ParameterGroupName: pulumi.String("default.redis3.2"),
			EngineVersion:      pulumi.String("3.2.10"),
			Port:               pulumi.Int(6379),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_elasticache_cluster" "example" {
  cluster_id           = "cluster-example"
  engine               = "redis"
  node_type            = "cache.m4.large"
  num_cache_nodes      = 1
  parameter_group_name = "default.redis3.2"
  engine_version       = "3.2.10"
  port                 = 6379
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.elasticache.Cluster;
import com.pulumi.aws.elasticache.ClusterArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 Cluster("example", ClusterArgs.builder()
            .clusterId("cluster-example")
            .engine("redis")
            .nodeType("cache.m4.large")
            .numCacheNodes(1)
            .parameterGroupName("default.redis3.2")
            .engineVersion("3.2.10")
            .port(6379)
            .build());

    }
}
resources:
  example:
    type: aws:elasticache:Cluster
    properties:
      clusterId: cluster-example
      engine: redis
      nodeType: cache.m4.large
      numCacheNodes: 1
      parameterGroupName: default.redis3.2
      engineVersion: 3.2.10
      port: 6379

Redis Cluster Mode Disabled Read Replica Instance

These inherit their settings from the replication group.

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

const replica = new aws.elasticache.Cluster("replica", {
    clusterId: "cluster-example",
    replicationGroupId: example.id,
});
import pulumi
import pulumi_aws as aws

replica = aws.elasticache.Cluster("replica",
    cluster_id="cluster-example",
    replication_group_id=example["id"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var replica = new Aws.ElastiCache.Cluster("replica", new()
    {
        ClusterId = "cluster-example",
        ReplicationGroupId = example.Id,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/elasticache"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := elasticache.NewCluster(ctx, "replica", &elasticache.ClusterArgs{
			ClusterId:          pulumi.String("cluster-example"),
			ReplicationGroupId: pulumi.Any(example.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_elasticache_cluster" "replica" {
  cluster_id           = "cluster-example"
  replication_group_id = example.id
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.elasticache.Cluster;
import com.pulumi.aws.elasticache.ClusterArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 replica = new Cluster("replica", ClusterArgs.builder()
            .clusterId("cluster-example")
            .replicationGroupId(example.id())
            .build());

    }
}
resources:
  replica:
    type: aws:elasticache:Cluster
    properties:
      clusterId: cluster-example
      replicationGroupId: ${example.id}

Redis Log Delivery configuration

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

const test = new aws.elasticache.Cluster("test", {
    logDeliveryConfigurations: [
        {
            destination: example.name,
            destinationType: "cloudwatch-logs",
            logFormat: "text",
            logType: "slow-log",
        },
        {
            destination: exampleAwsKinesisFirehoseDeliveryStream.name,
            destinationType: "kinesis-firehose",
            logFormat: "json",
            logType: "engine-log",
        },
    ],
    clusterId: "mycluster",
    engine: "redis",
    nodeType: "cache.t3.micro",
    numCacheNodes: 1,
    port: 6379,
    applyImmediately: true,
});
import pulumi
import pulumi_aws as aws

test = aws.elasticache.Cluster("test",
    log_delivery_configurations=[
        {
            "destination": example["name"],
            "destination_type": "cloudwatch-logs",
            "log_format": "text",
            "log_type": "slow-log",
        },
        {
            "destination": example_aws_kinesis_firehose_delivery_stream["name"],
            "destination_type": "kinesis-firehose",
            "log_format": "json",
            "log_type": "engine-log",
        },
    ],
    cluster_id="mycluster",
    engine="redis",
    node_type="cache.t3.micro",
    num_cache_nodes=1,
    port=6379,
    apply_immediately=True)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var test = new Aws.ElastiCache.Cluster("test", new()
    {
        LogDeliveryConfigurations = new[]
        {
            new Aws.ElastiCache.Inputs.ClusterLogDeliveryConfigurationArgs
            {
                Destination = example.Name,
                DestinationType = "cloudwatch-logs",
                LogFormat = "text",
                LogType = "slow-log",
            },
            new Aws.ElastiCache.Inputs.ClusterLogDeliveryConfigurationArgs
            {
                Destination = exampleAwsKinesisFirehoseDeliveryStream.Name,
                DestinationType = "kinesis-firehose",
                LogFormat = "json",
                LogType = "engine-log",
            },
        },
        ClusterId = "mycluster",
        Engine = "redis",
        NodeType = "cache.t3.micro",
        NumCacheNodes = 1,
        Port = 6379,
        ApplyImmediately = true,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/elasticache"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := elasticache.NewCluster(ctx, "test", &elasticache.ClusterArgs{
			LogDeliveryConfigurations: elasticache.ClusterLogDeliveryConfigurationArray{
				&elasticache.ClusterLogDeliveryConfigurationArgs{
					Destination:     pulumi.Any(example.Name),
					DestinationType: pulumi.String("cloudwatch-logs"),
					LogFormat:       pulumi.String("text"),
					LogType:         pulumi.String("slow-log"),
				},
				&elasticache.ClusterLogDeliveryConfigurationArgs{
					Destination:     pulumi.Any(exampleAwsKinesisFirehoseDeliveryStream.Name),
					DestinationType: pulumi.String("kinesis-firehose"),
					LogFormat:       pulumi.String("json"),
					LogType:         pulumi.String("engine-log"),
				},
			},
			ClusterId:        pulumi.String("mycluster"),
			Engine:           pulumi.String("redis"),
			NodeType:         pulumi.String("cache.t3.micro"),
			NumCacheNodes:    pulumi.Int(1),
			Port:             pulumi.Int(6379),
			ApplyImmediately: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_elasticache_cluster" "test" {
  log_delivery_configurations {
    destination      = example.name
    destination_type = "cloudwatch-logs"
    log_format       = "text"
    log_type         = "slow-log"
  }
  log_delivery_configurations {
    destination      = exampleAwsKinesisFirehoseDeliveryStream.name
    destination_type = "kinesis-firehose"
    log_format       = "json"
    log_type         = "engine-log"
  }
  cluster_id        = "mycluster"
  engine            = "redis"
  node_type         = "cache.t3.micro"
  num_cache_nodes   = 1
  port              = 6379
  apply_immediately = true
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.elasticache.Cluster;
import com.pulumi.aws.elasticache.ClusterArgs;
import com.pulumi.aws.elasticache.inputs.ClusterLogDeliveryConfigurationArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 test = new Cluster("test", ClusterArgs.builder()
            .logDeliveryConfigurations(
                ClusterLogDeliveryConfigurationArgs.builder()
                    .destination(example.name())
                    .destinationType("cloudwatch-logs")
                    .logFormat("text")
                    .logType("slow-log")
                    .build(),
                ClusterLogDeliveryConfigurationArgs.builder()
                    .destination(exampleAwsKinesisFirehoseDeliveryStream.name())
                    .destinationType("kinesis-firehose")
                    .logFormat("json")
                    .logType("engine-log")
                    .build())
            .clusterId("mycluster")
            .engine("redis")
            .nodeType("cache.t3.micro")
            .numCacheNodes(1)
            .port(6379)
            .applyImmediately(true)
            .build());

    }
}
resources:
  test:
    type: aws:elasticache:Cluster
    properties:
      logDeliveryConfigurations:
        - destination: ${example.name}
          destinationType: cloudwatch-logs
          logFormat: text
          logType: slow-log
        - destination: ${exampleAwsKinesisFirehoseDeliveryStream.name}
          destinationType: kinesis-firehose
          logFormat: json
          logType: engine-log
      clusterId: mycluster
      engine: redis
      nodeType: cache.t3.micro
      numCacheNodes: 1
      port: 6379
      applyImmediately: true

Elasticache Cluster in Outpost

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

const example = aws.outposts.getOutposts({});
const exampleGetOutpost = example.then(example => aws.outposts.getOutpost({
    id: example.ids?.[0],
}));
const exampleVpc = new aws.ec2.Vpc("example", {cidrBlock: "10.0.0.0/16"});
const exampleSubnet = new aws.ec2.Subnet("example", {
    vpcId: exampleVpc.id,
    cidrBlock: "10.0.1.0/24",
    tags: {
        Name: "my-subnet",
    },
});
const exampleSubnetGroup = new aws.elasticache.SubnetGroup("example", {
    name: "my-cache-subnet",
    subnetIds: [exampleSubnet.id],
});
const exampleCluster = new aws.elasticache.Cluster("example", {
    clusterId: "cluster-example",
    outpostMode: "single-outpost",
    preferredOutpostArn: exampleGetOutpost.then(exampleGetOutpost => exampleGetOutpost.arn),
    engine: "memcached",
    nodeType: "cache.r5.large",
    numCacheNodes: 2,
    parameterGroupName: "default.memcached1.4",
    port: 11211,
    subnetGroupName: exampleSubnetGroup.name,
});
import pulumi
import pulumi_aws as aws

example = aws.outposts.get_outposts()
example_get_outpost = aws.outposts.get_outpost(id=example.ids[0])
example_vpc = aws.ec2.Vpc("example", cidr_block="10.0.0.0/16")
example_subnet = aws.ec2.Subnet("example",
    vpc_id=example_vpc.id,
    cidr_block="10.0.1.0/24",
    tags={
        "Name": "my-subnet",
    })
example_subnet_group = aws.elasticache.SubnetGroup("example",
    name="my-cache-subnet",
    subnet_ids=[example_subnet.id])
example_cluster = aws.elasticache.Cluster("example",
    cluster_id="cluster-example",
    outpost_mode="single-outpost",
    preferred_outpost_arn=example_get_outpost.arn,
    engine="memcached",
    node_type="cache.r5.large",
    num_cache_nodes=2,
    parameter_group_name="default.memcached1.4",
    port=11211,
    subnet_group_name=example_subnet_group.name)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = Aws.Outposts.GetOutposts.Invoke();

    var exampleGetOutpost = Aws.Outposts.GetOutpost.Invoke(new()
    {
        Id = example.Apply(getOutpostsResult => getOutpostsResult.Ids[0]),
    });

    var exampleVpc = new Aws.Ec2.Vpc("example", new()
    {
        CidrBlock = "10.0.0.0/16",
    });

    var exampleSubnet = new Aws.Ec2.Subnet("example", new()
    {
        VpcId = exampleVpc.Id,
        CidrBlock = "10.0.1.0/24",
        Tags =
        {
            { "Name", "my-subnet" },
        },
    });

    var exampleSubnetGroup = new Aws.ElastiCache.SubnetGroup("example", new()
    {
        Name = "my-cache-subnet",
        SubnetIds = new[]
        {
            exampleSubnet.Id,
        },
    });

    var exampleCluster = new Aws.ElastiCache.Cluster("example", new()
    {
        ClusterId = "cluster-example",
        OutpostMode = "single-outpost",
        PreferredOutpostArn = exampleGetOutpost.Apply(getOutpostResult => getOutpostResult.Arn),
        Engine = "memcached",
        NodeType = "cache.r5.large",
        NumCacheNodes = 2,
        ParameterGroupName = "default.memcached1.4",
        Port = 11211,
        SubnetGroupName = exampleSubnetGroup.Name,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ec2"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/elasticache"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/outposts"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := outposts.GetOutposts(ctx, &outposts.GetOutpostsArgs{}, nil)
		if err != nil {
			return err
		}
		exampleGetOutpost, err := outposts.GetOutpost(ctx, &outposts.GetOutpostArgs{
			Id: pulumi.StringRef(example.Ids[0]),
		}, nil)
		if err != nil {
			return err
		}
		exampleVpc, err := ec2.NewVpc(ctx, "example", &ec2.VpcArgs{
			CidrBlock: pulumi.String("10.0.0.0/16"),
		})
		if err != nil {
			return err
		}
		exampleSubnet, err := ec2.NewSubnet(ctx, "example", &ec2.SubnetArgs{
			VpcId:     exampleVpc.ID().ToIDOutput().ToStringOutput(),
			CidrBlock: pulumi.String("10.0.1.0/24"),
			Tags: pulumi.StringMap{
				"Name": pulumi.String("my-subnet"),
			},
		})
		if err != nil {
			return err
		}
		exampleSubnetGroup, err := elasticache.NewSubnetGroup(ctx, "example", &elasticache.SubnetGroupArgs{
			Name: pulumi.String("my-cache-subnet"),
			SubnetIds: pulumi.StringArray{
				exampleSubnet.ID().ToIDOutput().ToStringOutput(),
			},
		})
		if err != nil {
			return err
		}
		_, err = elasticache.NewCluster(ctx, "example", &elasticache.ClusterArgs{
			ClusterId:           pulumi.String("cluster-example"),
			OutpostMode:         pulumi.String("single-outpost"),
			PreferredOutpostArn: pulumi.String(exampleGetOutpost.Arn),
			Engine:              pulumi.String("memcached"),
			NodeType:            pulumi.String("cache.r5.large"),
			NumCacheNodes:       pulumi.Int(2),
			ParameterGroupName:  pulumi.String("default.memcached1.4"),
			Port:                pulumi.Int(11211),
			SubnetGroupName:     exampleSubnetGroup.Name,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

data "aws_outposts_getoutposts" "example" {
}
data "aws_outposts_getoutpost" "exampleGetOutpost" {
  id = data.aws_outposts_getoutposts.example.ids[0]
}

resource "aws_ec2_vpc" "example" {
  cidr_block = "10.0.0.0/16"
}
resource "aws_ec2_subnet" "example" {
  vpc_id     = aws_ec2_vpc.example.id
  cidr_block = "10.0.1.0/24"
  tags = {
    "Name" = "my-subnet"
  }
}
resource "aws_elasticache_subnetgroup" "example" {
  name       = "my-cache-subnet"
  subnet_ids = [aws_ec2_subnet.example.id]
}
resource "aws_elasticache_cluster" "example" {
  cluster_id            = "cluster-example"
  outpost_mode          = "single-outpost"
  preferred_outpost_arn = data.aws_outposts_getoutpost.exampleGetOutpost.arn
  engine                = "memcached"
  node_type             = "cache.r5.large"
  num_cache_nodes       = 2
  parameter_group_name  = "default.memcached1.4"
  port                  = 11211
  subnet_group_name     = aws_elasticache_subnetgroup.example.name
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.outposts.OutpostsFunctions;
import com.pulumi.aws.outposts.inputs.GetOutpostsArgs;
import com.pulumi.aws.outposts.inputs.GetOutpostArgs;
import com.pulumi.aws.ec2.Vpc;
import com.pulumi.aws.ec2.VpcArgs;
import com.pulumi.aws.ec2.Subnet;
import com.pulumi.aws.ec2.SubnetArgs;
import com.pulumi.aws.elasticache.SubnetGroup;
import com.pulumi.aws.elasticache.SubnetGroupArgs;
import com.pulumi.aws.elasticache.Cluster;
import com.pulumi.aws.elasticache.ClusterArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        final var example = OutpostsFunctions.getOutposts(GetOutpostsArgs.builder()
            .build());

        final var exampleGetOutpost = OutpostsFunctions.getOutpost(GetOutpostArgs.builder()
            .id(example.ids()[0])
            .build());

        var exampleVpc = new Vpc("exampleVpc", VpcArgs.builder()
            .cidrBlock("10.0.0.0/16")
            .build());

        var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
            .vpcId(exampleVpc.id())
            .cidrBlock("10.0.1.0/24")
            .tags(Map.of("Name", "my-subnet"))
            .build());

        var exampleSubnetGroup = new SubnetGroup("exampleSubnetGroup", SubnetGroupArgs.builder()
            .name("my-cache-subnet")
            .subnetIds(exampleSubnet.id())
            .build());

        var exampleCluster = new Cluster("exampleCluster", ClusterArgs.builder()
            .clusterId("cluster-example")
            .outpostMode("single-outpost")
            .preferredOutpostArn(exampleGetOutpost.arn())
            .engine("memcached")
            .nodeType("cache.r5.large")
            .numCacheNodes(2)
            .parameterGroupName("default.memcached1.4")
            .port(11211)
            .subnetGroupName(exampleSubnetGroup.name())
            .build());

    }
}
resources:
  exampleVpc:
    type: aws:ec2:Vpc
    name: example
    properties:
      cidrBlock: 10.0.0.0/16
  exampleSubnet:
    type: aws:ec2:Subnet
    name: example
    properties:
      vpcId: ${exampleVpc.id}
      cidrBlock: 10.0.1.0/24
      tags:
        Name: my-subnet
  exampleSubnetGroup:
    type: aws:elasticache:SubnetGroup
    name: example
    properties:
      name: my-cache-subnet
      subnetIds:
        - ${exampleSubnet.id}
  exampleCluster:
    type: aws:elasticache:Cluster
    name: example
    properties:
      clusterId: cluster-example
      outpostMode: single-outpost
      preferredOutpostArn: ${exampleGetOutpost.arn}
      engine: memcached
      nodeType: cache.r5.large
      numCacheNodes: 2
      parameterGroupName: default.memcached1.4
      port: 11211
      subnetGroupName: ${exampleSubnetGroup.name}
variables:
  example:
    fn::invoke:
      function: aws:outposts:getOutposts
      arguments: {}
  exampleGetOutpost:
    fn::invoke:
      function: aws:outposts:getOutpost
      arguments:
        id: ${example.ids[0]}

Import

Using pulumi import, import ElastiCache Clusters using the clusterId. For example:

$ pulumi import aws:elasticache/cluster:Cluster my_cluster my_cluster

Constructors

Cluster(String name, {ClusterArgs? args, CustomResourceOptions? options})
Creates a new Cluster. name The Pulumi resource name. args Arguments used to configure this Cluster. The set of arguments for Cluster. options Resource options controlling this resource's behavior.
Cluster.reference(String urn)
Creates a typed reference to an existing Cluster resource.

Properties

applyImmediately ↔ Output<bool>
Whether any database modifications are applied immediately, or during the next maintenance window. Default is false. See Amazon ElastiCache Documentation for more information.
latefinal
arn ↔ Output<String>
The ARN of the created ElastiCache Cluster.
latefinal
autoMinorVersionUpgrade ↔ Output<String?>
Specifies whether minor version engine upgrades will be applied automatically to the underlying Cache Cluster instances during the maintenance window. Only supported for engine type "redis" and if the engine version is 6 or higher. Defaults to true.
latefinal
availabilityZone ↔ Output<String>
Availability Zone for the cache cluster. If you want to create cache nodes in multi-az, use preferredAvailabilityZones instead. Default: System chosen Availability Zone. Changing this value will re-create the resource.
latefinal
azMode ↔ Output<String>
Whether the nodes in this Memcached node group are created in a single Availability Zone or created across multiple Availability Zones in the cluster's region. Valid values for this parameter are single-az or cross-az, default is single-az. If you want to choose cross-az, numCacheNodes must be greater than 1.
latefinal
cacheNodes ↔ Output<List<ClusterCacheNode>>
List of node objects including id, address, port and availabilityZone.
latefinal
childResources → Set<Resource>
finalinherited
clusterAddress ↔ Output<String>
(Memcached only) DNS name of the cache cluster without the port appended.
latefinal
clusterId ↔ Output<String>
Group identifier. ElastiCache converts this name to lowercase. Changing this value will re-create the resource.
latefinal
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
configurationEndpoint ↔ Output<String>
(Memcached only) Configuration endpoint to allow host discovery.
latefinal
engine ↔ Output<String>
Name of the cache engine to be used for this cache cluster. Valid values are memcached, redis.
latefinal
engineVersion ↔ Output<String>
Version number of the cache engine to be used. If not set, defaults to the latest version. See Describe Cache Engine Versions in the AWS Documentation for supported versions. When engine is redis and the version is 7 or higher, the major and minor version should be set, e.g., 7.2. When the version is 6, the major and minor version can be set, e.g., 6.2, or the minor version can be unspecified which will use the latest version at creation time, e.g., 6.x. Otherwise, specify the full version desired, e.g., 5.0.6. The actual engine version used is returned in the attribute engineVersionActual, see Attribute Reference below. Cannot be provided with replication_group_id.
latefinal
engineVersionActual ↔ Output<String>
Because ElastiCache pulls the latest minor or patch for a version, this attribute returns the running version of the cache engine.
latefinal
finalSnapshotIdentifier ↔ Output<String?>
Name of your final cluster snapshot. If omitted, no final snapshot will be made.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
ipDiscovery ↔ Output<String>
The IP version to advertise in the discovery protocol. Valid values are ipv4 or ipv6.
latefinal
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
logDeliveryConfigurations ↔ Output<List<ClusterLogDeliveryConfiguration>?>
Specifies the destination and format of Redis SLOWLOG or Redis Engine Log. See the documentation on Amazon ElastiCache. See Log Delivery Configuration below for more details.
latefinal
maintenanceWindow ↔ Output<String>
Specifies the weekly time range for when maintenance on the cache cluster is performed. The format is ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window is a 60 minute period. Example: sun:05:00-sun:09:00.
latefinal
networkType ↔ Output<String>
The IP versions for cache cluster connections. IPv6 is supported with Redis engine 6.2 onword or Memcached version 1.6.6 for all Nitro system instances. Valid values are ipv4, ipv6 or dualStack.
latefinal
nodeType ↔ Output<String>
The instance class used. See AWS documentation for information on supported node types for Redis OSS and guidance on selecting node types for Redis OSS. See AWS documentation for information on supported node types for Memcached and guidance on selecting node types for Memcached. For Memcached, changing this value will re-create the resource.
latefinal
notificationTopicArn ↔ Output<String?>
ARN of an SNS topic to send ElastiCache notifications to. Example: arn:aws:sns:us-east-1:012345678999:my_sns_topic.
latefinal
numCacheNodes ↔ Output<int>
The initial number of cache nodes that the cache cluster will have. For Redis, this value must be 1. For Memcached, this value must be between 1 and 40. If this number is reduced on subsequent runs, the highest numbered nodes will be removed.
latefinal
outpostMode ↔ Output<String?>
Specify the outpost mode that will apply to the cache cluster creation. Valid values are "single-outpost" and "cross-outpost", however AWS currently only supports "single-outpost" mode.
latefinal
parameterGroupName ↔ Output<String>
The name of the parameter group to associate with this cache cluster.
latefinal
port ↔ Output<int>
The port number on which each of the cache nodes will accept connections. For Memcached the default is 11211, and for Redis the default port is 6379. Cannot be provided with replicationGroupId. Changing this value will re-create the resource.
latefinal
preferredAvailabilityZones ↔ Output<List<String>?>
List of the Availability Zones in which cache nodes are created. If you are creating your cluster in an Amazon VPC you can only locate nodes in Availability Zones that are associated with the subnets in the selected subnet group. The number of Availability Zones listed must equal the value of numCacheNodes. If you want all the nodes in the same Availability Zone, use availabilityZone instead, or repeat the Availability Zone multiple times in the list. Default: System chosen Availability Zones. Detecting drift of existing node availability zone is not currently supported. Updating this argument by itself to migrate existing node availability zones is not currently supported and will show a perpetual difference.
latefinal
preferredOutpostArn ↔ Output<String>
The outpost ARN in which the cache cluster will be created.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
replicationGroupId ↔ Output<String>
ID of the replication group to which this cluster should belong. If this parameter is specified, the cluster is added to the specified replication group as a read replica; otherwise, the cluster is a standalone primary that is not part of any replication group.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
securityGroupIds ↔ Output<List<String>>
One or more VPC security groups associated with the cache cluster. Cannot be provided with replication_group_id.
latefinal
snapshotArns ↔ Output<String?>
Single-element string list containing an ARN of a Redis RDB snapshot file stored in Amazon S3. The object name cannot contain any commas. Changing snapshotArns forces a new resource.
latefinal
snapshotName ↔ Output<String?>
Name of a snapshot from which to restore data into the new node group. Changing snapshotName forces a new resource.
latefinal
snapshotRetentionLimit ↔ Output<int?>
Number of days for which ElastiCache will retain automatic cache cluster snapshots before deleting them. For example, if you set SnapshotRetentionLimit to 5, then a snapshot that was taken today will be retained for 5 days before being deleted. If the value of SnapshotRetentionLimit is set to zero (0), backups are turned off. Please note that setting a snapshotRetentionLimit is not supported on cache.t1.micro cache nodes
latefinal
snapshotWindow ↔ Output<String>
Daily time range (in UTC) during which ElastiCache will begin taking a daily snapshot of your cache cluster. Example: 05:00-09:00
latefinal
subnetGroupName ↔ Output<String>
Name of the subnet group to be used for the cache cluster. Changing this value will re-create the resource. Cannot be provided with replication_group_id.
latefinal
tags ↔ Output<Map<String, String>?>
Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
latefinal
tagsAll ↔ Output<Map<String, String>>
Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
transitEncryptionEnabled ↔ Output<bool>
Enable encryption in-transit. Supported only with Memcached versions 1.6.12 and later, running in a VPC. For Redis or Valkey transit encryption, use aws.elasticache.ReplicationGroup instead. See the ElastiCache in-transit encryption documentation for more details.
latefinal
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {ClusterState? state, CustomResourceOptions? options}) → Cluster
Gets an existing Cluster resource's state with the given name and id.