Lesson 54 of 60
GoBuilding a Serverless Function with AWS Lambda (Go Runtime)
20 minutes
Course progress90%
AWS Lambda in Go
This lesson explains the main concept clearly with beginner-friendly examples and background so you can learn why the code works.
Add the AWS SDK:
$ go get github.com/aws/aws-lambda-go/lambda
package main
import (
"context"
"github.com/aws/aws-lambda-go/events"
)
Response { Message }
(events.APIGatewayProxyResponse, ) {
payload []
json.Unmarshal([](req.Body), &payload)
resp := Response{Message: + payload[]}
body, _ := json.Marshal(resp)
events.APIGatewayProxyResponse{StatusCode:, Body:(body)},
}
{ lambda.Start(handler) }