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 whether to take a final DB snapshot taken of the instance.

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, see Promoting a Read Replica to Be a DB Instance.

Final Snapshot

When you delete a DB instance, you can choose whether to create a final snapshot of the DB instance. If you want to be able to restore the DB instance at a later time, you should create a final snapshot.

With Final Snapshot Without Final Snapshot

How to Choose

You should create a final DB snapshot if you want to be able to restore your deleted DB instance at a later time.

You can skip creating a final DB snapshot if you want to delete a DB instance quickly.

Important

You will not be able to restore the DB instance later. If you have an earlier manual snapshot of the DB instance, you can restore the DB instance to the point-in-time of the earlier manual snapshot.

Automated Backups

All automated backups are deleted and can't be recovered.

All automated backups are deleted and can't be recovered.

Manual Snapshots

Earlier manual snapshots are not deleted.

Earlier manual snapshots are not deleted.

You can't create a final snapshot of your DB instance if it has one of the following statuses: creating, failed, incompatible-restore, or incompatible-network. For more information about DB instance statuses, see DB Instance Status.

AWS Management Console

To delete a DB instance

  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 DB instance that you want to delete.

  3. Choose Instance Actions, and then choose Delete.

  4. For Create final Snapshot?, choose Yes or No.

  5. If you chose yes in the previous step, for Final Snapshot name type the name of your final DB snapshot.

  6. Choose Yes, Delete.

CLI

To delete a DB instance by using the AWS CLI, call the delete-db-instance command with the following parameters:

  • --db-instance-identifier

  • --final-snapshot-identifier or --skip-final-snapshot

Example With a Final Snapshot

For Linux, OS X, or Unix:

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

For Windows:

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

Example Without a Final Snapshot

For Linux, OS X, or Unix:

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

For Windows:

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

API

To delete a DB instance by using the Amazon RDS API, call the DeleteDBInstance action with the following parameters:

  • DBInstanceIdentifier

  • FinalDBSnapshotIdentifier or SkipFinalSnapshot

Example With a Final Snapshot

Copy
https://rds.amazonaws.com/ ?Action=DeleteDBInstance &DBInstanceIdentifier=mydbinstance &FinalDBSnapshotIdentifier=mydbinstancefinalsnapshot &SignatureMethod=HmacSHA256 &SignatureVersion=4 &Version=2014-10-31 &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Credential=AKIADQKE4SARGYLE/20140305/us-west-1/rds/aws4_request &X-Amz-Date=20140305T185838Z &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date &X-Amz-Signature=b441901545441d3c7a48f63b5b1522c5b2b37c137500c93c45e209d4b3a064a3

Example Without a Final Snapshot

Copy
https://rds.amazonaws.com/ ?Action=DeleteDBInstance &DBInstanceIdentifier=mydbinstance &SkipFinalSnapshot=true &SignatureMethod=HmacSHA256 &SignatureVersion=4 &Version=2014-10-31 &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Credential=AKIADQKE4SARGYLE/20140305/us-west-1/rds/aws4_request &X-Amz-Date=20140305T185838Z &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date &X-Amz-Signature=b441901545441d3c7a48f63b5b1522c5b2b37c137500c93c45e209d4b3a064a3

Related Topics