Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • 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
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Serverless Containers
  • Comparing with other Yandex Cloud services
    • All tutorials
      • Building a CI/CD pipeline in GitLab using serverless products
      • Starting GitLab Runner in Serverless Containers
      • Setting up CI/CD in SourceCraft to deploy Serverless Containers using GitHub Actions
      • Scheduled image and PDF recognition in an Object Storage bucket
  • Access management
  • Tools
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  • FAQ

In this article:

  • Recognition steps
  • Get your cloud ready
  • Required paid resources
  • Create the infrastructure
  • Upload files for recognition and check how the Vision OCR service works
  • How to delete the resources you created
  1. Tutorials
  2. Serverless-based workflows and automation
  3. Scheduled image and PDF recognition in an Object Storage bucket

Scheduled image and PDF recognition in an Object Storage bucket

Written by
Yandex Cloud
Updated at July 13, 2026
View in Markdown
  • Recognition steps
  • Get your cloud ready
    • Required paid resources
  • Create the infrastructure
  • Upload files for recognition and check how the Vision OCR service works
  • How to delete the resources you created

In this tutorial, you will learn how to use Yandex Vision OCR to set up automatic recognition of new images (in supported formats) and PDFs in an bucket.

Recognition stepsRecognition steps

  1. The user uploads images or documents to the input directory (prefix) in a Yandex Object Storage bucket.
  2. The Yandex Cloud Functions trigger, is activated by timer and checks for new files in the input folder. Next, the files are sent for recognition to the Yandex Serverless Containers container.
  3. File recognition is in progress, the operation ID is saved in the process folder in the source bucket.
  4. Once the operation is successfully completed, the recognition results are saved to the result folder as JSON and TXT files. The ID of the successful operation is deleted from the process folder.

The infrastructure is built using the Yandex Cloud Terraform provider. The source code for this guide is available on GitHub.

To set up automatic image recognition via Vision OCR:

  1. Get your cloud ready.
  2. Create the infrastructure.
  3. Upload files for recognition and check how the Vision OCR service works.

If you no longer need the resources you created, delete them.

Get your cloud readyGet your cloud ready

Sign up for Yandex Cloud and create a billing account:

  1. Navigate to the management console and log in to Yandex Cloud or create a new account.
  2. On the Yandex Cloud Billing page, make sure you have a billing account linked and it has the ACTIVE or TRIAL_ACTIVE status. If you do not have a billing account, create one and link a cloud to it.

If you have an active billing account, you can create or select a folder for your infrastructure on the cloud page.

Learn more about clouds and folders here.

Required paid resourcesRequired paid resources

The infrastructure support cost for scheduled image and document recognition includes:

  • Fee for bucket data storage and bucket data operations (see Object Storage pricing).
  • Fee for using Vision OCR (see Vision OCR pricing).
  • Fee for the container invocation count, computing resources allocated for the application, and outgoing traffic (see Serverless Containers pricing).
  • Fee for storing the secret and operations with it (see Yandex Lockbox pricing).

Create the infrastructureCreate the infrastructure

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the guides on the Terraform website or its mirror.

To create your infrastructure via Terraform:

  1. Install Terraform, get the authentication credentials, and specify the source for installing the Yandex Cloud provider (see Configure your provider, Step 1).

  2. Prepare your infrastructure description files:

    1. Clone the repository containing the configuration files.

      git clone https://github.com/yandex-cloud-examples/yc-vision-ocr-recognizer.git
      
    2. Navigate to the terraform directory within the repository.

    3. In the variables.auto.tfvars file, specify these custom settings:

      • cloud_id: Cloud ID.
      • folder_id: Folder ID.
      • zone: Availability zone.
  3. Create the resources:

    1. In the terminal, navigate to the configuration file directory.

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

      terraform validate
      

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

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

      terraform plan
      

      You will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.

    4. Apply the configuration changes:

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

The system will create a bucket named ocr-recognition-....

Upload files for recognition and check how the Vision OCR service worksUpload files for recognition and check how the Vision OCR service works

  1. Upload the files for recognition to the input folder inside the bucket you created earlier.
  2. Open the result folder in your bucket. The folder should contain the recognition results as TXT and JSON files.

How to delete the resources you createdHow to delete the resources you created

To stop paying for the resources you created:

  1. Delete all files from the bucket.

  2. Open the main.tf configuration file and delete your infrastructure description from it.

  3. Apply the changes:

    1. In the terminal, navigate to the configuration file directory.

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

      terraform validate
      

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

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

      terraform plan
      

      You will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.

    4. Apply the configuration changes:

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

Was the article helpful?

Previous
Setting up CI/CD in SourceCraft to deploy Serverless Containers using GitHub Actions
Next
Access management
© 2026 Direct Cursus Technology L.L.C.