Based on: aws golang handler docs
and: aws golang lambda docs
Add github.com/aws/aws-lambda-go/lambda as a dependency
Build the package with: GOOS=linux go build main.go
so that it compiles for linux.
The main.go file needs to have 644 permissions.
Zip the binary with: zip function.zip main
Go to the aws lambda function overview page on aws and create a new function
create a hello world project
upload the .zip file
configure the runtime to run with go1.x
and as Handler use main
go to the test tab and use the hello-world
trigger and use main
as the event name\
When the lambda should be used with Api Gateway The Events need to be of type events.APIGatewayProxyResponse
of the github.com/aws/aws-lambda-go/events library. Find the documentation here.
This Example project does not cover APIGateway