Skip to content

delete_db_cluster async

delete_db_cluster(
    *,
    config_overrides: Optional[AsyncNeptuneClientConfig] = None,
    db_cluster_identifier: Optional[String] = None,
    skip_final_snapshot: Optional[Boolean] = None,
    final_db_snapshot_identifier: Optional[String] = 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.

Note that the DB Cluster cannot be deleted if deletion protection is enabled. To delete it, you must first set its DeletionProtection field to False.

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 ) –

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

    You must specify a FinalDBSnapshotIdentifier parameter if SkipFinalSnapshot is false.

    Default: false

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

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

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

    Constraints:

    • Must be 1 to 255 letters, numbers, or hyphens.

    • First character must be a letter

    • Cannot end with a hyphen or contain two consecutive hyphens

Raises:

Source code in docs_src/capo_neptune/_services/async_neptune.py
async def delete_db_cluster(
    self,
    *,
    config_overrides: Optional[AsyncNeptuneClientConfig] = None,
    db_cluster_identifier: Optional["capo_neptune.types.string.String"] = None,
    skip_final_snapshot: Optional["capo_neptune.types.boolean.Boolean"] = None,
    final_db_snapshot_identifier: Optional[
        "capo_neptune.types.string.String"
    ] = None,
) -> "capo_neptune.types.delete_db_cluster_result.DeleteDBClusterResult":
    """<p>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.</p> <p>Note that the DB Cluster cannot be deleted if deletion protection is enabled. To delete it, you must first set its <code>DeletionProtection</code> field to <code>False</code>.</p>

    Args:
        db_cluster_identifier: <p>The DB cluster identifier for the DB cluster to be deleted. This parameter isn't case-sensitive.</p> <p>Constraints:</p> <ul> <li> <p>Must match an existing DBClusterIdentifier.</p> </li> </ul>
        skip_final_snapshot: <p> Determines whether a final DB cluster snapshot is created before the DB cluster is deleted. If <code>true</code> is specified, no DB cluster snapshot is created. If <code>false</code> is specified, a DB cluster snapshot is created before the DB cluster is deleted.</p> <note> <p>You must specify a <code>FinalDBSnapshotIdentifier</code> parameter if <code>SkipFinalSnapshot</code> is <code>false</code>.</p> </note> <p>Default: <code>false</code> </p>
        final_db_snapshot_identifier: <p> The DB cluster snapshot identifier of the new DB cluster snapshot created when <code>SkipFinalSnapshot</code> is set to <code>false</code>.</p> <note> <p> Specifying this parameter and also setting the <code>SkipFinalSnapshot</code> parameter to true results in an error.</p> </note> <p>Constraints:</p> <ul> <li> <p>Must be 1 to 255 letters, numbers, or hyphens.</p> </li> <li> <p>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_neptune.errors.db_cluster_not_found_fault.DBClusterNotFoundFault: <p> <i>DBClusterIdentifier</i> does not refer to an existing DB cluster.</p>
        capo_neptune.errors.db_cluster_snapshot_already_exists_fault.DBClusterSnapshotAlreadyExistsFault: <p>User already has a DB cluster snapshot with the given identifier.</p>
        capo_neptune.errors.invalid_db_cluster_snapshot_state_fault.InvalidDBClusterSnapshotStateFault: <p>The supplied value is not a valid DB cluster snapshot state.</p>
        capo_neptune.errors.invalid_db_cluster_state_fault.InvalidDBClusterStateFault: <p>The DB cluster is not in a valid state.</p>
        capo_neptune.errors.snapshot_quota_exceeded_fault.SnapshotQuotaExceededFault: <p>Request would result in user exceeding the allowed number of DB snapshots.</p>
        capo_neptune.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_neptune._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_neptune.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