deleteDBCluster method

Future<DeleteDBClusterResult> deleteDBCluster({
  1. required String dBClusterIdentifier,
  2. String? finalDBSnapshotIdentifier,
  3. bool? skipFinalSnapshot,
})

Deletes a previously provisioned cluster. When you delete a cluster, all automated backups for that cluster are deleted and can't be recovered. Manual DB cluster snapshots of the specified cluster are not deleted.

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

Parameter dBClusterIdentifier : The cluster identifier for the cluster to be deleted. This parameter isn't case sensitive.

Constraints:

  • Must match an existing DBClusterIdentifier.

Parameter finalDBSnapshotIdentifier : The cluster snapshot identifier of the new cluster snapshot created when SkipFinalSnapshot is set to false. Constraints:

  • Must be from 1 to 255 letters, numbers, or hyphens.
  • The first character must be a letter.
  • Cannot end with a hyphen or contain two consecutive hyphens.

Parameter skipFinalSnapshot : Determines whether a final cluster snapshot is created before the cluster is deleted. If true is specified, no cluster snapshot is created. If false is specified, a cluster snapshot is created before the DB cluster is deleted. Default: false

Implementation

Future<DeleteDBClusterResult> deleteDBCluster({
  required String dBClusterIdentifier,
  String? finalDBSnapshotIdentifier,
  bool? skipFinalSnapshot,
}) async {
  ArgumentError.checkNotNull(dBClusterIdentifier, 'dBClusterIdentifier');
  final $request = <String, dynamic>{};
  $request['DBClusterIdentifier'] = dBClusterIdentifier;
  finalDBSnapshotIdentifier
      ?.also((arg) => $request['FinalDBSnapshotIdentifier'] = arg);
  skipFinalSnapshot?.also((arg) => $request['SkipFinalSnapshot'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'DeleteDBCluster',
    version: '2014-10-31',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['DeleteDBClusterMessage'],
    shapes: shapes,
    resultWrapper: 'DeleteDBClusterResult',
  );
  return DeleteDBClusterResult.fromXml($result);
}