How to Destroy OpenSearch Clusters

OpenSearch is an open-source search and analytics suite which serves as a centralized location to manage logs forwarded from other resources, such as databases and Droplets.

Deleting a database cluster permanently and irreversibly destroys the cluster, its contents, and its automated backups.

Destroy a Database Cluster Using the CLI or API

How to Create a Database Using the DigitalOcean CLI
  1. Install doctl, the DigitalOcean command-line tool.

  2. Create a personal access token and save it for use with doctl.

  3. Use the token to grant doctl access to your DigitalOcean account.

              doctl auth init
  4. Finally, run doctl databases delete. Basic usage looks like this, but you can read the usage docs for more details:

                doctl databases delete <database-cluster-id> [flags]

    The following example deletes the database cluster with the ID f81d4fae-7dec-11d0-a765-00a0c91e6bf6:

                  doctl databases delete f81d4fae-7dec-11d0-a765-00a0c91e6bf6
How to Destroy a Database Cluster Using the DigitalOcean API
  1. Create a personal access token and save it for use with the API.

  2. Send a DELETE request to{database_cluster_uuid}


    Using cURL:

                    curl -X DELETE \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \


    Using Godo, the official DigitalOcean V2 API client for Go:

                    import (
    func main() {
        pat := "mytoken"
        client := godo.NewFromToken(pat)
        ctx := context.TODO()
        _, err := client.Databases.Delete(ctx, "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30")


                    import os
    from pydo import Client
    client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
    delete_resp = client.databases.destroy_cluster(database_cluster_uuid="a7abba8")

Destroy a Database Cluster Using the Control Panel

To destroy a database cluster from the control panel, open the cluster’s More menu. Click Destroy to open the cluster’s Settings page.

Screenshot of cluster settings page

In the Destroy this database cluster section at the bottom of the page, click the Destroy button. This opens a Destroy database cluster confirmation window.

Screenshot of the destroy cluster warning

To permanently destroy the cluster, type or copy and paste the name of the database cluster into the text field, then click Destroy.

Destroying a database cluster destroys the backups of that database. Make sure you download any important data before you destroy a cluster.