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
    • Start testing with double trial credits
    • 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.
Yandex Serverless Containers
  • Comparison with other Yandex Cloud services
    • Overview
    • Creating a container
      • Overview
      • Timer
  • Access management
  • Pricing policy
  • Terraform reference
  • Audit Trails events
  • Release notes
  • FAQ

In this article:

  • Getting started
  • Create a timer
  • Check the result
  • What's next
  1. Getting started
  2. Creating a trigger
  3. Timer

Creating a timer that invokes a container

Written by
Yandex Cloud
Updated at May 26, 2025
  • Getting started
  • Create a timer
  • Check the result
  • What's next

Create a timer that invokes a Serverless Containers container every minute.

Getting startedGetting started

  1. Create a container to be invoked by your timer. Application and Dockerfile examples.
  2. Create a service account that will be used to invoke the container and assign it the serverless-containers.containerInvoker role.

Create a timerCreate a timer

Note

The trigger is initiated within 5 minutes of being created.

Management console
CLI
API
  1. In the management console, select the folder where you want to create a timer.

  2. Select Serverless Containers.

  3. In the left-hand panel, select Triggers.

  4. Click Create trigger.

  5. Under Basic settings:

    • Enter the trigger name: timer.
    • In the Type field, select Timer.
    • In the Launched resource field, select Container.
  6. Under Timer settings, enter * * ? * * * or select Every minute.

  7. Under Container settings, select a container and specify a service account to invoke it under.

  8. Click Create trigger.

If you do not have the Yandex Cloud CLI 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.

To create a trigger that invokes a container every minute, run this command:

yc serverless trigger create timer \
  --name timer \
  --cron-expression '* * ? * * *' \
  --invoke-container-id <container_ID> \
  --invoke-container-service-account-id <service_account_ID>

Where:

  • --name: Timer name.
  • --cron-expression: Container invocation schedule specified as a cron expression.
  • --invoke-container-id: Container ID.
  • --invoke-container-service-account-id: ID of the service account with rights to invoke the container.

Result:

id: a1sp9tj1jhar********
folder_id: b1g4j6o69kqj********
created_at: "2023-03-16T17:45:23.145213360Z"
name: timer
rule:
  timer:
    cron_expression: '* * ? * * *'
    invoke_container_with_retry:
      container_id: bbavvhra8ekc********
      service_account_id: aje1ki4ae68u********
status: ACTIVE

You can create a timer using the create API method.

Check the resultCheck the result

To make sure the timer is running properly, view the container logs. They should show that the container is invoked every minute.

  1. In the management console, select the folder with your container.
  2. Select Serverless Containers.
  3. Click the container to view its invocation log.
  4. In the window that opens, go to Logs and specify the period to view them for. The default period is 1 hour.

What's nextWhat's next

  • Check out the concepts.
  • Learn how to create other triggers.

Was the article helpful?

Previous
Overview
Next
All guides
© 2025 Direct Cursus Technology L.L.C.