Skip to content

delete_db_cluster async

delete_db_cluster(
    *,
    config_overrides: Optional[AsyncDocDBClientConfig] = None,
    db_cluster_identifier: Optional[String] = None,
    skip_final_snapshot: Optional[Boolean] = None,
    final_db_snapshot_identifier: Optional[String] = None,
) -> DeleteDBClusterResult

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.

Parameters:

  • db_cluster_identifier (Optional[String], default: None ) –

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

    Constraints:

    • Must match an existing DBClusterIdentifier.

  • skip_final_snapshot (Optional[Boolean], default: None ) –

    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.

    If SkipFinalSnapshot is false, you must specify a FinalDBSnapshotIdentifier parameter.

    Default: false

  • final_db_snapshot_identifier (Optional[String], default: None ) –

    The cluster snapshot identifier of the new cluster snapshot created when SkipFinalSnapshot is set to false.

    Specifying this parameter and also setting the SkipFinalShapshot parameter to true results in an error.

    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.

Raises:

Source code in docs_src/capo_docdb/_services/async_doc_db.py
async def delete_db_cluster(
    self,
    *,
    config_overrides: Optional[AsyncDocDBClientConfig] = None,
    db_cluster_identifier: Optional["capo_docdb.types.string.String"] = None,
    skip_final_snapshot: Optional["capo_docdb.types.boolean.Boolean"] = None,
    final_db_snapshot_identifier: Optional["capo_docdb.types.string.String"] = None,
) -> "capo_docdb.types.delete_db_cluster_result.DeleteDBClusterResult":
    """<p>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.</p> <p></p>

    Args:
        db_cluster_identifier: <p>The cluster identifier for the cluster to be deleted. This parameter isn't case sensitive.</p> <p>Constraints:</p> <ul> <li> <p>Must match an existing <code>DBClusterIdentifier</code>.</p> </li> </ul>
        skip_final_snapshot: <p> Determines whether a final cluster snapshot is created before the cluster is deleted. If <code>true</code> is specified, no cluster snapshot is created. If <code>false</code> is specified, a cluster snapshot is created before the DB cluster is deleted. </p> <note> <p>If <code>SkipFinalSnapshot</code> is <code>false</code>, you must specify a <code>FinalDBSnapshotIdentifier</code> parameter.</p> </note> <p>Default: <code>false</code> </p>
        final_db_snapshot_identifier: <p> The cluster snapshot identifier of the new cluster snapshot created when <code>SkipFinalSnapshot</code> is set to <code>false</code>. </p> <note> <p> Specifying this parameter and also setting the <code>SkipFinalShapshot</code> parameter to <code>true</code> results in an error. </p> </note> <p>Constraints:</p> <ul> <li> <p>Must be from 1 to 255 letters, numbers, or hyphens.</p> </li> <li> <p>The first character must be a letter.</p> </li> <li> <p>Cannot end with a hyphen or contain two consecutive hyphens.</p> </li> </ul>

    Raises:
        capo_docdb.errors.db_cluster_not_found_fault.DBClusterNotFoundFault: <p> <code>DBClusterIdentifier</code> doesn't refer to an existing cluster. </p>
        capo_docdb.errors.db_cluster_snapshot_already_exists_fault.DBClusterSnapshotAlreadyExistsFault: <p>You already have a cluster snapshot with the given identifier.</p>
        capo_docdb.errors.invalid_db_cluster_snapshot_state_fault.InvalidDBClusterSnapshotStateFault: <p>The provided value isn't a valid cluster snapshot state.</p>
        capo_docdb.errors.invalid_db_cluster_state_fault.InvalidDBClusterStateFault: <p>The cluster isn't in a valid state.</p>
        capo_docdb.errors.snapshot_quota_exceeded_fault.SnapshotQuotaExceededFault: <p>The request would cause you to exceed the allowed number of snapshots.</p>
        capo_docdb.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_docdb.types.delete_db_cluster_message.DeleteDBClusterMessage]",
    ) -> AsyncOperationResponse[
        "capo_docdb.types.delete_db_cluster_result.DeleteDBClusterResult"
    ]:
        import capo_docdb._operations.amazon_rd_sv19.delete_db_cluster

        (
            output,
            http_response,
        ) = await capo_docdb._operations.amazon_rd_sv19.delete_db_cluster.async_delete_db_cluster(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteDBCluster")
    )
    input_: capo_docdb.types.delete_db_cluster_message.DeleteDBClusterMessage = {}
    if db_cluster_identifier is not None:
        input_["db_cluster_identifier"] = db_cluster_identifier
    if skip_final_snapshot is not None:
        input_["skip_final_snapshot"] = skip_final_snapshot
    if final_db_snapshot_identifier is not None:
        input_["final_db_snapshot_identifier"] = final_db_snapshot_identifier

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output