Deleting a subnet
You can use the following methods to delete a subnet.
Prerequisite: The subnet must have no instances, load balancer, OCI database systems, and orphaned mount targets in it. For more information, see Subnet or VCN Deletion.
If the subnet is empty, its state changes to TERMINATING briefly and then TERMINATED. If the subnet is not empty, you get an error indicating that there are still instances or other resources in it that you must delete first.
- Open the navigation menu, click Networking, and then click Virtual cloud networks.
- Click the name of the VCN you're interested in.
- Click Subnets.
- Click the subnet you're interested in.
- Click Terminate.
- Confirm when prompted.
Use the network subnet update command and required parameters to edit a subnet:
oci network subnet delete --subnet-id ocid ... [OPTIONS]
For a complete list of flags and variable options for CLI commands, see the Command Line Reference.
Run the DeleteSubnet operation to delete a subnet.