I have a Golang 1.18 program like:
package main
import (
"fmt"
"github.com/aws/aws-lambda-go/lambda"
)
func HandleRequest() error {
fmt.Print("HandleRequest entered\n")
return nil
}
func main() {
fmt.Print("Starting HandleRequest\n")
lambda.Start(HandleRequest)
}
Which I've compiled in Linux, zip'ed up, and deployed to AWS Lambda with Go1.x runtime. When I "Test" my lambda via AWS UI, I see the Starting handleRequest print statement, but I don't see the handleRequest entered print startment. In the logs I see a line like Task timed out after 30.03 seconds.
I have no clue why it is timing out, or taking 30 seconds in order to start calling handleRequest. The handler function signature should be valid, according to https://docs.aws.amazon.com/lambda/latest/dg/golang-handler.html#golang-handler-signatures.
Any ideas? Thank you
handleRequestfunction must be exported... that means it should be visible to the caller... you need to rename it toHandleRequest. docs.aws.amazon.com/lambda/latest/dg/…