Support of Return Batch Failure Item for SQS
Hi,
We are using Chalice and Terraform to deploy our application. We would like to use the the Return Batch Failure Item for message that fail during the process of an SQS event.
Actually, it work if we manually mark the checkbox in the Lambda SQS Trigger in the console and return the return {"batchItemFailures": {"itemIdentifier": record._event_dict.get('messageId')}}.
But since we are all automated and trying to avoid manual configuration, is there a plan to add the support of it in the @app.on_sqs_message parameters?
Or is there any way to automate it in other way but still using the annotation?
Thanks
I am looking for ways to enable this option via IaC as well
I am looking for ways to enable this option via IaC as well
I have automated this for our deployment environment like so:
- Add the ARN of SQS as CfnOutput
- Use
aws cloudformation describe-stacksto extract the outputs - Use
aws lambda list-event-source-mappingsto get the mappings for this SQS - Use
aws lambda update-event-source-mappingto update the config
Our CI/CD pipeline is using Terraform. Here is a workaround for automatic deployment in such case: https://github.com/aws/chalice/issues/2031#issuecomment-1900711686