Updated on 2025-08-01 GMT+08:00

Deleting a Subnet

Scenarios

If your subnet is no longer required, you can delete it.

The VPC service has multiple resources. Subnets can be used for free. For details about VPC resource pricing, see Pricing Details.

Constraints

  • Subnet: No IP address in the subnet is being used by other resources, such as virtual IP addresses, elastic network interfaces, supplementary network interfaces, ECSs, SNAT rules of NAT gateways, VPC endpoints, VPC endpoint services, and load balancers.
  • Principals do not have permissions to delete shared subnets. Only the subnet owner can delete the subnet.

    For details, see VPC Sharing Overview.

When you delete a subnet, if a message is displayed indicating that the subnet is being used by a cloud server, you need to go to the cloud server console through the link and locate the target cloud server by resource ID.
Figure 1 Deleting a subnet

Procedure

  1. Go to the subnet list page.
  2. In the subnet list, locate the row that contains the subnet you want to delete and click Delete in the Operation column.

    A confirmation dialog box is displayed.

    If your subnet is used by other resources, you need to delete these resources before deleting a subnet.

    If a VPC cannot be deleted, refer to Why Can't I Delete My VPCs and Subnets?

  3. Enter DELETE as prompted and click OK.