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 Cloud Functions
  • Comparison with other Yandex Cloud services
    • Overview
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Handling errors
    • Using the SDK
  • Tools
  • Pricing policy
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ
  1. Developing in Go
  2. Invocation context

Go function invocation context

Written by
Yandex Cloud
Updated at April 9, 2025

Invocation context is an object that is optionally accepted by the request handler. It is a context.Context type object providing an interface you can use to get more information about the Go function version properties:

  • lambdaRuntimeFunctionName: Function ID (string).
  • lambdaRuntimeFunctionVersion: Function version ID (string).
  • lambdaRuntimeMemoryLimit: Amount of memory specified when creating the version, MB (int).
  • lambdaRuntimeRequestID: Request ID (string).

To extract information from the invocation context, use its Value(key) method and provide to it as a string one of the keys described above as the key parameter.

Authentication in the Yandex Cloud APIAuthentication in the Yandex Cloud API

If a function has a specified service account, you can use the SDK to obtain information that is necessary for authentication on behalf of this service account. To get this information, use the following methods:

creds := ycsdk.InstanceServiceAccount()
token, err := creds.IAMToken(ctx)

The token.IamToken field contains the required IAM token.
The code above works via the metadata service that is available in the function environment with the specified service account.

Was the article helpful?

Previous
Request handler
Next
Logging
© 2025 Direct Cursus Technology L.L.C.