createGlobalReplicationGroup method

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

Global Datastore for Redis offers fully managed, fast, reliable and secure cross-region replication. Using Global Datastore for Redis, you can create cross-region read replica clusters for ElastiCache for Redis 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 ReplicationGroupNotFoundFault. May throw InvalidReplicationGroupStateFault. May throw GlobalReplicationGroupAlreadyExistsFault. May throw ServiceLinkedRoleNotFoundFault. May throw InvalidParameterValueException.

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 AWS 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 AWS Regions and their respective Global Datastore iD prefixes, see Using the AWS CLI with Global Datastores .

Parameter primaryReplicationGroupId : The name of the primary cluster that accepts writes and will replicate updates to the secondary cluster.

Parameter globalReplicationGroupDescription : Provides details of the Global Datastore

Implementation

Future<CreateGlobalReplicationGroupResult> createGlobalReplicationGroup({
  required String globalReplicationGroupIdSuffix,
  required String primaryReplicationGroupId,
  String? globalReplicationGroupDescription,
}) async {
  ArgumentError.checkNotNull(
      globalReplicationGroupIdSuffix, 'globalReplicationGroupIdSuffix');
  ArgumentError.checkNotNull(
      primaryReplicationGroupId, 'primaryReplicationGroupId');
  final $request = <String, dynamic>{};
  $request['GlobalReplicationGroupIdSuffix'] = globalReplicationGroupIdSuffix;
  $request['PrimaryReplicationGroupId'] = primaryReplicationGroupId;
  globalReplicationGroupDescription
      ?.also((arg) => $request['GlobalReplicationGroupDescription'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'CreateGlobalReplicationGroup',
    version: '2015-02-02',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['CreateGlobalReplicationGroupMessage'],
    shapes: shapes,
    resultWrapper: 'CreateGlobalReplicationGroupResult',
  );
  return CreateGlobalReplicationGroupResult.fromXml($result);
}