Skip to content
Switch branches/tags

Latest commit

* Adding structures for iot custom authorizer request/response

* Making the iot policy documents an array of strings to match the documentation

* Rebasing and updating iot events since the contract has chagned

* Making the api gateway custom authorizer policy more generic

* Fixed formatting

* Update iot.go

to satisfy the linter

* Update iot.go

* Delete workspace.xml

* Delete vcs.xml

* Delete misc.xml

* Delete encodings.xml

* Delete modules.xml

* Delete aws-lambda-go.iml

* Delete policy.go

Co-authored-by: Bryan Moffatt <>

Git stats


Failed to load latest commit information.

AWS Lambda for Go

tests build-lambda-zip Go Reference GoCard codecov

Libraries, samples, and tools to help Go developers develop AWS Lambda functions.

To learn more about writing AWS Lambda functions in Go, go to the official documentation

Getting Started

// main.go
package main

import (

func hello() (string, error) {
	return "Hello ƛ!", nil

func main() {
	// Make the handler available for Remote Procedure Call by AWS Lambda

Building your function

Preparing a binary to deploy to AWS Lambda requires that it is compiled for Linux and placed into a .zip file.

For developers on Linux and macOS

# Remember to build your handler executable for Linux!
GOOS=linux GOARCH=amd64 go build -o main main.go
zip main

For developers on Windows

Windows developers may have trouble producing a zip file that marks the binary as executable on Linux. To create a .zip that will work on AWS Lambda, the build-lambda-zip tool may be helpful.

Get the tool

set GO111MODULE=on
go.exe get -u

Use the tool from your GOPATH. If you have a default installation of Go, the tool will be in %USERPROFILE%\Go\bin.

in cmd.exe:

set GOOS=linux
set GOARCH=amd64
go build -o main main.go
%USERPROFILE%\Go\bin\build-lambda-zip.exe -o main

in Powershell:

$env:GOOS = "linux"
$env:GOARCH = "amd64"
$env:CGO_ENABLED = "0"
go build -o main main.go
~\Go\Bin\build-lambda-zip.exe -o main

Deploying your functions

To deploy your function, refer to the official documentation for deploying using the AWS CLI, AWS Cloudformation, and AWS SAM.

Event Integrations

The event models can be used to model AWS event sources. The official documentation has detailed walkthroughs.


Libraries, samples and tools to help Go developers develop AWS Lambda functions.




No packages published