Deleting a dedicated public subnet
A dedicated public subnet becomes billable the moment it is created. The minimum rent period is one month, so you cannot delete a public subnet during the first month after the order date.
Warning
Deleting a dedicated public subnet is irreversible. Following the deletion, the subnet's IP addresses will return to the Yandex BareMetal shared address pool and can be reassigned to other users.
- In the management console
, select the folder the public subnet belongs to. - Go to BareMetal.
- In the left-hand panel, select
Public addresses and subnets. - Click
next to the subnet and select Delete. - In the window that opens, confirm the deletion.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
-
View the description of the command for deleting a dedicated public subnet:
yc baremetal public-subnet delete --help -
Get a list of dedicated public subnets in the default folder:
yc baremetal public-subnet list -
Delete the subnet:
yc baremetal public-subnet delete <subnet_ID_or_name>Where
<subnet_ID_or_name>is the ID or name of the dedicated public subnet to delete.
To delete a dedicated public subnet, use the delete REST API method for the PublicSubnet resource or the PublicSubnetService/Delete gRPC API call.
Run this command:
curl -X DELETE \
-H "Authorization: Bearer <IAM_token>" \
"https://baremetal.api.cloud.yandex.net/baremetal/v1alpha/publicSubnets/<subnet_ID>"
Where:
<IAM_token>: IAM token used for authentication.<subnet_ID>: ID of the dedicated public subnet to delete. To find out the ID, follow this guide.
Result:
{
"id": "ly5hcnsbx3l4********",
"description": "Public subnet delete",
"createdAt": "2025-12-14T14:42:58.375290Z",
"createdBy": "ajeb9l33h6mu********",
"modifiedAt": "2025-12-14T14:42:58.375290Z",
"done": true,
"metadata": {
"@type": "type.googleapis.com/yandex.cloud.baremetal.v1alpha.DeletePublicSubnetMetadata",
"publicSubnetId": "ly52xefxa2hi********"
},
"response": {
"@type": "type.googleapis.com/google.protobuf.Empty"
}
}
Follow the status of the operation by the done field.