Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Blog
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
Yandex project
© 2023 Yandex.Cloud LLC
Yandex Serverless Containers
  • Comparison with other Yandex Cloud services
  • Getting started
  • Step-by-step instructions
  • Concepts
    • Overview
    • Container
    • Invoking a container
    • Networking
    • Runtime environments
    • Trigger
      • 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
    • Container logs
    • Backups
    • Quotas and limits
  • Practical guidelines
  • Access management
  • Pricing policy
  • Containers API reference
  • API Triggers reference
  • Questions and answers
  1. Concepts
  2. Trigger
  3. Trigger for Cloud Logging

Trigger for Cloud Logging that invokes a Serverless Containers container

Written by
Yandex Cloud
  • Roles required for the proper operation of a trigger for Cloud Logging
  • Format of the message from the trigger for Cloud Logging
  • See also

A trigger for Cloud Logging invokes a Serverless Containers container when messages are received in a log group.

A trigger for Cloud Logging needs a service account to read messages from the log group and invoke a container.

Roles required for the proper operation of a trigger for Cloud Logging

  • To create a trigger, you need a permission for a service account that runs the trigger executing the operation. This permission is included in the iam.serviceAccounts.user and editor roles and higher.
  • For a trigger to work, the service account needs the following roles:
    • serverless.containers.invoker for the container that the trigger invokes.
    • logging.reader for the log group which, when records are added, activates the trigger.

Format of the message from the trigger for Cloud Logging

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

{
   "messages":[
      {
         "event_metadata":{
            "event_id":"2c59a567-6666-4b65-a0b0-cc**********",
            "event_type":"yandex.cloud.events.serverless.triggers.LoggingMessageBatch",
            "created_at":{
               "seconds":1630607359,
               "nanos":6794776
            }
         },
         "details":{
            "messages":[
               {
                  "resource":{
                     "type":"serverless.function",
                     "id":"b09tm9raoe**********"
                  },
                  "timestamp":"2021-09-02 18:29:17.118082213 +0000 UTC",
                  "level":"INFO",
                  "message":"START RequestID: 085035c7-2319-40dd-bb03-fd********** Version: b09s5cq4b935********",
                  "json_payload":{
                     "request_id":"085035c7-2319-40dd-bb03-fdb2********",
                     "version_id":"b09s5cq4b935********"
                  }
               }
            ]
         }
      }
   ]
}

See also

  • Trigger for Cloud Logging that invokes a Cloud Functions function.

Was the article helpful?

Language / Region
Yandex project
© 2023 Yandex.Cloud LLC
In this article:
  • Roles required for the proper operation of a trigger for Cloud Logging
  • Format of the message from the trigger for Cloud Logging
  • See also