createGlobalReplicationGroup method

Future<CreateGlobalReplicationGroupResult> createGlobalReplicationGroup({
  1. required String globalReplicationGroupIdSuffix,
  2. required String primaryReplicationGroupId,
  3. String? globalReplicationGroupDescription,
})

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.

May throw GlobalReplicationGroupAlreadyExistsFault. May throw InvalidParameterValueException. May throw InvalidReplicationGroupStateFault. May throw ReplicationGroupNotFoundFault. May throw ServiceLinkedRoleNotFoundFault.

Parameter globalReplicationGroupIdSuffix : The 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 .

Parameter primaryReplicationGroupId : The name of the primary cluster that accepts writes and will replicate updates to the secondary cluster. This value is stored as a lowercase string.

Parameter globalReplicationGroupDescription : Provides details of the Global datastore

Implementation

Future<CreateGlobalReplicationGroupResult> createGlobalReplicationGroup({
  required String globalReplicationGroupIdSuffix,
  required String primaryReplicationGroupId,
  String? globalReplicationGroupDescription,
}) async {
  final $request = <String, String>{
    'GlobalReplicationGroupIdSuffix': globalReplicationGroupIdSuffix,
    'PrimaryReplicationGroupId': primaryReplicationGroupId,
    if (globalReplicationGroupDescription != null)
      'GlobalReplicationGroupDescription': globalReplicationGroupDescription,
  };
  final $result = await _protocol.send(
    $request,
    action: 'CreateGlobalReplicationGroup',
    version: '2015-02-02',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'CreateGlobalReplicationGroupResult',
  );
  return CreateGlobalReplicationGroupResult.fromXml($result);
}