How can I delete a subnet that is in an Amazon Relational Database Service (Amazon RDS) DB subnet group?

To launch an Amazon RDS instance, a DB subnet group must contain at least two subnets. These subnets must be in different Availability Zones in the same AWS Region. You can remove or delete a subnet from the DB subnet group only if there are no Amazon RDS instances that are associated with the subnet group and launched in the subnet that you're trying to delete. If an Amazon RDS instance is launched with a DB subnet group that contains two subnets in two Availability Zones, then you can't delete any subnet from the DB subnet group. For more information, see Working with an Amazon RDS DB Instance in a VPC.

If you have a Multi-AZ deployment that has two or more subnets in a subnet group, then the DB instance can be launched in any of the subnets of two Availability Zones.

If you have a Single-AZ deployment that has two or more subnets in the subnet group, then you can specify the Availability Zone when you create a DB instance. If you didn't specify the Availability Zone when you created the DB instance, then the DB instance is launched in any of the subnets of the two Availability Zones.

To delete a subnet from an Amazon RDS DB subnet group, isolate the subnet by moving the Amazon RDS instance to another subnet. Then, remove the subnet from the DB subnet group. The following steps are applicable for Amazon RDS for Oracle, PostgreSQL, MySQL, MariaDB, or SQL Server.

Note: This resolution doesn't apply to Amazon Aurora, because Aurora uses replicas as failover targets. If an Aurora primary instance fails, the replica is promoted to the primary, unlike most Multi-AZ deployments where there is a secondary instance in another Availability Zone.

Deleting a subnet from a Single-AZ Amazon RDS instance

  1. Modify the DB Instance to be a Multi-AZ deployment. This creates a standby for the instance in a different Availability Zone that uses a different subnet.
    Note: If you already have a Multi-AZ deployment, skip to step 2.
  2. Reboot the DB instance with failover. This promotes the standby to the primary instance.
  3. Modify the DB instance back to a Single-AZ RDS instance.
    Note: Now the Single-AZ RDS instance is no longer in the subnet that you want to delete.
  4. Open the Amazon RDS console, and then choose Subnet groups from the navigation pane.
  5. Choose the subnet group that the DB instance is associated with.
  6. Choose Edit.
  7. From Add subnets, select the subnet you want to delete, and then choose Remove.
  8. Choose Save.

Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2019-02-22