Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML Services
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Object Storage
    • All guides
      • Uploading an object
      • Multipart upload of an object
      • Get a list of bucket objects
      • Getting information about an object
      • Downloading an object
      • Restoring an object's version
      • Renaming and moving objects
      • Copying objects
      • Getting a pre-signed URL to download an object
      • Configuring an object lock
      • Deleting an object
      • Deleting all objects
      • Deleting a partially uploaded object
      • Editing an object's ACL
      • Managing object labels
      • Managing object custom metadata
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Bucket logs
  • Release notes
  • FAQ

In this article:

  • Adding or updating labels
  • Viewing labels
  • Deleting labels
  1. Step-by-step guides
  2. Objects
  3. Managing object labels

Managing object labels

Written by
Yandex Cloud
Improved by
Tania L.
Updated at July 29, 2025
  • Adding or updating labels
  • Viewing labels
  • Deleting labels

An object label is a key-value pair used for logical object labeling.

Note

Yandex Cloud uses labels to logically identify resources. However, Object Storage supports compatibility with Amazon S3 API, that is why we use tags, a term native to AWS, in the AWS CLI commands and API parameters.

Adding or updating labelsAdding or updating labels

Management console
Yandex Cloud CLI
AWS CLI
Terraform
API
  1. In the management console, select Object Storage from the list of services and go to the bucket you need.
  2. In the left-hand panel, select Objects.
  3. Click the name of the object you need.
  4. Click Add label.
  5. Enter label key and value separated by a colon (key:value).

To edit a label:

  1. Click Add label.
  2. Enter the key of the label you want to edit and its new value.

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

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

  1. See the description of the CLI command for updating object labels in a bucket:

    yc storage s3api put-object-tagging --help
    
  2. Get a list of buckets in the default folder:

    yc storage bucket list
    

    Result:

    +------------------+----------------------+-------------+-----------------------+---------------------+
    |       NAME       |      FOLDER ID       | MAX SIZE    | DEFAULT STORAGE CLASS |     CREATED AT      |
    +------------------+----------------------+-------------+-----------------------+---------------------+
    | my-bucket        | b1g5dk66rc1u******** | 53687091200 | STANDARD              | 2024-12-17 07:17:04 |
    +------------------+----------------------+-------------+-----------------------+---------------------+
    
  3. In the terminal, run this command that overwrites any existing object labels:

    yc storage s3api put-object-tagging \
      --bucket <bucket_name> \
      --key <object_key> \
      --version-id <version_ID> \
      --tagging TagSet=[{Key=<label_key>,Value=<label_value>},{Key=<label_key>,Value=<label_value>}]
    

    Where:

    • --bucket: Bucket name.
    • --key: Bucket object key.
    • --version-id: Object version. This is an optional parameter.
    • --tagging: Array of object labels, where:
      • Key: Label key, the string type.
      • Value: Label value, the string type.

    Result:

    request_id: ac9066e5********
    

If you do not have the AWS CLI yet, install and configure it.

In the terminal, run this command that overwrites any existing object labels:

aws s3api put-object-tagging \
  --bucket <bucket_name> \
  --key <object_key> \
  --tagging 'TagSet=[{Key=<label_key>,Value=<label_value>},{Key=<label_key>,Value=<label_value>}]' \
  --endpoint-url=https://storage.yandexcloud.net

Where:

  • --bucket: Bucket name.
  • --key: Bucket object key.
  • --tagging: Array of object labels, where:
    • Key: Label key, the string type.
    • Value: Label value, the string type.
  • --endpoint-url: Object Storage endpoint.

Note

Terraform uses a service account to interact with Object Storage. Assign to the service account the required role, e.g., storage.admin, for the folder where you are going to create resources.

If you do not have Terraform yet, install it and configure the Yandex Cloud provider.

  1. Open the Terraform configuration file and add the tags section to the object description:

    resource "yandex_storage_object" "test-object" {
      access_key       = "<static_key_ID>"
      secret_key       = "<secret_key>"
      bucket           = "<bucket_name>"
      key              = "<object_name>"
      source           = "<path_to_file>"
      tags             = {
        <label_1_key> = "<label_1_value>"
        <label_2_key> = "<label_2_value>"
      }
    }
    

    Where tags is the array of object labels in <key> = "<value>" format.

    For more information about the yandex_storage_object resource in Terraform, see this TF provider article.

  2. Apply the changes:

    1. In the terminal, go to the directory where you edited the configuration file.

    2. Make sure the configuration file is correct using this command:

      terraform validate
      

      If the configuration is correct, you will get this message:

      Success! The configuration is valid.
      
    3. Run this command:

      terraform plan
      

      You will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.

    4. Apply the changes:

      terraform apply
      
    5. Type yes and press Enter to confirm the changes.

This will add the specified labels to your object. You can check the new labels and the object settings using the AWS CLI or S3 API.

To add or update object labels, use the putObjectTagging S3 API method.

Viewing labelsViewing labels

Management console
Yandex Cloud CLI
AWS CLI
API

You can see the labels in the list of bucket objects and on the individual object's page.

  1. In the management console, select Object Storage from the list of services and go to the bucket in question.
  2. In the left-hand panel, select Objects.
  3. Click the name of the object you need.

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

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

  1. See the description of the CLI command for viewing object labels in a bucket:

    yc storage s3api get-object-tagging --help
    
  2. Get a list of buckets in the default folder:

    yc storage bucket list
    

    Result:

    +------------------+----------------------+-------------+-----------------------+---------------------+
    |       NAME       |      FOLDER ID       | MAX SIZE    | DEFAULT STORAGE CLASS |     CREATED AT      |
    +------------------+----------------------+-------------+-----------------------+---------------------+
    | my-bucket        | b1g5dk66rc1u******** | 53687091200 | STANDARD              | 2024-12-17 07:17:04 |
    +------------------+----------------------+-------------+-----------------------+---------------------+
    
  3. Get information about object labels:

    yc storage s3api get-object-tagging \
      --bucket <bucket_name> \
      --key <object_key> \
      --version-id <version_ID>
    

    Where:

    • --bucket: Bucket name.
    • --key: Bucket object key.
    • --version-id: Object version. This is an optional parameter.

    Result:

    request_id: 2defc7b2********
    tag_set:
      - key: key-for-my-object-2
        value: second-value
      - key: key-for-my-object-1
        value: first-value
    

If you do not have the AWS CLI yet, install and configure it.

In the terminal, run this command:

aws s3api get-object-tagging \
  --bucket <bucket_name> \
  --key <object_key> \
  --endpoint-url=https://storage.yandexcloud.net

Where:

  • --bucket: Bucket name.
  • --key: Bucket object key.
  • --endpoint-url: Object Storage endpoint.

Result:

{
    "TagSet": [
        {
            "Key": "test-key-1",
            "Value": "test-value-1"
        },
        {
            "Key": "test-key-2",
            "Value": "test-value-2"
        }
    ]
}

To view object labels, use the getObjectTagging S3 API method.

Deleting labelsDeleting labels

Management console
Yandex Cloud CLI
AWS CLI
Terraform
API
  1. In the management console, select Object Storage from the list of services and go to the bucket you need.
  2. In the left-hand panel, select Objects.
  3. Click the name of the object you need.
  4. Click the cross next to the label you want to delete.

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

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

  1. See the description of the CLI command for deleting object labels in a bucket:

    yc storage s3api delete-object-tagging --help
    
  2. Get a list of buckets in the default folder:

    yc storage bucket list
    

    Result:

    +------------------+----------------------+-------------+-----------------------+---------------------+
    |       NAME       |      FOLDER ID       | MAX SIZE    | DEFAULT STORAGE CLASS |     CREATED AT      |
    +------------------+----------------------+-------------+-----------------------+---------------------+
    | my-bucket        | b1g5dk66rc1u******** | 53687091200 | STANDARD              | 2024-12-17 07:17:04 |
    +------------------+----------------------+-------------+-----------------------+---------------------+
    
  3. Delete object labels from the bucket:

    yc storage s3api delete-object-tagging \
      --bucket <bucket_name> \
      --key <object_key> \
      --version-id <version_ID>
    

    Where:

    • --bucket: Bucket name.
    • --key: Bucket object key.
    • --version-id: Object version. This is an optional parameter.

    Result:

    request_id: 1131dfc4********
    

If you do not have the AWS CLI yet, install and configure it.

In the terminal, run this command:

aws s3api delete-object-tagging \
  --bucket <bucket_name> \
  --key <object_key> \
  --endpoint-url=https://storage.yandexcloud.net

Where:

  • --bucket: Bucket name.
  • --key: Bucket object key.
  • --endpoint-url: Object Storage endpoint.

If you do not have Terraform yet, install it and configure the Yandex Cloud provider.

  1. Open the Terraform configuration file and delete the tags section from the object description.

    Example of an object label description in Terraform configuration
     resource "yandex_storage_object" "test-object" {
       ...
       tags             = {
         <label_1_key> = "<label_1_value>"
         <label_2_key> = "<label_2_value>"
       }
     }
    ...
    
  2. Apply the changes:

    1. In the terminal, go to the directory where you edited the configuration file.

    2. Make sure the configuration file is correct using this command:

      terraform validate
      

      If the configuration is correct, you will get this message:

      Success! The configuration is valid.
      
    3. Run this command:

      terraform plan
      

      You will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.

    4. Apply the changes:

      terraform apply
      
    5. Type yes and press Enter to confirm the changes.

This will delete the object labels. You can check the label deletion and the object settings using the AWS CLI or S3 API.

To delete object labels, use the deleteObjectTagging S3 API method.

Was the article helpful?

Previous
Editing an object's ACL
Next
Managing object custom metadata
© 2025 Direct Cursus Technology L.L.C.