You've spun yourself in knots. Next time ask chatgpt https://chatgpt.com/share/68768710-1e44-800a-9737-29772153b3....
I would suggest taking this down and hope it silently goes away. If you're a fractional CTO for a startup that spent a week on this, then spent god knows how long to rearchitect for Azure based on this... The startup might find this actionable.
---
EDIT:
After looking into this more, it seems the `context` passed to the Lambda entrypoint has a `callbackWaitsForEmptyEventLoop` parameter, which defaults to True. https://docs.aws.amazon.com/lambda/latest/dg/nodejs-context.....
Did you set this to False somewhere?