Movatterモバイル変換


[0]ホーム

URL:


Building Lambda functions with Go - AWS Lambda
DocumentationAWS LambdaDeveloper Guide
Go runtime supportTools and libraries

Building Lambda functions with Go

Go is implemented differently than other managed runtimes. Because Go compiles natively to an executable binary, it doesn't require a dedicated language runtime. Use anOS-only runtime (theprovided runtime family) to deploy Go functions to Lambda.

Go runtime support

The Go 1.x managed runtime for Lambda isdeprecated. If you have functions that use the Go 1.x runtime, you must migrate your functions toprovided.al2023 orprovided.al2. Theprovided.al2023 andprovided.al2 runtimes offer several advantages overgo1.x, including support for the arm64 architecture (AWS Graviton2 processors), smaller binaries, and slightly faster invoke times.

No code changes are required for this migration. The only required changes relate to how you build your deployment package and which runtime you use to create your function. For more information, seeMigrating AWS Lambda functions from the Go1.x runtime to the custom runtime on Amazon Linux 2 on theAWS Compute Blog.

NameIdentifierOperating systemDeprecation dateBlock function createBlock function update

OS-only Runtime

provided.al2023

Amazon Linux 2023

Jun 30, 2029

Jul 31, 2029

Aug 31, 2029

OS-only Runtime

provided.al2

Amazon Linux 2

Jun 30, 2026

Jul 31, 2026

Aug 31, 2026

Tools and libraries

Lambda provides the following tools and libraries for the Go runtime:

For more information, seeaws-lambda-go on GitHub.

Lambda provides the following sample applications for the Go runtime:

Sample Lambda applications in Go
  • go-al2 – A hello world function that returns the public IP address. This app uses theprovided.al2 custom runtime.

  • blank-go – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK. This app uses thego1.x runtime.

Sample apps
Handler

[8]
ページ先頭

©2009-2025 Movatter.jp