When does an Async lambda retry?
It's not clear to me by reading when https://docs.aws.amazon.com/lambda/latest/dg/invocation-retries.html retries.
I know it retires when it times out.
But what if I did a
throw New Error("uh oh") in my nodejs function, would it retry?
Raising an exception like that is a Function Error which is retried twice for Asynchronous invocation. Depending on the error you've encountered in your function, throwing that exception may or may not make sense. If for example your code decides the incoming event isn't valid, there's no point triggering a retry.
Maybe a better question is, how do I return a "Bad request" error in nodejs, the sort that won't get retried?
Exceptions will cause an invocation retry. If you return from your handler, it is not considered a failure, regardless of what is the return value. If you do not want to retry, just return some value from the handler. As it is an asynchronous invocation, nobody is really looking at the result, unless you are also using Lambda destinations. If you are using Lambda destination you can return different responses in case of success and failure, send them to EventBridge and create different rules to handle them differently.
How do a trigger a reboot action on lightsail cloudwatch alarm state?asked 13 days ago
Lambda triggers and Time to Live (TTL)asked a year ago
Sendgrid python lambda times out.asked 2 years ago
CloudTrail Not Logging All WAFv2 Eventsasked 8 months ago
Error on bncert-tool when entering the domain-nameasked 9 days ago
Async Lambda retries conflicting documentationAccepted Answerasked 3 years ago
cloudshell not workingasked 4 months ago
When does an Async lambda retry?asked a month ago
What happens if I call SendTaskSuccess multiple times for the same task?Accepted Answerasked 2 months ago
Is it possible to kill/stop a running lambda function?asked 5 years ago