In the AWS Console it is possible to configure the number of retry attempts the Lambda Function will make in case of failure:
Is there any parameter in serverless.yml that allows the user to set that configuration?
Lambda functions being invoked asynchronously are retried at least 3 times. Events from Amazon Kinesis streams and Amazon DynamoDB streams are retried until the Lambda function succeeds or the data expires.
You cannot increase the runtime to more than 15 minutes. The AWS Lambda limit page states the Function timeout is 900 seconds (15 minutes) . If you need more than 15 minutes of execution time you have to look at other services.
To stop it from retrying, you should make sure that any error is handled and you tell Lambda that your invocation finished successfully by returning a non-error (or in Node, calling callback(null, <any>) . To do this you can enclose the entire body of your handler function with a try-catch.
Short description. There are three reasons why retry and timeout issues occur when invoking a Lambda function with an AWS SDK: A remote API is unreachable or takes too long to respond to an API call. The API call doesn't get a response within the socket timeout.
[2020-09 updated answer] As of v1.78.0, serverless now supports maximumRetryAttempts
(and maximumEventAge
).
[2020-01 original answer] At the time of posting, Serverless Framework does not yet support the configuration of Lambda retry counts. Note that the underlying feature became available from AWS Lambda on Nov 25, 2019. It is being tracked by Serverless as issues/7012.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With