AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Container for the parameters to the DeleteDBInstance operation. Deletes a previously provisioned DB instance. When you delete a DB instance, all automated backups for that instance are deleted and can't be recovered. However, manual DB snapshots of the DB instance aren't deleted.

If you request a final DB snapshot, the status of the Amazon RDS DB instance is deleting until the DB snapshot is created. This operation can't be canceled or reverted after it begins. To monitor the status of this operation, use DescribeDBInstance.

When a DB instance is in a failure state and has a status of failed, incompatible-restore, or incompatible-network, you can only delete it when you skip creation of the final snapshot with the SkipFinalSnapshot parameter.

If the specified DB instance is part of an Amazon Aurora DB cluster, you can't delete the DB instance if both of the following conditions are true:

To delete a DB instance in this case, first use the PromoteReadReplicaDBCluster operation to promote the DB cluster so that it's no longer a read replica. After the promotion completes, use the DeleteDBInstance operation to delete the final instance in the DB cluster.

For RDS Custom DB instances, deleting the DB instance permanently deletes the EC2 instance and the associated EBS volumes. Make sure that you don't terminate or delete these resources before you delete the DB instance. Otherwise, deleting the DB instance and creation of the final snapshot might fail.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.RDS.AmazonRDSRequest
      Amazon.RDS.Model.DeleteDBInstanceRequest

Namespace: Amazon.RDS.Model
Assembly: AWSSDK.RDS.dll
Version: 3.x.y.z

Syntax

C#
public class DeleteDBInstanceRequest : AmazonRDSRequest
         IAmazonWebServiceRequest

The DeleteDBInstanceRequest type exposes the following members

Constructors

NameDescription
Public Method DeleteDBInstanceRequest()

Empty constructor used to set properties independently even when a simple constructor is available

Public Method DeleteDBInstanceRequest(string)

Instantiates DeleteDBInstanceRequest with the parameterized properties

Properties

NameTypeDescription
Public Property DBInstanceIdentifier System.String

Gets and sets the property DBInstanceIdentifier.

The DB instance identifier for the DB instance to be deleted. This parameter isn't case-sensitive.

Constraints:

  • Must match the name of an existing DB instance.

Public Property DeleteAutomatedBackups System.Boolean

Gets and sets the property DeleteAutomatedBackups.

Specifies whether to remove automated backups immediately after the DB instance is deleted. This parameter isn't case-sensitive. The default is to remove automated backups immediately after the DB instance is deleted.

Public Property FinalDBSnapshotIdentifier System.String

Gets and sets the property FinalDBSnapshotIdentifier.

The DBSnapshotIdentifier of the new DBSnapshot created when the SkipFinalSnapshot parameter is disabled.

If you enable this parameter and also enable SkipFinalShapshot, the command results in an error.

This setting doesn't apply to RDS Custom.

Constraints:

  • Must be 1 to 255 letters or numbers.

  • First character must be a letter.

  • Can't end with a hyphen or contain two consecutive hyphens.

  • Can't be specified when deleting a read replica.

Public Property SkipFinalSnapshot System.Boolean

Gets and sets the property SkipFinalSnapshot.

Specifies whether to skip the creation of a final DB snapshot before deleting the instance. If you enable this parameter, RDS doesn't create a DB snapshot. If you don't enable this parameter, RDS creates a DB snapshot before the DB instance is deleted. By default, skip isn't enabled, and the DB snapshot is created.

If you don't enable this parameter, you must specify the FinalDBSnapshotIdentifier parameter.

When a DB instance is in a failure state and has a status of failed, incompatible-restore, or incompatible-network, RDS can delete the instance only if you enable this parameter.

If you delete a read replica or an RDS Custom instance, you must enable this setting.

This setting is required for RDS Custom.

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5 and newer, 3.5