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

Deleting a VPC

Scenarios

If you no longer need a VPC, you can delete it.

The VPC service has multiple resources. Some are free, while some are not. For details about VPC resource pricing, see Pricing Details.

Constraints

  • The VPC has only only subnets that are not in use by other resources, default route tables, and network ACLs. Also, the VPC is not in use by resources, such as subnets that are in use, custom route tables, ECSs, public NAT gateways, private NAT gateways, VPC endpoints, VPC endpoint services, Direct Connect connections, VPC peering connections, VPNs, and enterprise routers.
  • If you want to delete the last VPC in a region:
    • Delete all custom security groups in the region. The default security group does not affect the deletion of VPCs.
    • Release all EIPs in the region.

When you delete a VPC, the console may display a message indicating that this is the last VPC in this region and there are custom security groups in this VPC. The system will prompt you to delete the custom security groups. You need to record the security group IDs to delete them.

Only custom security groups must be deleted. The default security group does not impact VPC deletion.
Figure 1 Deleting a VPC

Procedure

  1. Go to the VPC list page.
  2. On the Virtual Private Cloud page, locate the row that contains the VPC to be deleted and click Delete in the Operation column.

    A confirmation dialog box is displayed.

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

    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.