Hello. I want to send “unsuccessful” Lambda invoc...
# help
ö
Hello. I want to send “unsuccessful” Lambda invocations by APIGateway to somewhere. I guess I can define “unsuccessful” as it an invocation resulting in
4XX
and and
5XX
status codes. It’s possible that a runtime error thrown, or simply ran out of memory, or timed out. But at the end, it is still the case that APIGateway responds, in this case the statusCode would be some 5XX’s, so I would know that there is something wrong with the Lambda. As I read
AWS::Serverless::Function
resource properties, I see that there are two properties might be relevant, but I’m really not sure how they differ, and which one to be chosen. What is really the difference between
DeadLetterQueue
vs
EventInvokeConfiguration
r
I've personally not used a DLQ with API calls. Instead we use tracing and monitoring to record when errors occur and alert as appropriate. For example, with Epsagon, when something goes wrong you can see all the the payloads between all resources that were involved in the chain of calls - e.g. Browser to API Gateway to Lambda to DynamoDB
f
EventInvokeConfiguration
applies to async Lambda invoke, (ie. SNS, SQS, etc), API Gateway invoked the Lambda synchronously, so the option is irrelevant.
DeadLetterQueue
will send failed Lambda invocations to an SQS queue. @Ömer Toraman
Depends on what u want to do w/ the failed Lambda invocations. If you just want to get alerted, what @Ross Coundon suggested a probably a lot easier to setup.
ö
Thanks @Frank That makes sense. Yeah Ross’s solution seems ideal, except that it’s not free 😄 My use case is notifying Microsoft Teams Channel upon non
2XX
statusCodes. So I guess I can go with only DeadLetterQueue, however, there are many clients, and hence for every client the
DeadLetterQueue
will require to be configured. The solution that I’m currently working on is putting an event on
EventBridge
, consuming the even via
SNS
, subscribing Lambda to topic and notifying the appropriate channel by calling MS Team’s Incoming WebHook.
Maybe
DeadLetterQueue
is simpler 🤔
r
If you can get signed up to AWS Activate it's free for a year