deleteGlobalReplicationGroup method

Future<DeleteGlobalReplicationGroupResult> deleteGlobalReplicationGroup({
  1. required String globalReplicationGroupId,
  2. required bool retainPrimaryReplicationGroup,
})

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.

May throw GlobalReplicationGroupNotFoundFault. May throw InvalidGlobalReplicationGroupStateFault. May throw InvalidParameterValueException.

Parameter globalReplicationGroupId : The name of the Global datastore

Parameter retainPrimaryReplicationGroup : The primary replication group is retained as a standalone replication group.

Implementation

Future<DeleteGlobalReplicationGroupResult> deleteGlobalReplicationGroup({
  required String globalReplicationGroupId,
  required bool retainPrimaryReplicationGroup,
}) async {
  final $request = <String, String>{
    'GlobalReplicationGroupId': globalReplicationGroupId,
    'RetainPrimaryReplicationGroup': retainPrimaryReplicationGroup.toString(),
  };
  final $result = await _protocol.send(
    $request,
    action: 'DeleteGlobalReplicationGroup',
    version: '2015-02-02',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'DeleteGlobalReplicationGroupResult',
  );
  return DeleteGlobalReplicationGroupResult.fromXml($result);
}