I imagine you could accomplish that via a Lambda custom runtime. The example function given here is a shell script: https://docs.aws.amazon.com/lambda/latest/dg/runtimes-walkth...
Back in my day we threw up PHP scripts using apache and called it a day...
But seriously custom runtimes are real bastards to get working.
Horrifying sure, but I am curious what is the motivation here. We use more lambdas and for more things than are generally considered kosher... one more couldn't hurt.
But I have to confess I opened this article half hoping it would be about Lambda support for bare bash scripts. Horrifying, yes, but at the same time...