Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
© 2022 Yandex.Cloud LLC
Yandex Managed Service for PostgreSQL
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Information about existing clusters
    • Creating clusters
    • How to connect to a database
    • Stopping and starting clusters
    • SQL queries in the management console
    • Updating the PostgreSQL version
    • Changing cluster and database settings
    • Connecting to DataLens
    • Managing PostgreSQL hosts
    • Database management
    • How to manage PostgreSQL extensions
    • Managing database users
    • Assigning privileges and roles
    • Managing backups
    • Deleting a cluster
    • Performance diagnostics
    • Monitoring the state of a cluster and hosts
  • Practical guidelines
    • Creating a PostgreSQL cluster for 1C
    • Performance analysis and tuning
    • Replication and migration
      • Logical PostgreSQL replication
      • Migrating databases to Managed Service for PostgreSQL
      • Migrating databases from Managed Service for PostgreSQL
      • Creating an Amazon RDS logical replica for PostgreSQL in Managed Service for PostgreSQL
    • Delivering data using Debezium
  • Concepts
    • Relationship between service resources
    • Host classes
      • Active host classes
      • Archive
        • Before June 1, 2020
      • Using deprecated host classes
    • Network in Yandex Managed Service for PostgreSQL
    • Quotas and limits
    • Storage in Managed Service for PostgreSQL
    • Backups
    • Assigning roles
    • Managing connections
    • Replication
    • Supported clients
    • PostgreSQL settings
  • Access management
  • Pricing policy
    • Current pricing policy
    • Archive
      • Before January 1, 2019
      • From January 1 to March 1, 2019
      • From March 1, 2019 to February 1, 2020
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • BackupService
      • ClusterService
      • DatabaseService
      • ResourcePresetService
      • UserService
      • OperationService
    • REST
      • Overview
      • Backup
        • Overview
        • get
        • list
      • Cluster
        • Overview
        • addHosts
        • backup
        • create
        • delete
        • deleteHosts
        • get
        • list
        • listBackups
        • listHosts
        • listLogs
        • listOperations
        • move
        • rescheduleMaintenance
        • restore
        • start
        • startFailover
        • stop
        • streamLogs
        • update
        • updateHosts
      • Database
        • Overview
        • create
        • delete
        • get
        • list
        • update
      • ResourcePreset
        • Overview
        • get
        • list
      • User
        • Overview
        • create
        • delete
        • get
        • grantPermission
        • list
        • revokePermission
        • update
      • Operation
        • Overview
        • get
  • Questions and answers
    • General questions
    • Connection
    • Updating clusters
    • Cluster configuration
    • Moving or restoring a cluster
    • Monitoring and logs
    • All questions on the same page
  1. Step-by-step instructions
  2. Deleting a cluster

Deleting clusters

Written by
Yandex.Cloud
  • Before deleting a cluster
  • Deleting the cluster

Before deleting a cluster

  • Disable deletion protection for the cluster if it is enabled.

  • Save the cluster ID.

    The cluster ID is required to restore a deleted cluster from a backup.

    After you delete a database cluster, its backups are kept for 7 days for recovery purposes.

Deleting the cluster

Management console
CLI
Terraform
  1. Open the folder page in the management console.
  2. Select Managed Service for PostgreSQL.
  3. Click for the necessary cluster and select Delete.

If you don't have the Yandex Cloud command line interface yet, install and initialize it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

To delete a cluster, run the command:

yc managed-postgresql cluster delete <cluster name or ID>

You can query the cluster ID and name with a list of clusters in the folder.

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it by configuration files. They store the infrastructure description in HashiCorp Configuration Language (HCL). Terraform and its providers are distributed under the Mozilla Public License.

For more information about the provider resources, see the documentation on the Terraform site or mirror site.

If you change the configuration files, Terraform automatically determines which part of your configuration is already deployed and what should be added or removed.

Read more about Terraform in the documentation.

To delete a cluster created using Terraform:

  1. In the command line, go to the folder with the current Terraform configuration file with an infrastructure plan.

  2. Delete resources using the command:

    terraform destroy
    

    Alert

    Terraform will delete all the resources that you created using it, such as clusters, networks, subnets, and VMs.

  3. Confirm the deletion of resources.

Was the article helpful?

Language / Region
© 2022 Yandex.Cloud LLC
In this article:
  • Before deleting a cluster
  • Deleting the cluster