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. Updating a subnet

Updating a subnet

  • Examples
    • Changing a subnet using the name flag

After creating a subnet, you can change its name, description, and tags.

CLI

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 updating subnet parameters:

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

    $ yc vpc subnet list
    +----------------------+-----------------------+----------------------+
    |          ID          |         NAME          |         ...          |
    +----------------------+-----------------------+----------------------+
    ...
    | e2l2prrbkbimvjuuhht2 |     test-subnet-1     |         ...          |
    ...
    +----------------------+-----------------------+----------------------+
    
  3. Select the ID or NAME of the subnet you need.

  4. Change the subnet parameters, for example:

    $ yc vpc subnet update e2l2prrbkbimvjuuhht2 \
        --new-name test-subnet-renamed \
        --labels new_label=test_label
    id: e2l2prrbkbimvjuuhht2
    folder_id: b1g6ci08ma55klukmdjs
    created_at: "2018-10-24T13:54:10Z"
    name: test-subnet-renamed
    description: My test subnet
    labels:
      new_label: test_label
    network_id: enplom7a98s1t0lhass8
    zone_id: ru-central1-b
    v4_cidr_blocks:
    - 192.168.0.0/24
    

Examples

Changing a subnet using the name flag

CLI

You can change a subnet by using its name instead of its ID:

$ yc vpc subnet update test-subnet-1 \
    --new-name test-subnet-renamed \
    --labels new_label=test_label
id: e2l2prrbkbimvjuuhht2
folder_id: b1g6ci08ma55klukmdjs
created_at: "2018-10-24T13:54:10Z"
name: test-subnet-renamed
description: My test subnet
labels:
  new_label: test_label
network_id: enplom7a98s1t0lhass8
zone_id: ru-central1-b
v4_cidr_blocks:
- 192.168.0.0/24

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

$ yc vpc network update --id enpavfmgapumnl7cqin8 \
--new-name test-network-renamed \
--labels new_label=test_label
$ yc vpc network update --name test-network-1 \
--new-name test-network-renamed \
--labels new_label=test_label
Language
Careers
Privacy policy
Terms of use
© 2021 Yandex.Cloud LLC