jordaneremieff / mangum

AWS Lambda support for ASGI applications
https://mangum.io/
MIT License
1.67k stars 119 forks source link

How To: How to form SQS event to look like REST body as if coming from API Gateway #298

Open MartyBolton opened 1 year ago

MartyBolton commented 1 year ago

Hi, I am reading about Mangum adapter but wondering if I already have a API Gateway and Lamdba using REST, and I want to introduce an SQS queue that can trigger same or other lambda but i want to use Mangum API I already built - can I form an SQS event that looks like a REST Post method and have that handled by the default handler? Or do I have to intercept the event as in your documentation on Adapters. I want SQS queue to invoke FAST API the same was as API Gateway. Maybe overkill? thank you! Marty

nitsujri commented 9 months ago

Is there a specific reason you must go through the "front door"?

If you absolutely need to, I would recommend:

SQS -> Special Lambda Worker -> requests.get(...)