Menu
Amazon Relational Database Service
User Guide (API Version 2014-10-31)

Deleting a DB Instance

You can delete a DB instance in any state and at any time. To delete a DB instance, you must specify the name of the instance and specify if you want to have a final DB snapshot taken of the instance. If the DB instance you are deleting has a status of "Creating," you will not be able to have a final DB snapshot taken. If the DB instance is in a failure state with a status of "failed," "incompatible-restore," or "incompatible-network," you can only delete the instance when the SkipFinalSnapshot parameter is set to "true."

Important

If you choose not to create a final DB snapshot, you will not be able to later restore the DB instance to its final state. When you delete a DB instance, all automated backups are deleted and cannot be recovered. Manual DB snapshots of the instance are not deleted.

If the DB instance you want to delete has a Read Replica, you should either promote the Read Replica or delete it. For more information on promoting a Read Replica, see Promoting a Read Replica to Be a DB Instance

In the following examples, you delete a DB instance both with and without a final DB snapshot.

Deleting a DB Instance with No Final Snapshot

You can skip creating a final DB snapshot if you want to quickly delete a DB instance. Note that when you delete a DB instance, all automated backups are deleted and cannot be recovered. Manual snapshots are not deleted.

AWS Management Console

To delete a DB instance with no final DB snapshot

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the DB Instances list, select the check box next to the DB instance you wish to delete.

  3. Click Instance Actions, and then select Delete from the context menu.

  4. Select No in the Create final Snapshot? drop-down list box.

  5. Click Yes, Delete.

CLI

To delete a DB instance with no final DB snapshot, use the AWS CLI delete-db-instance command with the following parameters.

  • --db-instance-identifier

  • --skip-final-snapshot

Example

For Linux, OS X, or Unix:

Copy
aws rds delete-db-instance \ --db-instance-identifier mydbinstance \ --skip-final-snapshot

For Linux, OS X, or Unix:

Copy
aws rds delete-db-instance ^ --db-instance-identifier mydbinstance ^ --skip-final-snapshot

API

To delete a DB instance with no final DB snapshot, use the AWS CLI delete-db-instance command with the following parameters.

  • DBInstanceIdentifier = mydbinstance

  • SkipFinalSnapshot = true

Example

Copy
https://rds.amazonaws.com/ ?Action=DeleteDBInstance &DBInstanceIdentifier=mydbinstance &SkipFinalSnapshot=true &SignatureVersion=2 &SignatureMethod=HmacSHA256 &Timestamp=2009-10-14T22%3A20%3A46.297Z &AWSAccessKeyId=<AWS Access Key ID> &Signature=<Signature>

Deleting a DB Instance with a Final Snapshot

You can create a final DB snapshot if you want to be able to restore a deleted DB instance at a later time. All automated backups will also be deleted and cannot be recovered. Manual snapshots are not deleted.

AWS Management Console

To delete a DB instance with a final DB snapshot

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the DB Instances list, select the check box next to the DB Instance you wish to delete.

  3. Click Instance Actions, and then select Delete from the context menu.

  4. Select Yes in the Create final Snapshot? drop-down list box.

  5. Type the name of your final DB snapshot into the Final Snapshot name text box.

  6. Click Yes, Delete.

CLI

To delete a DB instance with a final DB snapshot, use the AWS CLI delete-db-instance command with the following parameters.

  • --db-instance-identifier

  • --final-snapshot-identifier

Example

For Linux, OS X, or Unix:

Copy
aws rds delete-db-instance \ --db-instance-identifier mydbinstance \ --final-snapshot-identifier myfinaldbsnapshot

For Windows:

Copy
aws rds delete-db-instance ^ --db-instance-identifier mydbinstance ^ --final-snapshot-identifier myfinaldbsnapshot

This command should produce output similar to the following:

Copy
Once you begin deleting this database, it will no longer be able to accept connections. Are you sure you want to delete this database? [Ny]y DBINSTANCE mydbinstance 2009-10-21T01:54:49.521Z db.m3.medium MySQL 50 sa deleting us-east-1a 3 SECGROUP default active

API

To delete a DB instance with a final DB snapshot, use the Amazon RDS APIDeleteDBInstance action with the following parameters.

  • DBInstanceIdentifier = mydbinstance

  • FinalDBSnapshotIdentifier = myfinaldbsnapshot

Example

Copy
https://rds.amazonaws.com/ ?Action=DeleteDBInstance &DBInstanceIdentifier=mydbinstance &FinalDBSnapshotIdentifier=myfinaldbsnapshot &SignatureVersion=2 &SignatureMethod=HmacSHA256 &Timestamp=2009-10-14T22%3A20%3A46.297Z &AWSAccessKeyId=<AWS Access Key ID> &Signature=<Signature>

Related Topics