AWS Lambda function Timedout after 3 sec using AWS SAM

I am using template.yml in order to set up my lambda. I forgot to re-build and re-run sam local start-api when I introduced Timeout property to it. Honest mistake, thank you for your time.


This doesn't pertain to sam local start-api, but if you're developing in PyCharm and running a single Lambda function with the PyCharm run button, there's another setting you might not have seen in the run configuration window where you can specify the timeout:

enter image description here


The default timeout of Lambda functions is 3 seconds. You can set any value by updating the Timeout property in your SAM template, e.g.

ExampleLambda:
  Type: AWS::Serverless::Function
  Properties:
    CodeUri: .
    Handler: index.handler
    Runtime: nodejs10.x
    Timeout: 10