Skip to main content

replication_groups

Creates, updates, deletes, gets or lists a replication_groups resource.

Overview

Namereplication_groups
TypeResource
Idaws.elasticache.replication_groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe ARN (Amazon Resource Name) of the replication group.
at_rest_encryption_enabledbooleanA flag that enables encryption at-rest on the cluster when set to true. In some cases, encryption at-rest may be enabled even when this value is false. Use StorageEncryptionType to view the effective encryption state of a cluster. You cannot modify the value of AtRestEncryptionEnabled after the cluster is created. Default: true when using Valkey, false when using Redis OSS
auth_token_enabledbooleanA flag that enables using an AuthToken (password) when issuing Valkey or Redis OSS commands. Default: false
auth_token_last_modified_datestringThe date the auth token was last modified
auto_minor_version_upgradebooleanIf you are running Valkey 7.2 and above, or Redis OSS engine version 6.0 and above, set this parameter to yes if you want to opt-in to the next auto minor version upgrade campaign. This parameter is disabled for previous versions.
automatic_failoverstringIndicates the status of automatic failover for this Valkey or Redis OSS replication group.
cache_node_typestringThe name of the compute and memory capacity node type for each node in the replication group.
cluster_enabledbooleanA flag indicating whether or not this replication group is cluster enabled; i.e., whether its data can be partitioned across multiple shards (API/CLI: node groups). Valid values: true | false
cluster_modestringEnabled or Disabled. To modify cluster mode from Disabled to Enabled, you must first set the cluster mode to Compatible. Compatible mode allows your Valkey or Redis OSS clients to connect using both cluster mode enabled and cluster mode disabled. After you migrate all Valkey or Redis OSS clients to use cluster mode enabled, you can then complete cluster mode configuration and set the cluster mode to Enabled.
configuration_endpointstringThe configuration endpoint for this replication group. Use the configuration endpoint to connect to this replication group.
data_tieringstringEnables data tiering. Data tiering is only supported for replication groups using the r6gd node type. This parameter must be set to true when using r6gd nodes. For more information, see Data tiering.
descriptionstringThe user supplied description of the replication group.
durabilitystringThe durability setting of the replication group. For more information, see Durability.
effective_durabilitystringThe effective durability of the replication group. When Durability is set to default, the service resolves the actual durability based on the engine version, cluster mode, and other parameters. This field reflects the resolved value. For more information, see Configuring Durability.
enginestringThe engine used in a replication group. The options are valkey, memcached or redis.
global_replication_group_infostringThe name of the Global datastore and role of this replication group in the Global datastore.
ip_discoverystringThe network type you choose when modifying a cluster, either ipv4 | ipv6. IPv6 is supported for workloads using Valkey 7.2 and above, Redis OSS engine version 6.2 to 7.1 or Memcached engine version 1.6.6 and above on all instances built on the Nitro system.
kms_key_idstringThe ID of the KMS key used to encrypt the disk in the cluster.
log_delivery_configurationsstringReturns the destination, format and type of the logs.
member_clustersstringThe names of all the cache clusters that are part of this replication group.
member_clusters_outpost_arnsstringThe outpost ARNs of the replication group's member clusters.
multi_azstringA flag indicating if you have Multi-AZ enabled to enhance fault tolerance. For more information, see Minimizing Downtime: Multi-AZ
network_typestringMust be either ipv4 | ipv6 | dual_stack. IPv6 is supported for workloads using Valkey 7.2 and above, Redis OSS engine version 6.2 to 7.1 or Memcached engine version 1.6.6 and above on all instances built on the Nitro system.
node_groupsstringA list of node groups in this replication group. For Valkey or Redis OSS (cluster mode disabled) replication groups, this is a single-element list. For Valkey or Redis OSS (cluster mode enabled) replication groups, the list contains an entry for each node group (shard).
pending_modified_valuesstringA group of settings to be applied to the replication group, either immediately or during the next maintenance window.
replication_group_create_timestringThe date and time when the cluster was created.
replication_group_idstringThe identifier for the replication group.
snapshot_retention_limitintegerThe number of days for which ElastiCache retains automatic cluster snapshots before deleting them. For example, if you set SnapshotRetentionLimit to 5, a snapshot that was taken today is retained for 5 days before being deleted. If the value of SnapshotRetentionLimit is set to zero (0), backups are turned off.
snapshot_windowstringThe daily time range (in UTC) during which ElastiCache begins taking a daily snapshot of your node group (shard). Example: 05:00-09:00 If you do not specify this parameter, ElastiCache automatically chooses an appropriate time range. This parameter is only valid if the Engine parameter is redis.
snapshotting_cluster_idstringThe cluster ID that is used as the daily snapshot source for the replication group.
statusstringThe current state of this replication group - creating, available, modifying, deleting, create-failed, snapshotting.
storage_encryption_typestringIndicates the type of encryption for data stored at rest in the replication group. The value is none if at-rest encryption is not enabled, sse-elasticache if an ElastiCache service-managed key is used, or sse-kms if a customer-managed KMS key is used.
transit_encryption_enabledbooleanA flag that enables in-transit encryption when set to true. Required: Only available when creating a replication group in an Amazon VPC using Redis OSS version 3.2.6, 4.x or later. Default: false
transit_encryption_modestringA setting that allows you to migrate your clients to use in-transit encryption, with no downtime.
user_group_idsstringThe ID of the user group associated to the replication group.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_replication_groupsselectregionReplicationGroupId, MaxRecords, MarkerReturns information about a particular replication group. If no identifier is specified, DescribeReplicationGroups returns information about all replication groups. This operation is valid for Valkey or Redis OSS only.
create_replication_groupinsertReplicationGroupId, ReplicationGroupDescription, regionGlobalReplicationGroupId, PrimaryClusterId, AutomaticFailoverEnabled, MultiAZEnabled, NumCacheClusters, PreferredCacheClusterAZs, NumNodeGroups, ReplicasPerNodeGroup, NodeGroupConfiguration, CacheNodeType, Engine, EngineVersion, CacheParameterGroupName, CacheSubnetGroupName, CacheSecurityGroupNames, SecurityGroupIds, Tags, SnapshotArns, SnapshotName, PreferredMaintenanceWindow, Port, NotificationTopicArn, AutoMinorVersionUpgrade, SnapshotRetentionLimit, SnapshotWindow, AuthToken, TransitEncryptionEnabled, AtRestEncryptionEnabled, KmsKeyId, UserGroupIds, LogDeliveryConfigurations, DataTieringEnabled, NetworkType, IpDiscovery, TransitEncryptionMode, ClusterMode, ServerlessCacheSnapshotName, DurabilityCreates a Valkey or Redis OSS (cluster mode disabled) or a Valkey or Redis OSS (cluster mode enabled) replication group. This API can be used to create a standalone regional replication group or a secondary replication group associated with a Global datastore. A Valkey or Redis OSS (cluster mode disabled) replication group is a collection of nodes, where one of the nodes is a read/write primary and the others are read-only replicas. Writes to the primary are asynchronously propagated to the replicas. A Valkey or Redis OSS cluster-mode enabled cluster is comprised of from 1 to 90 shards (API/CLI: node groups). Each shard has a primary node and up to 5 read-only replica nodes. The configuration can range from 90 shards and 0 replicas to 15 shards and 5 replicas, which is the maximum number or replicas allowed. The node or shard limit can be increased to a maximum of 500 per cluster if the Valkey or Redis OSS engine version is 5.0.6 or higher. For example, you can choose to configure a 500 node cluster that ranges between 83 shards (one primary and 5 replicas per shard) and 500 shards (single primary and no replicas). Make sure there are enough available IP addresses to accommodate the increase. Common pitfalls include the subnets in the subnet group have too small a CIDR range or the subnets are shared and heavily used by other clusters. For more information, see Creating a Subnet Group. For versions below 5.0.6, the limit is 250 per cluster. To request a limit increase, see Amazon Service Limits and choose the limit type Nodes per cluster per instance type. When a Valkey or Redis OSS (cluster mode disabled) replication group has been successfully created, you can add one or more read replicas to it, up to a total of 5 read replicas. If you need to increase or decrease the number of node groups (console: shards), you can use scaling. For more information, see Scaling self-designed clusters in the ElastiCache User Guide. This operation is valid for Valkey and Redis OSS only.
modify_replication_group_shard_configurationupdateReplicationGroupId, NodeGroupCount, ApplyImmediately, regionReshardingConfiguration, NodeGroupsToRemove, NodeGroupsToRetainModifies a replication group's shards (node groups) by allowing you to add shards, remove shards, or rebalance the keyspaces among existing shards.
modify_replication_groupupdateReplicationGroupId, regionReplicationGroupDescription, PrimaryClusterId, SnapshottingClusterId, AutomaticFailoverEnabled, MultiAZEnabled, NodeGroupId, CacheSecurityGroupNames, SecurityGroupIds, PreferredMaintenanceWindow, NotificationTopicArn, CacheParameterGroupName, NotificationTopicStatus, ApplyImmediately, Engine, EngineVersion, AutoMinorVersionUpgrade, SnapshotRetentionLimit, SnapshotWindow, CacheNodeType, AuthToken, AuthTokenUpdateStrategy, UserGroupIdsToAdd, UserGroupIdsToRemove, RemoveUserGroups, LogDeliveryConfigurations, IpDiscovery, TransitEncryptionEnabled, TransitEncryptionMode, ClusterMode, DurabilityModifies the settings for a replication group. This is limited to Valkey and Redis OSS 7 and above. Scaling for Valkey or Redis OSS (cluster mode enabled) in the ElastiCache User Guide ModifyReplicationGroupShardConfiguration in the ElastiCache API Reference This operation is valid for Valkey or Redis OSS only.
delete_replication_groupdeleteReplicationGroupId, regionRetainPrimaryCluster, FinalSnapshotIdentifierDeletes an existing replication group. By default, this operation deletes the entire replication group, including the primary/primaries and all of the read replicas. If the replication group has only one primary, you can optionally delete only the read replicas, while retaining the primary by setting RetainPrimaryCluster=true. When you receive a successful response from this operation, Amazon ElastiCache immediately begins deleting the selected resources; you cannot cancel or revert this operation. CreateSnapshot permission is required to create a final snapshot. Without this permission, the API call will fail with an Access Denied exception. This operation is valid for Redis OSS only.
complete_migrationexecReplicationGroupId, regionForceComplete the migration of data.
decrease_replica_countexecReplicationGroupId, ApplyImmediately, regionNewReplicaCount, ReplicaConfiguration, ReplicasToRemoveDynamically decreases the number of replicas in a Valkey or Redis OSS (cluster mode disabled) replication group or the number of replica nodes in one or more node groups (shards) of a Valkey or Redis OSS (cluster mode enabled) replication group. This operation is performed with no cluster down time.
increase_replica_countexecReplicationGroupId, ApplyImmediately, regionNewReplicaCount, ReplicaConfigurationDynamically increases the number of replicas in a Valkey or Redis OSS (cluster mode disabled) replication group or the number of replica nodes in one or more node groups (shards) of a Valkey or Redis OSS (cluster mode enabled) replication group. This operation is performed with no cluster down time.
start_migrationexecReplicationGroupId, CustomerNodeEndpointList, regionStart the migration of data.
test_failoverexecReplicationGroupId, NodeGroupId, regionRepresents the input of a TestFailover operation which tests automatic failover on a specified node group (called shard in the console) in a replication group (called cluster in the console). This API is designed for testing the behavior of your application in case of ElastiCache failover. It is not designed to be an operational tool for initiating a failover to overcome a problem you may have with the cluster. Moreover, in certain conditions such as large-scale operational events, Amazon may block this API. Note the following A customer can use this operation to test automatic failover on up to 15 shards (called node groups in the ElastiCache API and Amazon CLI) in any rolling 24-hour period. If calling this operation on shards in different clusters (called replication groups in the API and CLI), the calls can be made concurrently. If calling this operation multiple times on different shards in the same Valkey or Redis OSS (cluster mode enabled) replication group, the first node replacement must complete before a subsequent call can be made. To determine whether the node replacement is complete you can check Events using the Amazon ElastiCache console, the Amazon CLI, or the ElastiCache API. Look for the following automatic failover related events, listed here in order of occurrance: Replication group message: Test Failover API called for node group <node-group-id> Cache cluster message: Failover from primary node <primary-node-id> to replica node <node-id> completed Replication group message: Failover from primary node <primary-node-id> to replica node <node-id> completed Cache cluster message: Recovering cache nodes <node-id> Cache cluster message: Finished recovery for cache nodes <node-id> For more information see: Viewing ElastiCache Events in the ElastiCache User Guide DescribeEvents in the ElastiCache API Reference Also see, Testing Multi-AZ in the ElastiCache User Guide.
test_migrationexecReplicationGroupId, CustomerNodeEndpointList, regionAsync API to test connection between source and target replication group.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
ApplyImmediatelybooleanIf True, the number of replica nodes is increased immediately. ApplyImmediately=False is not currently supported.
CustomerNodeEndpointListarrayList of endpoints from which data should be migrated. List should have only one element.
NodeGroupCountintegerThe number of node groups (shards) that results from the modification of the shard configuration.
NodeGroupIdstringThe name of the node group (called shard in the console) in this replication group on which automatic failover is to be tested. You may test automatic failover on up to 15 node groups in any rolling 24-hour period.
ReplicationGroupDescriptionstringA user-created description for the replication group.
ReplicationGroupIdstringThe ID of the replication group to which data is to be migrated.
regionstringAWS region (default: us-east-1)
ApplyImmediatelybooleanIf true, this parameter causes the modifications in this request and any pending modifications to be applied, asynchronously and as soon as possible, regardless of the PreferredMaintenanceWindow setting for the replication group. If false, changes to the nodes in the replication group are applied on the next maintenance reboot, or the next failure reboot, whichever occurs first. Valid values: true | false Default: false
AtRestEncryptionEnabledbooleanA flag that enables encryption at-rest on the replication group when set to true. In some cases, encryption at-rest may be enabled even when this value is false. Use StorageEncryptionType to view the effective encryption state of a cluster. You cannot modify the value of AtRestEncryptionEnabled after the replication group is created. Default: true when using Valkey, false when using Redis OSS
AuthTokenstringReserved parameter. The password used to access a password protected server. This parameter must be specified with the auth-token-update-strategy parameter. Password constraints: Must be only printable ASCII characters Must be at least 16 characters and no more than 128 characters in length Cannot contain any of the following characters: '/', '"', or '@', '%' For more information, see AUTH password at AUTH.
AuthTokenUpdateStrategystringSpecifies the strategy to use to update the AUTH token. This parameter must be specified with the auth-token parameter. Possible values: ROTATE - default, if no update strategy is provided SET - allowed only after ROTATE DELETE - allowed only when transitioning to RBAC For more information, see Authenticating Users with AUTH
AutoMinorVersionUpgradebooleanIf you are running Valkey or Redis OSS engine version 6.0 or later, set this parameter to yes if you want to opt-in to the next auto minor version upgrade campaign. This parameter is disabled for previous versions.
AutomaticFailoverEnabledbooleanDetermines whether a read replica is automatically promoted to read/write primary if the existing primary encounters a failure. Valid values: true | false
CacheNodeTypestringA valid cache node type that you want to scale this replication group to.
CacheParameterGroupNamestringThe name of the cache parameter group to apply to all of the clusters in this replication group. This change is asynchronously applied as soon as possible for parameters when the ApplyImmediately parameter is specified as true for this request.
CacheSecurityGroupNamesarrayA list of cache security group names to authorize for the clusters in this replication group. This change is asynchronously applied as soon as possible. This parameter can be used only with replication group containing clusters running outside of an Amazon Virtual Private Cloud (Amazon VPC). Constraints: Must contain no more than 255 alphanumeric characters. Must not be Default.
CacheSubnetGroupNamestringThe name of the cache subnet group to be used for the replication group. If you're going to launch your cluster in an Amazon VPC, you need to create a subnet group before you start creating a cluster. For more information, see Subnets and Subnet Groups.
ClusterModestringEnabled or Disabled. To modify cluster mode from Disabled to Enabled, you must first set the cluster mode to Compatible. Compatible mode allows your Valkey or Redis OSS clients to connect using both cluster mode enabled and cluster mode disabled. After you migrate all Valkey or Redis OSS clients to use cluster mode enabled, you can then complete cluster mode configuration and set the cluster mode to Enabled.
DataTieringEnabledbooleanEnables data tiering. Data tiering is only supported for replication groups using the r6gd node type. This parameter must be set to true when using r6gd nodes. For more information, see Data tiering.
DurabilitystringSpecifies the durability setting for the replication group. Use this parameter to change the durability mode of an existing replication group, for example from sync to async or vice versa. For more information, see Durability.
EnginestringModifies the engine listed in a replication group message. The options are valkey, memcached or redis.
EngineVersionstringThe upgraded version of the cache engine to be run on the clusters in the replication group. Important: You can upgrade to a newer engine version (see Selecting a Cache Engine and Version), but you cannot downgrade to an earlier engine version. If you want to use an earlier engine version, you must delete the existing replication group and create it anew with the earlier engine version.
FinalSnapshotIdentifierstringThe name of a final node group (shard) snapshot. ElastiCache creates the snapshot from the primary node in the cluster, rather than one of the replicas; this is to ensure that it captures the freshest data. After the final snapshot is taken, the replication group is immediately deleted.
ForcebooleanForces the migration to stop without ensuring that data is in sync. It is recommended to use this option only to abort the migration and not recommended when application wants to continue migration to ElastiCache.
GlobalReplicationGroupIdstringThe name of the Global datastore
IpDiscoverystringThe network type you choose when modifying a cluster, either ipv4 | ipv6. IPv6 is supported for workloads using Valkey 7.2 and above, Redis OSS engine version 6.2 to 7.1 and Memcached engine version 1.6.6 and above on all instances built on the Nitro system.
KmsKeyIdstringThe ID of the KMS key used to encrypt the disk in the cluster.
LogDeliveryConfigurationsarraySpecifies the destination, format and type of the logs.
MarkerstringAn optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.
MaxRecordsintegerThe maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a marker is included in the response so that the remaining results can be retrieved. Default: 100 Constraints: minimum 20; maximum 100.
MultiAZEnabledbooleanA flag to indicate MultiAZ is enabled.
NetworkTypestringMust be either ipv4 | ipv6 | dual_stack. IPv6 is supported for workloads using Valkey 7.2 and above, Redis OSS engine version 6.2 to 7.1 and Memcached engine version 1.6.6 and above on all instances built on the Nitro system.
NewReplicaCountintegerThe number of read replica nodes you want at the completion of this operation. For Valkey or Redis OSS (cluster mode disabled) replication groups, this is the number of replica nodes in the replication group. For Valkey or Redis OSS (cluster mode enabled) replication groups, this is the number of replica nodes in each of the replication group's node groups.
NodeGroupConfigurationarrayA list of node group (shard) configuration options. Each node group (shard) configuration has the following members: PrimaryAvailabilityZone, ReplicaAvailabilityZones, ReplicaCount, and Slots. If you're creating a Valkey or Redis OSS (cluster mode disabled) or a Valkey or Redis OSS (cluster mode enabled) replication group, you can use this parameter to individually configure each node group (shard), or you can omit this parameter. However, it is required when seeding a Valkey or Redis OSS (cluster mode enabled) cluster from a S3 rdb file. You must configure each node group (shard) using this parameter because you must specify the slots for each node group.
NodeGroupIdstringDeprecated. This parameter is not used.
NodeGroupsToRemovearrayIf the value of NodeGroupCount is less than the current number of node groups (shards), then either NodeGroupsToRemove or NodeGroupsToRetain is required. NodeGroupsToRemove is a list of NodeGroupIds to remove from the cluster. ElastiCache will attempt to remove all node groups listed by NodeGroupsToRemove from the cluster.
NodeGroupsToRetainarrayIf the value of NodeGroupCount is less than the current number of node groups (shards), then either NodeGroupsToRemove or NodeGroupsToRetain is required. NodeGroupsToRetain is a list of NodeGroupIds to retain in the cluster. ElastiCache will attempt to remove all node groups except those listed by NodeGroupsToRetain from the cluster.
NotificationTopicArnstringThe Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications are sent. The Amazon SNS topic owner must be same as the replication group owner.
NotificationTopicStatusstringThe status of the Amazon SNS notification topic for the replication group. Notifications are sent only if the status is active. Valid values: active | inactive
NumCacheClustersintegerThe number of clusters this replication group initially has. This parameter is not used if there is more than one node group (shard). You should use ReplicasPerNodeGroup instead. If AutomaticFailoverEnabled is true, the value of this parameter must be at least 2. If AutomaticFailoverEnabled is false you can omit this parameter (it will default to 1), or you can explicitly set it to a value between 2 and 6. The maximum permitted value for NumCacheClusters is 6 (1 primary plus 5 replicas).
NumNodeGroupsintegerAn optional parameter that specifies the number of node groups (shards) for this Valkey or Redis OSS (cluster mode enabled) replication group. For Valkey or Redis OSS (cluster mode disabled) either omit this parameter or set it to 1. Default: 1
PortintegerThe port number on which each member of the replication group accepts connections.
PreferredCacheClusterAZsarrayA list of EC2 Availability Zones in which the replication group's clusters are created. The order of the Availability Zones in the list is the order in which clusters are allocated. The primary cluster is created in the first AZ in the list. This parameter is not used if there is more than one node group (shard). You should use NodeGroupConfiguration instead. If you are creating your replication group in an Amazon VPC (recommended), you can only locate clusters in Availability Zones associated with the subnets in the selected subnet group. The number of Availability Zones listed must equal the value of NumCacheClusters. Default: system chosen Availability Zones.
PreferredMaintenanceWindowstringSpecifies the weekly time range during which maintenance on the cluster is performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window is a 60 minute period. Valid values for ddd are: sun mon tue wed thu fri sat Example: sun:23:00-mon:01:30
PrimaryClusterIdstringFor replication groups with a single primary, if this parameter is specified, ElastiCache promotes the specified cluster in the specified replication group to the primary role. The nodes of all other clusters in the replication group are read replicas.
RemoveUserGroupsbooleanRemoves the user group associated with this replication group.
ReplicaConfigurationarrayA list of ConfigureShard objects that can be used to configure each shard in a Valkey or Redis OSS (cluster mode enabled) replication group. The ConfigureShard has three members: NewReplicaCount, NodeGroupId, and PreferredAvailabilityZones.
ReplicasPerNodeGroupintegerAn optional parameter that specifies the number of replica nodes in each node group (shard). Valid values are 0 to 5.
ReplicasToRemovearrayA list of the node ids to remove from the replication group or node group (shard).
ReplicationGroupDescriptionstringA description for the replication group. Maximum length is 255 characters.
ReplicationGroupIdstringThe identifier for the replication group to be described. This parameter is not case sensitive. If you do not specify this parameter, information about all replication groups is returned.
ReshardingConfigurationarraySpecifies the preferred availability zones for each node group in the cluster. If the value of NodeGroupCount is greater than the current number of node groups (shards), you can use this parameter to specify the preferred availability zones of the cluster's shards. If you omit this parameter ElastiCache selects availability zones for you. You can specify this parameter only if the value of NodeGroupCount is greater than the current number of node groups (shards).
RetainPrimaryClusterbooleanIf set to true, all of the read replicas are deleted, but the primary node is retained.
SecurityGroupIdsarraySpecifies the VPC Security Groups associated with the clusters in the replication group. This parameter can be used only with replication group containing clusters running in an Amazon Virtual Private Cloud (Amazon VPC).
ServerlessCacheSnapshotNamestringThe name of the snapshot used to create a replication group. Available for Valkey, Redis OSS only.
SnapshotArnsarrayA list of Amazon Resource Names (ARN) that uniquely identify the Valkey or Redis OSS RDB snapshot files stored in Amazon S3. The snapshot files are used to populate the new replication group. The Amazon S3 object name in the ARN cannot contain any commas. The new replication group will have the number of node groups (console: shards) specified by the parameter NumNodeGroups or the number of node groups configured by NodeGroupConfiguration regardless of the number of ARNs specified here. Example of an Amazon S3 ARN: arn:aws:s3:::my_bucket/snapshot1.rdb
SnapshotNamestringThe name of a snapshot from which to restore data into the new replication group. The snapshot status changes to restoring while the new replication group is being created.
SnapshotRetentionLimitintegerThe number of days for which ElastiCache retains automatic node group (shard) snapshots before deleting them. For example, if you set SnapshotRetentionLimit to 5, a snapshot that was taken today is retained for 5 days before being deleted. Important If the value of SnapshotRetentionLimit is set to zero (0), backups are turned off.
SnapshotWindowstringThe daily time range (in UTC) during which ElastiCache begins taking a daily snapshot of the node group (shard) specified by SnapshottingClusterId. Example: 05:00-09:00 If you do not specify this parameter, ElastiCache automatically chooses an appropriate time range.
SnapshottingClusterIdstringThe cluster ID that is used as the daily snapshot source for the replication group. This parameter cannot be set for Valkey or Redis OSS (cluster mode enabled) replication groups.
TagsarrayA list of tags to be added to this resource. Tags are comma-separated key,value pairs (e.g. Key=myKey, Value=myKeyValue. You can include multiple tags as shown following: Key=myKey, Value=myKeyValue Key=mySecondKey, Value=mySecondKeyValue. Tags on replication groups will be replicated to all nodes.
TransitEncryptionEnabledbooleanA flag that enables in-transit encryption when set to true. If you are enabling in-transit encryption for an existing cluster, you must also set TransitEncryptionMode to preferred.
TransitEncryptionModestringA setting that allows you to migrate your clients to use in-transit encryption, with no downtime. You must set TransitEncryptionEnabled to true, for your existing cluster, and set TransitEncryptionMode to preferred in the same request to allow both encrypted and unencrypted connections at the same time. Once you migrate all your Valkey or Redis OSS clients to use encrypted connections you can set the value to required to allow encrypted connections only. Setting TransitEncryptionMode to required is a two-step process that requires you to first set the TransitEncryptionMode to preferred, after that you can set TransitEncryptionMode to required.
UserGroupIdsarrayThe user group to associate with the replication group.
UserGroupIdsToAddarrayThe ID of the user group you are associating with the replication group.
UserGroupIdsToRemovearrayThe ID of the user group to disassociate from the replication group, meaning the users in the group no longer can access the replication group.

SELECT examples

Returns information about a particular replication group. If no identifier is specified, DescribeReplicationGroups returns information about all replication groups. This operation is valid for Valkey or Redis OSS only.

SELECT
arn,
at_rest_encryption_enabled,
auth_token_enabled,
auth_token_last_modified_date,
auto_minor_version_upgrade,
automatic_failover,
cache_node_type,
cluster_enabled,
cluster_mode,
configuration_endpoint,
data_tiering,
description,
durability,
effective_durability,
engine,
global_replication_group_info,
ip_discovery,
kms_key_id,
log_delivery_configurations,
member_clusters,
member_clusters_outpost_arns,
multi_az,
network_type,
node_groups,
pending_modified_values,
replication_group_create_time,
replication_group_id,
snapshot_retention_limit,
snapshot_window,
snapshotting_cluster_id,
status,
storage_encryption_type,
transit_encryption_enabled,
transit_encryption_mode,
user_group_ids
FROM aws.elasticache.replication_groups
WHERE region = '{{ region }}' -- required
AND ReplicationGroupId = '{{ ReplicationGroupId }}'
AND MaxRecords = '{{ MaxRecords }}'
AND Marker = '{{ Marker }}'
;

INSERT examples

Creates a Valkey or Redis OSS (cluster mode disabled) or a Valkey or Redis OSS (cluster mode enabled) replication group. This API can be used to create a standalone regional replication group or a secondary replication group associated with a Global datastore. A Valkey or Redis OSS (cluster mode disabled) replication group is a collection of nodes, where one of the nodes is a read/write primary and the others are read-only replicas. Writes to the primary are asynchronously propagated to the replicas. A Valkey or Redis OSS cluster-mode enabled cluster is comprised of from 1 to 90 shards (API/CLI: node groups). Each shard has a primary node and up to 5 read-only replica nodes. The configuration can range from 90 shards and 0 replicas to 15 shards and 5 replicas, which is the maximum number or replicas allowed. The node or shard limit can be increased to a maximum of 500 per cluster if the Valkey or Redis OSS engine version is 5.0.6 or higher. For example, you can choose to configure a 500 node cluster that ranges between 83 shards (one primary and 5 replicas per shard) and 500 shards (single primary and no replicas). Make sure there are enough available IP addresses to accommodate the increase. Common pitfalls include the subnets in the subnet group have too small a CIDR range or the subnets are shared and heavily used by other clusters. For more information, see Creating a Subnet Group. For versions below 5.0.6, the limit is 250 per cluster. To request a limit increase, see Amazon Service Limits and choose the limit type Nodes per cluster per instance type. When a Valkey or Redis OSS (cluster mode disabled) replication group has been successfully created, you can add one or more read replicas to it, up to a total of 5 read replicas. If you need to increase or decrease the number of node groups (console: shards), you can use scaling. For more information, see Scaling self-designed clusters in the ElastiCache User Guide. This operation is valid for Valkey and Redis OSS only.

INSERT INTO aws.elasticache.replication_groups (
ReplicationGroupId,
ReplicationGroupDescription,
region,
GlobalReplicationGroupId,
PrimaryClusterId,
AutomaticFailoverEnabled,
MultiAZEnabled,
NumCacheClusters,
PreferredCacheClusterAZs,
NumNodeGroups,
ReplicasPerNodeGroup,
NodeGroupConfiguration,
CacheNodeType,
Engine,
EngineVersion,
CacheParameterGroupName,
CacheSubnetGroupName,
CacheSecurityGroupNames,
SecurityGroupIds,
Tags,
SnapshotArns,
SnapshotName,
PreferredMaintenanceWindow,
Port,
NotificationTopicArn,
AutoMinorVersionUpgrade,
SnapshotRetentionLimit,
SnapshotWindow,
AuthToken,
TransitEncryptionEnabled,
AtRestEncryptionEnabled,
KmsKeyId,
UserGroupIds,
LogDeliveryConfigurations,
DataTieringEnabled,
NetworkType,
IpDiscovery,
TransitEncryptionMode,
ClusterMode,
ServerlessCacheSnapshotName,
Durability
)
SELECT
'{{ ReplicationGroupId }}',
'{{ ReplicationGroupDescription }}',
'{{ region }}',
'{{ GlobalReplicationGroupId }}',
'{{ PrimaryClusterId }}',
'{{ AutomaticFailoverEnabled }}',
'{{ MultiAZEnabled }}',
'{{ NumCacheClusters }}',
'{{ PreferredCacheClusterAZs }}',
'{{ NumNodeGroups }}',
'{{ ReplicasPerNodeGroup }}',
'{{ NodeGroupConfiguration }}',
'{{ CacheNodeType }}',
'{{ Engine }}',
'{{ EngineVersion }}',
'{{ CacheParameterGroupName }}',
'{{ CacheSubnetGroupName }}',
'{{ CacheSecurityGroupNames }}',
'{{ SecurityGroupIds }}',
'{{ Tags }}',
'{{ SnapshotArns }}',
'{{ SnapshotName }}',
'{{ PreferredMaintenanceWindow }}',
'{{ Port }}',
'{{ NotificationTopicArn }}',
'{{ AutoMinorVersionUpgrade }}',
'{{ SnapshotRetentionLimit }}',
'{{ SnapshotWindow }}',
'{{ AuthToken }}',
'{{ TransitEncryptionEnabled }}',
'{{ AtRestEncryptionEnabled }}',
'{{ KmsKeyId }}',
'{{ UserGroupIds }}',
'{{ LogDeliveryConfigurations }}',
'{{ DataTieringEnabled }}',
'{{ NetworkType }}',
'{{ IpDiscovery }}',
'{{ TransitEncryptionMode }}',
'{{ ClusterMode }}',
'{{ ServerlessCacheSnapshotName }}',
'{{ Durability }}'
RETURNING
arn,
at_rest_encryption_enabled,
auth_token_enabled,
auth_token_last_modified_date,
auto_minor_version_upgrade,
automatic_failover,
cache_node_type,
cluster_enabled,
cluster_mode,
configuration_endpoint,
data_tiering,
description,
durability,
effective_durability,
engine,
global_replication_group_info,
ip_discovery,
kms_key_id,
log_delivery_configurations,
member_clusters,
member_clusters_outpost_arns,
multi_az,
network_type,
node_groups,
pending_modified_values,
replication_group_create_time,
replication_group_id,
snapshot_retention_limit,
snapshot_window,
snapshotting_cluster_id,
status,
storage_encryption_type,
transit_encryption_enabled,
transit_encryption_mode,
user_group_ids
;

UPDATE examples

Modifies a replication group's shards (node groups) by allowing you to add shards, remove shards, or rebalance the keyspaces among existing shards.

UPDATE aws.elasticache.replication_groups
SET
-- No updatable properties
WHERE
ReplicationGroupId = '{{ ReplicationGroupId }}' --required
AND NodeGroupCount = '{{ NodeGroupCount }}' --required
AND ApplyImmediately = '{{ ApplyImmediately }}' --required
AND region = '{{ region }}' --required
AND ReshardingConfiguration = '{{ ReshardingConfiguration}}'
AND NodeGroupsToRemove = '{{ NodeGroupsToRemove}}'
AND NodeGroupsToRetain = '{{ NodeGroupsToRetain}}'
RETURNING
arn,
at_rest_encryption_enabled,
auth_token_enabled,
auth_token_last_modified_date,
auto_minor_version_upgrade,
automatic_failover,
cache_node_type,
cluster_enabled,
cluster_mode,
configuration_endpoint,
data_tiering,
description,
durability,
effective_durability,
engine,
global_replication_group_info,
ip_discovery,
kms_key_id,
log_delivery_configurations,
member_clusters,
member_clusters_outpost_arns,
multi_az,
network_type,
node_groups,
pending_modified_values,
replication_group_create_time,
replication_group_id,
snapshot_retention_limit,
snapshot_window,
snapshotting_cluster_id,
status,
storage_encryption_type,
transit_encryption_enabled,
transit_encryption_mode,
user_group_ids;

DELETE examples

Deletes an existing replication group. By default, this operation deletes the entire replication group, including the primary/primaries and all of the read replicas. If the replication group has only one primary, you can optionally delete only the read replicas, while retaining the primary by setting RetainPrimaryCluster=true. When you receive a successful response from this operation, Amazon ElastiCache immediately begins deleting the selected resources; you cannot cancel or revert this operation. CreateSnapshot permission is required to create a final snapshot. Without this permission, the API call will fail with an Access Denied exception. This operation is valid for Redis OSS only.

DELETE FROM aws.elasticache.replication_groups
WHERE ReplicationGroupId = '{{ ReplicationGroupId }}' --required
AND region = '{{ region }}' --required
AND RetainPrimaryCluster = '{{ RetainPrimaryCluster }}'
AND FinalSnapshotIdentifier = '{{ FinalSnapshotIdentifier }}'
;

Lifecycle Methods

Complete the migration of data.

EXEC aws.elasticache.replication_groups.complete_migration
@ReplicationGroupId='{{ ReplicationGroupId }}' --required,
@region='{{ region }}' --required,
@Force={{ Force }}
;