1

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

2
  • The handleRequest function must be exported... that means it should be visible to the caller... you need to rename it to HandleRequest. docs.aws.amazon.com/lambda/latest/dg/… Commented Jun 7, 2022 at 2:06
  • @Chetan thanks but I tried and same result with a timeout. This is deployed in a VPC, but I am not accessing any resources, as shown in the code. Commented Jun 7, 2022 at 2:21

1 Answer 1

1

Turns out I needed an outbound security group rule to allow all traffic, although I dont know why (as I'm not making any outbound requests).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.