Using the SDK for a function in Python
Written by
Updated at May 19, 2026
You can use the SDK library to work with the Yandex Cloud API. To install it, specify the dependency in the requirements.txt file. The SDK library is pre-installed in the python37 and python38 runtimes.
The library source code is available on GitHub
The SDK (Software Development Kit)
import yandexcloud
from yandex.cloud.resourcemanager.v1.cloud_service_pb2 import ListCloudsRequest
from yandex.cloud.resourcemanager.v1.cloud_service_pb2_grpc import CloudServiceStub
def handler(event, context):
cloud_service = yandexcloud.SDK().client(CloudServiceStub)
clouds = {}
for c in cloud_service.List(ListCloudsRequest()).clouds:
clouds[c.id] = c.name
return clouds