createDBClusterSnapshot method

Future<CreateDBClusterSnapshotResult> createDBClusterSnapshot({
  1. required String dBClusterIdentifier,
  2. required String dBClusterSnapshotIdentifier,
  3. List<Tag>? tags,
})

Creates a snapshot of a DB cluster.

For more information on Amazon Aurora, see What is Amazon Aurora? in the Amazon Aurora User Guide.

For more information on Multi-AZ DB clusters, see Multi-AZ DB cluster deployments in the Amazon RDS User Guide.

May throw DBClusterNotFoundFault. May throw DBClusterSnapshotAlreadyExistsFault. May throw InvalidDBClusterSnapshotStateFault. May throw InvalidDBClusterStateFault. May throw SnapshotQuotaExceededFault.

Parameter dBClusterIdentifier : The identifier of the DB cluster to create a snapshot for. This parameter isn't case-sensitive.

Constraints:

  • Must match the identifier of an existing DBCluster.
Example: my-cluster1

Parameter dBClusterSnapshotIdentifier : The identifier of the DB cluster snapshot. This parameter is stored as a lowercase string.

Constraints:

  • Must contain from 1 to 63 letters, numbers, or hyphens.
  • First character must be a letter.
  • Can't end with a hyphen or contain two consecutive hyphens.
Example: my-cluster1-snapshot1

Parameter tags : The tags to be assigned to the DB cluster snapshot.

Implementation

Future<CreateDBClusterSnapshotResult> createDBClusterSnapshot({
  required String dBClusterIdentifier,
  required String dBClusterSnapshotIdentifier,
  List<Tag>? tags,
}) async {
  final $request = <String, String>{
    'DBClusterIdentifier': dBClusterIdentifier,
    'DBClusterSnapshotIdentifier': dBClusterSnapshotIdentifier,
    if (tags != null)
      if (tags.isEmpty)
        'Tags': ''
      else
        for (var i1 = 0; i1 < tags.length; i1++)
          for (var e3 in tags[i1].toQueryMap().entries)
            'Tags.Tag.${i1 + 1}.${e3.key}': e3.value,
  };
  final $result = await _protocol.send(
    $request,
    action: 'CreateDBClusterSnapshot',
    version: '2014-10-31',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'CreateDBClusterSnapshotResult',
  );
  return CreateDBClusterSnapshotResult.fromXml($result);
}