delete_db_cluster
¶
delete_db_cluster(
*,
config_overrides: Optional[RDSClientConfig] = None,
db_cluster_identifier: Optional[String] = None,
skip_final_snapshot: Optional[Boolean] = None,
final_db_snapshot_identifier: Optional[String] = None,
delete_automated_backups: Optional[BooleanOptional] = None,
) -> DeleteDBClusterResult
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.
Parameters:
-
db_cluster_identifier(Optional[String], default:None) –The DB cluster identifier for the DB cluster to be deleted. This parameter isn't case-sensitive.
Constraints:
-
Must match an existing DBClusterIdentifier.
-
-
skip_final_snapshot(Optional[Boolean], default:None) –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 tofalseor 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.If
SkipFinalSnapshotis disabled, you must specify a value for theFinalDBSnapshotIdentifierparameter. -
final_db_snapshot_identifier(Optional[String], default:None) –The DB cluster snapshot identifier of the new DB cluster snapshot created when
SkipFinalSnapshotis disabled.If you specify this parameter and also skip the creation of a final DB cluster snapshot with the
SkipFinalShapshotparameter, the request results in an error.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
-
-
delete_automated_backups(Optional[BooleanOptional], default:None) –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.
Raises:
-
DBClusterAutomatedBackupQuotaExceededFault–The quota for retained automated backups was exceeded. This prevents you from retaining any additional automated backups. The retained automated backups quota is the same as your DB cluster quota.
-
DBClusterNotFoundFault–DBClusterIdentifierdoesn't refer to an existing DB cluster. -
DBClusterSnapshotAlreadyExistsFault–The user already has a DB cluster snapshot with the given identifier.
-
InvalidDBClusterSnapshotStateFault–The supplied value isn't a valid DB cluster snapshot state.
-
InvalidDBClusterStateFault–The requested operation can't be performed while the cluster is in this state.
-
InvalidGlobalClusterStateFault–The global cluster is in an invalid state and can't perform the requested operation.
-
KMSKeyNotAccessibleFault–An error occurred accessing an Amazon Web Services KMS key.
-
SnapshotQuotaExceededFault–The request would result in the user exceeding the allowed number of DB snapshots.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To delete a DB cluster The following example deletes the DB cluster named mycluster and takes a final snapshot named mycluster-final-snapshot. The status of the DB cluster is available while the snapshot is being taken.
>>> client.delete_db_cluster(db_cluster_identifier='mycluster', skip_final_snapshot=False, final_db_snapshot_identifier='mycluster-final-snapshot')
Source code in docs_src/capo_rds/_services/rds.py
4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 | |