Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • 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 Cloud Functions
  • Comparing with other Yandex Cloud services
    • Overview
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Error handling
    • Using the SDK
  • Tools
  • Pricing policy
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  • FAQ
  1. Developing in Go
  2. Invocation context

Go function invocation context

Written by
Yandex Cloud
Updated at July 2, 2026
View in Markdown

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:

  • yFunctionFolderID: Folder containing the function.
  • lambdaRuntimeFunctionName: Function ID (string).
  • lambdaRuntimeFunctionVersion: Function version ID (string).
  • lambdaRuntimeMemoryLimit: Amount of memory specified when creating the version, in 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 with the Yandex Cloud APIsAuthentication with the Yandex Cloud APIs

If you specified a service account for the function, you can use the SDK to obtain authentication information for that 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 through the metadata service that is available in the function environment with the specified service account.

Was the article helpful?

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