Deleting a Subnet
You can delete an empty Subnet that you no longer need. This action does not delete the route table and security groups used for this Subnet.
Deleting a Subnet Using Cockpit v2
Before you begin: Delete all virtual machines (VMs) in the Subnet. For more information, see Terminating VMs. |
-
In the Nets dashboard, click the details icon of the Net where the Subnet you want to delete is.
The Subnet panel appears. -
Check the box of the Subnet you want to delete.
The Subnet is selected. -
Click Delete.
A confirmation dialog box appears. -
Click Delete.
The Subnet is deleted.
Deleting a Subnet Using OSC CLI
Before you begin: Delete all virtual machines (VMs) in the Subnet. For more information, see Terminating VMs. |
The DeleteSubnet command deletes a specified Subnet.
Before deleting the Subnet, you need to delete all resources associated with the Subnet:
-
Virtual machines (VMs)
-
Network Interface Cards (NICs)
-
NAT services
-
Load balancers
$ osc-cli api DeleteSubnet --profile "default" \
--SubnetId "subnet-12345678"
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
SubnetId
: The ID of the Subnet you want to delete.
The DeleteSubnet command returns the following elements:
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Deleting a Subnet Using oapi-cli
Before you begin: Delete all virtual machines (VMs) in the Subnet. For more information, see Terminating VMs. |
The DeleteSubnet command deletes a specified Subnet.
Before deleting the Subnet, you need to delete all resources associated with the Subnet:
-
Virtual machines (VMs)
-
Network Interface Cards (NICs)
-
NAT services
-
Load balancers
$ oapi-cli --profile "default" DeleteSubnet \
--SubnetId "subnet-12345678"
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
SubnetId
: The ID of the Subnet you want to delete.
The DeleteSubnet command returns the following elements:
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Deleting a Subnet Using AWS CLI
Before you begin:
|
To delete a subnet, use the delete-subnet command following this syntax:
$ aws ec2 delete-subnet \
--profile YOUR_PROFILE \
--subnet-id subnet-12345678 \
--endpoint https://fcu.eu-west-2.outscale.com
This command contains the following attributes that you need to specify:
-
(optional)
profile
: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI. -
subnet-id
: The ID of the subnet. -
endpoint
: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.
The subnet is deleted.
Related Pages
Corresponding API Methods
AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.