lift
lift copied to clipboard
Add optional reportBatchItemFailures setting
Start from the Use-case
When the event source mapping is created using the Lift plugin, the functionResponseType attribute is set to "ReportBatchItemFailures". For whatever reason, this causes every message sent from this trigger to fail in my Lambda function and not be processed. Manually re-creating the event source without this feature allows the message to be consumed normally by my Lambda function.
Example Config
constructs:
my-queue:
type: queue
...
reportBatchItemFailures: false
worker:
handler: handler.handler
...
Implementation Idea
My suggestion is to allow this attribute to be added by default as it currently is, but allow a setting reportBatchItemFailures
to be passed to the plugin which allows it to be turned off. My work-around is to fork this repo and remove that setting.
For whatever reason, this causes every message sent from this trigger to fail in my Lambda function and not be processed.
Could you explain a bit more what you mean? This sounds like a bug
One reason I see for this behavior is that your function returns an invalid response that lambda considers a failure.
See what is considered invalid here https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#sqs-batchfailurereporting-conditions, maybe you fall into one of those cases?