ClusterArgs

data class ClusterArgs(val applyImmediately: Output<Boolean>? = null, val autoMinorVersionUpgrade: Output<String>? = null, val availabilityZone: Output<String>? = null, val azMode: Output<String>? = null, val clusterId: Output<String>? = null, val engine: Output<String>? = null, val engineVersion: Output<String>? = null, val finalSnapshotIdentifier: Output<String>? = null, val ipDiscovery: Output<String>? = null, val logDeliveryConfigurations: Output<List<ClusterLogDeliveryConfigurationArgs>>? = null, val maintenanceWindow: Output<String>? = null, val networkType: Output<String>? = null, val nodeType: Output<String>? = null, val notificationTopicArn: Output<String>? = null, val numCacheNodes: Output<Int>? = null, val outpostMode: Output<String>? = null, val parameterGroupName: Output<String>? = null, val port: Output<Int>? = null, val preferredAvailabilityZones: Output<List<String>>? = null, val preferredOutpostArn: Output<String>? = null, val replicationGroupId: Output<String>? = null, val securityGroupIds: Output<List<String>>? = null, val securityGroupNames: Output<List<String>>? = null, val snapshotArns: Output<String>? = null, val snapshotName: Output<String>? = null, val snapshotRetentionLimit: Output<Int>? = null, val snapshotWindow: Output<String>? = null, val subnetGroupName: Output<String>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<ClusterArgs>

Provides an ElastiCache Cluster resource, which manages either a Memcached cluster, a single-node Redis instance, or a read replica in a Redis (Cluster Mode Enabled) replication group. For working with Redis (Cluster Mode Enabled) replication groups, see the aws.elasticache.ReplicationGroup resource.

Note: When you change an attribute, such as num_cache_nodes, 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 apply_immediately flag to instruct the service to apply the change immediately. Using apply_immediately can result in a brief downtime as the server reboots. See the AWS Documentation on Modifying an ElastiCache Cache Cluster for ElastiCache for Memcached or ElastiCache for Redis for more information. Note: Any attribute changes that re-create the resource will be applied immediately, regardless of the value of apply_immediately.

Example Usage

Memcached Cluster

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.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 Cluster("example", ClusterArgs.builder()
.engine("memcached")
.nodeType("cache.m4.large")
.numCacheNodes(2)
.parameterGroupName("default.memcached1.4")
.port(11211)
.build());
}
}

Redis Instance

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.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 Cluster("example", ClusterArgs.builder()
.engine("redis")
.engineVersion("3.2.10")
.nodeType("cache.m4.large")
.numCacheNodes(1)
.parameterGroupName("default.redis3.2")
.port(6379)
.build());
}
}

Redis Cluster Mode Disabled Read Replica Instance

These inherit their settings from the replication group.

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.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 replica = new Cluster("replica", ClusterArgs.builder()
.replicationGroupId(aws_elasticache_replication_group.example().id())
.build());
}
}

Redis Log Delivery configuration

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.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 test = new Cluster("test", ClusterArgs.builder()
.engine("redis")
.nodeType("cache.t3.micro")
.numCacheNodes(1)
.port(6379)
.applyImmediately(true)
.logDeliveryConfigurations(
ClusterLogDeliveryConfigurationArgs.builder()
.destination(aws_cloudwatch_log_group.example().name())
.destinationType("cloudwatch-logs")
.logFormat("text")
.logType("slow-log")
.build(),
ClusterLogDeliveryConfigurationArgs.builder()
.destination(aws_kinesis_firehose_delivery_stream.example().name())
.destinationType("kinesis-firehose")
.logFormat("json")
.logType("engine-log")
.build())
.build());
}
}

Import

ElastiCache Clusters can be imported using the cluster_id, e.g.,

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

Constructors

Link copied to clipboard
constructor(applyImmediately: Output<Boolean>? = null, autoMinorVersionUpgrade: Output<String>? = null, availabilityZone: Output<String>? = null, azMode: Output<String>? = null, clusterId: Output<String>? = null, engine: Output<String>? = null, engineVersion: Output<String>? = null, finalSnapshotIdentifier: Output<String>? = null, ipDiscovery: Output<String>? = null, logDeliveryConfigurations: Output<List<ClusterLogDeliveryConfigurationArgs>>? = null, maintenanceWindow: Output<String>? = null, networkType: Output<String>? = null, nodeType: Output<String>? = null, notificationTopicArn: Output<String>? = null, numCacheNodes: Output<Int>? = null, outpostMode: Output<String>? = null, parameterGroupName: Output<String>? = null, port: Output<Int>? = null, preferredAvailabilityZones: Output<List<String>>? = null, preferredOutpostArn: Output<String>? = null, replicationGroupId: Output<String>? = null, securityGroupIds: Output<List<String>>? = null, securityGroupNames: Output<List<String>>? = null, snapshotArns: Output<String>? = null, snapshotName: Output<String>? = null, snapshotRetentionLimit: Output<Int>? = null, snapshotWindow: Output<String>? = null, subnetGroupName: Output<String>? = null, tags: Output<Map<String, String>>? = null)

Properties

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

Whether any database modifications are applied immediately, or during the next maintenance window. Default is false. See Amazon ElastiCache Documentation for more information..

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

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.

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

Availability Zone for the cache cluster. If you want to create cache nodes in multi-az, use preferred_availability_zones instead. Default: System chosen Availability Zone. Changing this value will re-create the resource.

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

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, num_cache_nodes must be greater than 1.

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

Group identifier. ElastiCache converts this name to lowercase. Changing this value will re-create the resource.

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

Name of the cache engine to be used for this cache cluster. Valid values are memcached or redis.

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

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 6 or higher, 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 engine_version_actual, see Attributes Reference below.

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

Name of your final cluster snapshot. If omitted, no final snapshot will be made.

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

The IP version to advertise in the discovery protocol. Valid values are ipv4 or ipv6.

Link copied to clipboard

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.

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

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.

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

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 dual_stack.

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

The instance class used. See AWS documentation for information on supported node types for Redis and guidance on selecting node types for Redis. 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.

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

ARN of an SNS topic to send ElastiCache notifications to. Example: arn:aws:sns:us-east-1:012345678999:my_sns_topic.

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

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.

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

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.

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

The name of the parameter group to associate with this cache cluster. The following arguments are optional:

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

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 replication_group_id. Changing this value will re-create the resource.

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

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 num_cache_nodes. If you want all the nodes in the same Availability Zone, use availability_zone 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.

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

The outpost ARN in which the cache cluster will be created.

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

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.

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

One or more VPC security groups associated with the cache cluster

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

List of security group names to associate with this cache cluster. Changing this value will re-create the resource.

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

Single-element string list containing an Amazon Resource Name (ARN) of a Redis RDB snapshot file stored in Amazon S3. The object name cannot contain any commas. Changing snapshot_arns forces a new resource.

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

Name of a snapshot from which to restore data into the new node group. Changing snapshot_name forces a new resource.

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

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 snapshot_retention_limit is not supported on cache.t1.micro cache nodes

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

Daily time range (in UTC) during which ElastiCache will begin taking a daily snapshot of your cache cluster. Example: 05:00-09:00

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

Name of the subnet group to be used for the cache cluster. Changing this value will re-create the resource.

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

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Functions

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