The invocation context contains:
function_name: Function ID.
function_version: Function version ID.
memory_limit_in_mb: The amount of memory specified when creating the version, MB.
request_id: ID of the request being handled.
token: The parameters required for authentification in the Yandex.Cloud API.
The context also contains the following helper methods:
get_remaining_time_in_millis(): Returns the time, in ms, remaining to complete the current request.
Using the invocation context
The invocation context is necessary for the function to have access to information about the environment as to monitor memory usage, track the request execution time, and authenticate in the Yandex.Cloud API.
Authentication in the API of Yandex.Cloud
If a function has a specified service account, the
token parameter contains information for authentication on behalf of this service account:
access_token: The IAM token.
expires_in: The token lifetime in seconds.
token_type: The token type (
You can also get this information using the metadata service. For more information, see Authenticating from inside a VM.