Skip to main content

global_replication_groups

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

Overview

Nameglobal_replication_groups
TypeResource
Idaws.elasticache.global_replication_groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe ARN (Amazon Resource Name) of the global replication group.
at_rest_encryption_enabledbooleanA flag that enables encryption at rest when set to true. You cannot modify the value of AtRestEncryptionEnabled after the replication group is created. To enable encryption at rest on a replication group you must set AtRestEncryptionEnabled to true when you create the replication group. Required: Only available when creating a replication group in an Amazon VPC using Redis OSS version 3.2.6, 4.x or later.
auth_token_enabledbooleanA flag that enables using an AuthToken (password) when issuing Valkey or Redis OSS commands. Default: false
cache_node_typestringThe cache node type of the Global datastore
cluster_enabledbooleanA flag that indicates whether the Global datastore is cluster enabled.
enginestringThe ElastiCache engine. For Valkey or Redis OSS only.
engine_versionstringThe ElastiCache engine version.
global_node_groupsstringIndicates the slot configuration and global identifier for each slice group.
global_replication_group_descriptionstringThe optional description of the Global datastore
global_replication_group_idstringThe name of the Global datastore
membersstringThe replication groups that comprise the Global datastore.
statusstringThe status of the Global datastore
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.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_global_replication_groupsselectregionGlobalReplicationGroupId, MaxRecords, Marker, ShowMemberInfoReturns information about a particular global replication group. If no identifier is specified, returns information about all Global datastores.
create_global_replication_groupinsertGlobalReplicationGroupIdSuffix, PrimaryReplicationGroupId, regionGlobalReplicationGroupDescriptionGlobal Datastore offers fully managed, fast, reliable and secure cross-region replication. Using Global Datastore with Valkey or Redis OSS, you can create cross-region read replica clusters for ElastiCache to enable low-latency reads and disaster recovery across regions. For more information, see Replication Across Regions Using Global Datastore. The GlobalReplicationGroupIdSuffix is the name of the Global datastore. The PrimaryReplicationGroupId represents the name of the primary cluster that accepts writes and will replicate updates to the secondary cluster.
disassociate_global_replication_groupupdateGlobalReplicationGroupId, ReplicationGroupId, ReplicationGroupRegion, regionRemove a secondary cluster from the Global datastore using the Global datastore name. The secondary cluster will no longer receive updates from the primary cluster, but will remain as a standalone cluster in that Amazon region.
modify_global_replication_groupupdateGlobalReplicationGroupId, ApplyImmediately, regionCacheNodeType, Engine, EngineVersion, CacheParameterGroupName, GlobalReplicationGroupDescription, AutomaticFailoverEnabledModifies the settings for a Global datastore.
delete_global_replication_groupdeleteGlobalReplicationGroupId, RetainPrimaryReplicationGroup, regionDeleting a Global datastore is a two-step process: First, you must DisassociateGlobalReplicationGroup to remove the secondary clusters in the Global datastore. Once the Global datastore contains only the primary cluster, you can use the DeleteGlobalReplicationGroup API to delete the Global datastore while retainining the primary cluster using RetainPrimaryReplicationGroup=true. Since the Global Datastore has only a primary cluster, you can delete the Global Datastore while retaining the primary by setting RetainPrimaryReplicationGroup=true. The primary cluster is never deleted when deleting a Global Datastore. It can only be deleted when it no longer is associated with any Global Datastore. When you receive a successful response from this operation, Amazon ElastiCache immediately begins deleting the selected resources; you cannot cancel or revert this operation.
decrease_node_groups_in_global_replication_groupexecGlobalReplicationGroupId, NodeGroupCount, ApplyImmediately, regionGlobalNodeGroupsToRemove, GlobalNodeGroupsToRetainDecreases the number of node groups in a Global datastore
failover_global_replication_groupexecGlobalReplicationGroupId, PrimaryRegion, PrimaryReplicationGroupId, regionUsed to failover the primary region to a secondary region. The secondary region will become primary, and all other clusters will become secondary.
increase_node_groups_in_global_replication_groupexecGlobalReplicationGroupId, NodeGroupCount, ApplyImmediately, regionRegionalConfigurationsIncrease the number of node groups in the Global datastore
rebalance_slots_in_global_replication_groupexecGlobalReplicationGroupId, ApplyImmediately, regionRedistribute slots to ensure uniform distribution across existing shards in the cluster.

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, redistribution is applied immediately.
GlobalReplicationGroupIdstringThe name of the Global datastore
GlobalReplicationGroupIdSuffixstringThe suffix name of a Global datastore. Amazon ElastiCache automatically applies a prefix to the Global datastore ID when it is created. Each Amazon Region has its own prefix. For instance, a Global datastore ID created in the US-West-1 region will begin with "dsdfu" along with the suffix name you provide. The suffix, combined with the auto-generated prefix, guarantees uniqueness of the Global datastore name across multiple regions. For a full list of Amazon Regions and their respective Global datastore iD prefixes, see Using the Amazon CLI with Global datastores .
NodeGroupCountintegerTotal number of node groups you want
PrimaryRegionstringThe Amazon region of the primary cluster of the Global datastore
PrimaryReplicationGroupIdstringThe name of the primary replication group
ReplicationGroupIdstringThe name of the secondary cluster you wish to remove from the Global datastore
ReplicationGroupRegionstringThe Amazon region of secondary cluster you wish to remove from the Global datastore
RetainPrimaryReplicationGroupbooleanThe primary replication group is retained as a standalone replication group.
regionstringAWS region (default: us-east-1)
AutomaticFailoverEnabledbooleanDetermines whether a read replica is automatically promoted to read/write primary if the existing primary encounters a failure.
CacheNodeTypestringA valid cache node type that you want to scale this Global datastore to.
CacheParameterGroupNamestringThe name of the cache parameter group to use with the Global datastore. It must be compatible with the major engine version used by the Global datastore.
EnginestringModifies the engine listed in a global 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 Global datastore.
GlobalNodeGroupsToRemovearrayIf the value of NodeGroupCount is less than the current number of node groups (shards), then either NodeGroupsToRemove or NodeGroupsToRetain is required. GlobalNodeGroupsToRemove is a list of NodeGroupIds to remove from the cluster. ElastiCache will attempt to remove all node groups listed by GlobalNodeGroupsToRemove from the cluster.
GlobalNodeGroupsToRetainarrayIf the value of NodeGroupCount is less than the current number of node groups (shards), then either NodeGroupsToRemove or NodeGroupsToRetain is required. GlobalNodeGroupsToRetain is a list of NodeGroupIds to retain from the cluster. ElastiCache will attempt to retain all node groups listed by GlobalNodeGroupsToRetain from the cluster.
GlobalReplicationGroupDescriptionstringA description of the Global datastore
GlobalReplicationGroupIdstringThe name of the Global datastore
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.
RegionalConfigurationsarrayDescribes the replication group IDs, the Amazon regions where they are stored and the shard configuration for each that comprise the Global datastore
ShowMemberInfobooleanReturns the list of members that comprise the Global datastore.

SELECT examples

Returns information about a particular global replication group. If no identifier is specified, returns information about all Global datastores.

SELECT
arn,
at_rest_encryption_enabled,
auth_token_enabled,
cache_node_type,
cluster_enabled,
engine,
engine_version,
global_node_groups,
global_replication_group_description,
global_replication_group_id,
members,
status,
transit_encryption_enabled
FROM aws.elasticache.global_replication_groups
WHERE region = '{{ region }}' -- required
AND GlobalReplicationGroupId = '{{ GlobalReplicationGroupId }}'
AND MaxRecords = '{{ MaxRecords }}'
AND Marker = '{{ Marker }}'
AND ShowMemberInfo = '{{ ShowMemberInfo }}'
;

INSERT examples

Global Datastore offers fully managed, fast, reliable and secure cross-region replication. Using Global Datastore with Valkey or Redis OSS, you can create cross-region read replica clusters for ElastiCache to enable low-latency reads and disaster recovery across regions. For more information, see Replication Across Regions Using Global Datastore. The GlobalReplicationGroupIdSuffix is the name of the Global datastore. The PrimaryReplicationGroupId represents the name of the primary cluster that accepts writes and will replicate updates to the secondary cluster.

INSERT INTO aws.elasticache.global_replication_groups (
GlobalReplicationGroupIdSuffix,
PrimaryReplicationGroupId,
region,
GlobalReplicationGroupDescription
)
SELECT
'{{ GlobalReplicationGroupIdSuffix }}',
'{{ PrimaryReplicationGroupId }}',
'{{ region }}',
'{{ GlobalReplicationGroupDescription }}'
RETURNING
arn,
at_rest_encryption_enabled,
auth_token_enabled,
cache_node_type,
cluster_enabled,
engine,
engine_version,
global_node_groups,
global_replication_group_description,
global_replication_group_id,
members,
status,
transit_encryption_enabled
;

UPDATE examples

Remove a secondary cluster from the Global datastore using the Global datastore name. The secondary cluster will no longer receive updates from the primary cluster, but will remain as a standalone cluster in that Amazon region.

UPDATE aws.elasticache.global_replication_groups
SET
-- No updatable properties
WHERE
GlobalReplicationGroupId = '{{ GlobalReplicationGroupId }}' --required
AND ReplicationGroupId = '{{ ReplicationGroupId }}' --required
AND ReplicationGroupRegion = '{{ ReplicationGroupRegion }}' --required
AND region = '{{ region }}' --required
RETURNING
arn,
at_rest_encryption_enabled,
auth_token_enabled,
cache_node_type,
cluster_enabled,
engine,
engine_version,
global_node_groups,
global_replication_group_description,
global_replication_group_id,
members,
status,
transit_encryption_enabled;

DELETE examples

Deleting a Global datastore is a two-step process: First, you must DisassociateGlobalReplicationGroup to remove the secondary clusters in the Global datastore. Once the Global datastore contains only the primary cluster, you can use the DeleteGlobalReplicationGroup API to delete the Global datastore while retainining the primary cluster using RetainPrimaryReplicationGroup=true. Since the Global Datastore has only a primary cluster, you can delete the Global Datastore while retaining the primary by setting RetainPrimaryReplicationGroup=true. The primary cluster is never deleted when deleting a Global Datastore. It can only be deleted when it no longer is associated with any Global Datastore. When you receive a successful response from this operation, Amazon ElastiCache immediately begins deleting the selected resources; you cannot cancel or revert this operation.

DELETE FROM aws.elasticache.global_replication_groups
WHERE GlobalReplicationGroupId = '{{ GlobalReplicationGroupId }}' --required
AND RetainPrimaryReplicationGroup = '{{ RetainPrimaryReplicationGroup }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Decreases the number of node groups in a Global datastore

EXEC aws.elasticache.global_replication_groups.decrease_node_groups_in_global_replication_group
@GlobalReplicationGroupId='{{ GlobalReplicationGroupId }}' --required,
@NodeGroupCount='{{ NodeGroupCount }}' --required,
@ApplyImmediately='{{ ApplyImmediately }}' --required,
@region='{{ region }}' --required,
@GlobalNodeGroupsToRemove='{{ GlobalNodeGroupsToRemove }}',
@GlobalNodeGroupsToRetain='{{ GlobalNodeGroupsToRetain }}'
;