Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Virtual Private Cloud
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Cloud network
      • Creating a cloud network
      • Deleting a cloud network
      • Updating a cloud network
    • Subnet
      • Creating a subnet
      • Deleting a subnet
      • Updating a subnet
    • IP address
      • Reserving a static public IP address
      • Making a dynamic public IP address static
      • Making a static public IP address dynamic
      • Deleting a static public IP address
    • Static routes
      • Creating a static route
      • Enabling NAT to the internet
    • Security groups
      • Create a security group
      • Update a security group and rules
      • Delete a security group
    • DDoS Protection
      • Enable protection from DDoS attacks
  • Use cases
    • Architecture and protection of a basic internet service
  • Concepts
    • Relationship between service resources
    • Cloud networks and subnets
    • Cloud resource addresses
    • Static routes
    • Security groups
    • MTU and MSS
    • DHCP settings
    • Quotas and limits
  • DDoS Protection
  • Cloud Interconnect
  • Access management
  • Pricing policy
    • Current policy
    • Archive
      • Policy before January 1, 2019
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • AddressService
      • NetworkService
      • RouteTableService
      • SecurityGroupService
      • SubnetService
      • OperationService
    • REST
      • Overview
      • Address
        • Overview
        • create
        • delete
        • get
        • getByValue
        • list
        • listOperations
        • update
      • Network
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • listSubnets
        • move
        • update
      • RouteTable
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • move
        • update
      • SecurityGroup
        • Overview
      • Subnet
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • move
        • update
      • Operation
        • Overview
        • get
  • Questions and answers
  1. Step-by-step instructions
  2. Subnet
  3. Deleting a subnet

Deleting a subnet

  • Examples
    • Deleting a subnet from a particular folder

Alert

Before deleting a subnet, disable all resources connected to it.
You cannot restore a subnet after it is deleted.

Management console
CLI

To delete a subnet:

  1. Open the Virtual Private Cloud section in the folder you want to delete the subnet from.
  2. Click on the name of the subnet's cloud network.
  3. Click in the row of the subnet to delete.
  4. In the menu that opens, click Delete.
  5. In the window that opens, click Delete.

If you don't have the Yandex.Cloud command line interface yet, install and initialize it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

  1. See the description of the CLI command for deleting a subnet:

    $ yc vpc subnet delete --help
    
  2. Get a list of all subnets in the default folder:

    $ yc vpc subnet list
    +----------------------+-----------------------+------------------------+
    |          ID          |         NAME          | ... |       RANGE      |
    +----------------------+-----------------------+------------------------+
    ...
    | e2l0psbfoloefpjb1rau | test-subnet-1         | ... | [192.168.0.0/24] |
    ...
    +----------------------+-----------------------+-----+------------------+
    
  3. Select the ID or NAME of the subnet you need.

  4. Delete the subnet from the default folder:

    $ yc vpc subnet delete test-subnet-1
    

Examples

Deleting a subnet from a particular folder

CLI

To delete a subnet from a different folder, use the --folder-id or --folder-name flag.

$ yc vpc subnet delete test-subnet-2 --folder-id b1gnbfd11bq5g5vnjgr4
$ yc vpc subnet delete test-subnet-2 --folder-name test-folder

You can pass the ID and name as positional arguments, or you can use the --id and --name flags:

$ yc vpc subnet delete --id enpavfmgapumnl7cqin8
$ yc vpc subnet delete --name test-network-1
Language
Careers
Privacy policy
Terms of use
© 2021 Yandex.Cloud LLC