deleteDBCluster method
The DeleteDBCluster action deletes a previously provisioned DB cluster. When you delete a DB cluster, all automated backups for that DB cluster are deleted and can't be recovered. Manual DB cluster snapshots of the specified DB cluster are not deleted.
For more information on Amazon Aurora, see What Is Amazon Aurora? in the Amazon Aurora User Guide.
May throw DBClusterNotFoundFault. May throw InvalidDBClusterStateFault. May throw DBClusterSnapshotAlreadyExistsFault. May throw SnapshotQuotaExceededFault. May throw InvalidDBClusterSnapshotStateFault.
Parameter dBClusterIdentifier
:
The DB cluster identifier for the DB cluster to be deleted. This parameter
isn't case-sensitive.
Constraints:
- Must match an existing DBClusterIdentifier.
Parameter finalDBSnapshotIdentifier
:
The DB cluster snapshot identifier of the new DB cluster snapshot created
when SkipFinalSnapshot
is disabled.
Constraints:
- Must be 1 to 255 letters, numbers, or hyphens.
- First character must be a letter
- Can't end with a hyphen or contain two consecutive hyphens
Parameter skipFinalSnapshot
:
A value that indicates whether to skip the creation of a final DB cluster
snapshot before the DB cluster is deleted. If skip is specified, no DB
cluster snapshot is created. If skip isn't specified, a DB cluster
snapshot is created before the DB cluster is deleted. By default, skip
isn't specified, and the DB cluster snapshot is created. By default, this
parameter is disabled.
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);
}