Delete a subnet
If you no longer need a subnet, you can delete it. You cannot delete a subnet if it contains any network interfaces. For example, you must terminate any instances in a subnet before you can delete it.
To delete a subnet using the console
Open the Amazon EC2 console at https://console.amazonaws.cn/ec2/
. -
Terminate all instances in the subnet. For more information, see Terminate your instance in the Amazon EC2 User Guide.
Open the Amazon VPC console at https://console.amazonaws.cn/vpc/
. -
In the navigation pane, choose Subnets.
-
Select the subnet and choose Actions, Delete subnet.
-
When prompted for confirmation, type
delete
and then choose Delete.
To delete a subnet using the Amazon CLI
Use the delete-subnet command.