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
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Cloud Functions
  • Comparison with other Yandex Cloud services
    • Overview
    • Function
    • Invoking a function
    • Asynchronous function invocation
    • Long-lived functions
    • Function termination notifications
    • Networking
    • Mounting external resources to a function file system
    • Builder
      • Overview
      • Timer
      • Trigger for Message Queue
      • Trigger for Object Storage
      • Trigger for Container Registry
      • Trigger for Cloud Logging
      • Trigger for Yandex IoT Core
      • Trigger for budgets
      • Trigger for Data Streams
      • Email trigger
    • Dead Letter Queue
    • Function logs
    • Backups
    • Quotas and limits
  • Tools
  • Pricing policy
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ

In this article:

  • Events for setting up a trigger
  • Filtering events by object
  • Batching
  • Roles required for the proper operation of a trigger for Object Storage
  • Object Storage trigger message format
  • Use cases
  • See also
  1. Concepts
  2. Trigger
  3. Trigger for Object Storage

Trigger for Object Storage that invokes a Cloud Functions function

Written by
Yandex Cloud
Updated at April 18, 2025
  • Events for setting up a trigger
    • Filtering events by object
  • Batching
  • Roles required for the proper operation of a trigger for Object Storage
  • Object Storage trigger message format
  • Use cases
  • See also

A trigger for Object Storage runs a Cloud Functions function when a specific event occurs with a Object Storage object. The trigger must be in the same cloud as the bucket whose events it is subscribed to.

A trigger for Object Storage needs a service account to call the function.

For more information about creating a trigger for Object Storage, see Creating a trigger for Object Storage that invokes a Cloud Functions function.

Events for setting up a triggerEvents for setting up a trigger

Events with bucket objects that can be tracked using a trigger:

  • Creating an object.
  • Editing an object ACL.
  • Deleting an object.

Filtering events by objectFiltering events by object

Events are filtered using prefixes and suffixes for an object key:

  • The prefix is a part at the beginning of the object key.
  • The suffix is a part at the end of the object key.

Prefixes and suffixes can be of any length. When using a prefix and suffix at the same time, filtering is based on the logical AND: for the trigger to fire, the object key must match both the prefix and suffix.

BatchingBatching

Batching settings allow you to send multiple events to a function at the same time. They set a top limit on the size of an event group and its accumulation time. For example, if the size of an event group is 3, the function can receive groups that contain from 1 to 3 events.

Roles required for the proper operation of a trigger for Object StorageRoles required for the proper operation of a trigger for Object Storage

  • To create a trigger, you need a permission for the service account under which the trigger runs the operation. This permission comes with the iam.serviceAccounts.user and editor roles or higher.
  • For the trigger to fire, the service account needs the functions.functionInvoker role for the folder containing the function called by the trigger.

Read more about access management.

Object Storage trigger message formatObject Storage trigger message format

After the trigger is activated, it sends the following message to the function:

{
  "messages": [
    {
      "event_metadata": {
        "event_id": "bb1dd06d-a82c-49b4-af98-d8e0********",
        "event_type": "yandex.cloud.events.storage.ObjectDelete",
        "created_at": "2019-12-19T14:17:47.847365Z",
        "tracing_context": {
          "trace_id": "dd52ace7********",
          "span_id": "",
          "parent_span_id": ""
        },
        "cloud_id": "b1gvlrnlei4l********",
        "folder_id": "b1g88tflru0e********"
      },
      "details": {
        "bucket_id": "s3-for-trigger",
        "object_id": "dev/0_15a775_972dbde4_orig12.jpg"
      }
    }
  ]
}

Use casesUse cases

  • Automatically copying objects from one Yandex Object Storage bucket to another

See alsoSee also

  • Trigger for Object Storage that invokes a Serverless Containers container
  • Trigger for Object Storage that sends messages to WebSocket connections

Was the article helpful?

Previous
Trigger for Message Queue
Next
Trigger for Container Registry
Yandex project
© 2025 Yandex.Cloud LLC