Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • 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
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Serverless Containers
  • Comparing with other Yandex Cloud services
    • All guides
    • Getting an IAM token for a service account using a container
      • Invoking a container
      • Invoking a container asynchronously
      • Getting an invocation link
      • Authenticating when invoking a private container via HTTPS
    • Viewing operations with service resources
  • Access management
  • Tools
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  • FAQ

In this article:

  • Setting up asynchronous invocation
  • Invoke the container
  • See also
  1. Step-by-step guides
  2. Invoking a container
  3. Invoking a container asynchronously

Invoking a container asynchronously

Written by
Yandex Cloud
Updated at September 23, 2025
  • Setting up asynchronous invocation
  • Invoke the container
  • See also

Note

This feature is at the Preview stage.

Setting up asynchronous invocationSetting up asynchronous invocation

Management console
CLI
Terraform
API
  1. In the management console, select the folder with your container.

  2. Select Serverless Containers.

  3. Select the container whose revision you want to create.

  4. Navigate to the Editor tab.

  5. Under Asynchronous invocation:

    1. Enable asynchronous invocation.
    2. Specify a service account with the serverless-containers.containerInvoker role for asynchronous invocations.
  6. Click Create revision.

If you do not have the Yandex Cloud CLI installed 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 set up asynchronous invocation, run the following command:

yc serverless container revision deploy \
  --container-name <container_name> \
  --image <Docker_image_URL> \
  --service-account-id <service_account_ID> \
  --async-service-account-id <ID_of_service_account_for_asynchronous_invocations>

Where:

  • --service-account-id: ID of the service account with the serverless-containers.editor role or higher.
  • --async-service-account-id: ID of the service account with the serverless-containers.containerInvoker role for asynchronous invocations.

Result:

done (6s)
id: bba1r76l8f73********
container_id: bbado1g2mtqj********
created_at: "2025-09-08T12:03:32.797Z"
image:
  image_url: cr.yandex/crpmfvcgnl26********/ubuntu:hello
  image_digest: sha256:96ab2d89a82fcfc63e24b9ef26de8b3b11ed1043cec41d4359a8de8b********
resources:
  memory: "134217728"
  cores: "1"
  core_fraction: "100"
execution_timeout: 3s
concurrency: "1"
service_account_id: ajelprpohp7r********
status: ACTIVE
log_options:
  folder_id: b1g681qpemb4********
runtime:
  http: {}
async_invocation_config:
  service_account_id: ajeaim70pe1u********

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 relevant documentation on the Terraform website or its mirror.

If you do not have Terraform yet, install it and configure the Yandex Cloud provider.

To set up asynchronous invocation:

  1. Open the Terraform configuration file and add the async_invocation section to the container description:

    resource "yandex_serverless_container" "test-container" {
      name               = "<container_name>"
      memory             = "<RAM_size>"
      execution_timeout  = "<execution_timeout>"
      service_account_id = "<service_account_ID>"
    
      image {
        url = <container_image_path>
      }
    
      async_invocation {
        service_account_id = "<service_account_ID>"
      }
    }
    

    Where:

    • async_invocation: Asynchronous invocation parameters:

      • service_account_id: Service account with the serverless-containers.containerInvoker role.

    For more information about yandex_serverless_container properties, see the relevant provider documentation.

  2. Apply the changes:

    1. In the terminal, go to the directory where you edited the configuration file.

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

      terraform validate
      

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

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

      terraform plan
      

      You will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.

    4. Apply the changes:

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

You can check the container's update and settings using the management console or this CLI command:

yc serverless serverless-container revision get <container_revision_ID>

To configure asynchronous invocation, use the deployRevision REST API method for the Container resource or the ContainerService/DeployRevision gRPC API call.

Invoke the containerInvoke the container

When invoking the container over HTTP, specify the X-Ycf-Container-Integration-Type: async header.

See alsoSee also

  • Asynchronous container invocation

Was the article helpful?

Previous
Invoking a container
Next
Getting an invocation link
© 2025 Direct Cursus Technology L.L.C.