Home icon
Migrating AWS Lambda functions from the Go1.x runtime to the custom runtime on Amazon Linux 2

Blog



This article provides a comprehensive guide for migrating AWS Lambda Go functions from the deprecated go1.x runtime to the provided.al2 runtime on Amazon Linux 2.

  • go1.x runtime is being deprecated alongside Amazon Linux 1 end-of-life
  • provided.al2 runtime supports AWS Graviton2 processors for 34% better price-performance
  • Simpler single-process architecture eliminates RPC overhead for faster invokes
  • Compile Go binaries for Linux with executable named "bootstrap"
  • Add lambda.norpc build tag to reduce binary size and cold start time
  • Update build scripts, CloudFormation, SAM, and CDK configurations for new runtime
  • Handler value can be set to any value but "bootstrap" is recommended
  • Container image users must migrate from go1.x base image to provided.al2 base image
  • Migration requires no code changes, only build and deployment configuration updates

The migration enables better performance and cost efficiency while aligning Go with other compiled languages on Lambda.



Go to article

The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.

Related articles

The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.