Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Billing with expense details by folder
  • Getting expense details by folder
  • Managing labels

In this article:

  • Adding a label
  • Updating a label
  • Deleting a label
  • Examples of label management
  • Adding a label
  • Updating a label
  • Deleting a label

Managing labels

Written by
Yandex Cloud
Updated at February 12, 2025
  • Adding a label
  • Updating a label
  • Deleting a label
  • Examples of label management
    • Adding a label
    • Updating a label
    • Deleting a label

Custom labels are pairs in the following format: <label name>=<label value>. You can label resources so that the cost breakdown file gets a column named label.user_labels.<label name>. You can assigned multiple labels to each resource.

For example, if all VMs belong to two projects, you can label each VM with project=1 or project=2. The cost breakdown file will then get the label.user_labels.project column with the relevant values.

Adding a labelAdding a label

CLI

If you do not have the Yandex Cloud CLI yet, install and initialize it.

Add a label to a service resource:

yc <service name> <resource type> add-labels <resource name or ID> \
  --labels <label name>=<label value>

Updating a labelUpdating a label

CLI

If you do not have the Yandex Cloud CLI yet, install and initialize it.

Warning

The existing labels (labels) will be completely overwritten by the ones you provide in your request.

Update a service resource label:

yc <service name> <resource type> update <resource name or ID> \
  --labels <label name>=<label value>

Deleting a labelDeleting a label

CLI

If you do not have the Yandex Cloud CLI yet, install and initialize it.

Delete a service resource label:

yc <service name> <resource type> remove-labels <resource name or ID> \
  --labels <label name>

Examples of label managementExamples of label management

Adding a labelAdding a label

Adding a label to a VM:

yc compute instance add-labels cl123g4dridnn5cna6df-yduv --labels project=test

Result:

done (5s)
id: fhm1pr2bu3p45s6ildh7
folder_id: b1g23ga45mev6cljderg
created_at: "2020-08-07T11:29:18Z"
name: cl123g4dridnn5cna6df-yduv
labels:
  project: test
zone_id: ru-central1-a
...

Updating a labelUpdating a label

Edit a Kubernetes cluster label:

yc managed-kubernetes cluster update k8s-gpu --labels new_lable=test_label

Result:

done (1m36s)
id: cat1hknor2345e6d7rr8
folder_id: b1g23ga45mev6cljderg
created_at: "2020-08-07T11:15:59Z"
name: cluster
labels:
  new_lable: test_label
status: RUNNING
...

Deleting a labelDeleting a label

Delete a Managed Service for MySQL® cluster label:

yc managed-mysql cluster remove-labels mysql123 --labels my_lable

Result:

id: c1qmjaatlurm2bcoi34i
folder_id: b1g23ga45mev6cljderg
created_at: "2020-08-20T11:53:20.015543Z"
name: mysql123
environment: PRODUCTION
...

Was the article helpful?

Previous
Getting expense details by folder
© 2025 Direct Cursus Technology L.L.C.