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.
If you're deleting a Multi-AZ DB cluster with read replicas, all cluster members are terminated and read replicas are promoted to standalone instances.
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 DBClusterAutomatedBackupQuotaExceededFault.
May throw DBClusterNotFoundFault.
May throw DBClusterSnapshotAlreadyExistsFault.
May throw InvalidDBClusterSnapshotStateFault.
May throw InvalidDBClusterStateFault.
May throw InvalidGlobalClusterStateFault.
May throw KMSKeyNotAccessibleFault.
May throw SnapshotQuotaExceededFault.
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 deleteAutomatedBackups :
Specifies whether to remove automated backups immediately after the DB
cluster is deleted. This parameter isn't case-sensitive. The default is to
remove automated backups immediately after the DB cluster is deleted,
unless the Amazon Web Services Backup policy specifies a point-in-time
restore rule.
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 :
Specifies whether to skip the creation of a final DB cluster snapshot
before RDS deletes the DB cluster. If you set this value to
true, RDS doesn't create a final DB cluster snapshot. If you
set this value to false or don't specify it, RDS creates a DB
cluster snapshot before it deletes the DB cluster. By default, this
parameter is disabled, so RDS creates a final DB cluster snapshot.
Implementation
Future<DeleteDBClusterResult> deleteDBCluster({
required String dBClusterIdentifier,
bool? deleteAutomatedBackups,
String? finalDBSnapshotIdentifier,
bool? skipFinalSnapshot,
}) async {
final $request = <String, String>{
'DBClusterIdentifier': dBClusterIdentifier,
if (deleteAutomatedBackups != null)
'DeleteAutomatedBackups': deleteAutomatedBackups.toString(),
if (finalDBSnapshotIdentifier != null)
'FinalDBSnapshotIdentifier': finalDBSnapshotIdentifier,
if (skipFinalSnapshot != null)
'SkipFinalSnapshot': skipFinalSnapshot.toString(),
};
final $result = await _protocol.send(
$request,
action: 'DeleteDBCluster',
version: '2014-10-31',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
resultWrapper: 'DeleteDBClusterResult',
);
return DeleteDBClusterResult.fromXml($result);
}