createGlobalCluster method
Creates an Amazon DocumentDB global cluster that can span multiple multiple Amazon Web Services Regions. The global cluster contains one primary cluster with read-write capability, and up-to 10 read-only secondary clusters. Global clusters uses storage-based fast replication across regions with latencies less than one second, using dedicated infrastructure with no impact to your workload’s performance.
You can create a global cluster that is initially empty, and then add a primary and a secondary to it. Or you can specify an existing cluster during the create operation, and this cluster becomes the primary of the global cluster.
May throw DBClusterNotFoundFault.
May throw GlobalClusterAlreadyExistsFault.
May throw GlobalClusterQuotaExceededFault.
May throw InvalidDBClusterStateFault.
Parameter globalClusterIdentifier :
The cluster identifier of the new global cluster.
Parameter databaseName :
The name for your database of up to 64 alpha-numeric characters. If you do
not provide a name, Amazon DocumentDB will not create a database in the
global cluster you are creating.
Parameter deletionProtection :
The deletion protection setting for the new global cluster. The global
cluster can't be deleted when deletion protection is enabled.
Parameter engine :
The name of the database engine to be used for this cluster.
Parameter engineVersion :
The engine version of the global cluster.
Parameter sourceDBClusterIdentifier :
The Amazon Resource Name (ARN) to use as the primary cluster of the global
cluster. This parameter is optional.
Parameter storageEncrypted :
The storage encryption setting for the new global cluster.
Implementation
Future<CreateGlobalClusterResult> createGlobalCluster({
required String globalClusterIdentifier,
String? databaseName,
bool? deletionProtection,
String? engine,
String? engineVersion,
String? sourceDBClusterIdentifier,
bool? storageEncrypted,
}) async {
final $request = <String, String>{
'GlobalClusterIdentifier': globalClusterIdentifier,
if (databaseName != null) 'DatabaseName': databaseName,
if (deletionProtection != null)
'DeletionProtection': deletionProtection.toString(),
if (engine != null) 'Engine': engine,
if (engineVersion != null) 'EngineVersion': engineVersion,
if (sourceDBClusterIdentifier != null)
'SourceDBClusterIdentifier': sourceDBClusterIdentifier,
if (storageEncrypted != null)
'StorageEncrypted': storageEncrypted.toString(),
};
final $result = await _protocol.send(
$request,
action: 'CreateGlobalCluster',
version: '2014-10-31',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
resultWrapper: 'CreateGlobalClusterResult',
);
return CreateGlobalClusterResult.fromXml($result);
}