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 Yandex IoT Core

Trigger for Yandex IoT Core that passes messages to the Serverless Containers container

Written by
Yandex Cloud
  • Roles required for the proper operation of a trigger for Yandex IoT Core
  • Trigger for Yandex IoT Core message format
  • See also

The trigger for Yandex IoT Core is designed for managing messages exchanged between devices and registries. The trigger is created for topics: it receives copies of messages from them and passes those copies to the Serverless Containers container for processing.

The trigger must be in the same cloud as the device or register as the topic it reads messages from.

You can create a trigger:

  • For a standard topic implemented by the service except for the $monitoring/<device ID>/json topic.
  • For a topic with any subtopics and wildcards.
  • For an alias topic.

A trigger for Yandex IoT Core needs a service account to invoke the container.

Roles required for the proper operation of a trigger for Yandex IoT Core

  • 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.
  • To run a trigger, the service account needs the serverless.containers.invoker role for the folder with the container to be invoked by the trigger.

Read more about access management.

Trigger for Yandex IoT Core message format

Before the message is copied to a container, the trigger converts it to the following format:

{
    "messages": [
        {
            "event_metadata": {
                 "event_id": "2153b5d2-c6af-4c69-a28d-74ce965b7613",
                 "event_type": "yandex.cloud.events.iot.IoTMessage",
                 "created_at": "2019-09-25T15:51:17.872320525Z"
            },
            "details": {
                 "registry_id": "arenou2oj4ct42eq8g3n",
                 "device_id": "areqjd6un3afc3cefcvm",
                 "mqtt_topic": "$devices/areqjd6un3afc3cefcvm/events",
                 "payload": "VGVzdCA0"
            }
        },
        {
            "event_metadata": {
                 "event_id": "2153b5d2-c6af-4c69-a28d-74ce965b7613",
                 "event_type": "yandex.cloud.events.iot.IoTMessage",
                 "created_at": "2019-09-25T15:51:17.872320525Z"
            },
            "details": {
                 "registry_id": "arenou2oj4ct42eq8g3n",
                 "device_id": "areqjd6un3afc3cefcvm",
                 "mqtt_topic": "$devices/areqjd6un3afc3cefcvm/events",
                 "payload": "VGVzdCA0"
            }
        }
    ]
}

See also

  • Trigger for Yandex IoT Core that passes messages to the 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 Yandex IoT Core
  • Trigger for Yandex IoT Core message format
  • See also