Plaλ (pronounced 'plambda') is an approach to make unmodified Play apps work using AWS lambda. Judged from the outset as a comedic attempt destined to fail, the results are surprisingly good - though far from perfect and some way from usable. No matter - it's a great lesson in AWS lambda's limitations and how this technique could be applied to web frameworks in order to accelerate the move to serverless.
10. Baby steps
@sihil
class LambdaEntrypoint {
def run(event: JMap[String, Object], lambdaContext: Context): Unit = {
// Start a play application
val application: Application = {
val environment = Environment(new File("/"),
getClass.getClassLoader, Mode.Prod)
val context = ApplicationLoader.createContext(environment)
val loader = ApplicationLoader(context)
loader.load(context)
}
Play.start(application)
context.logger.log("AWS Lambda has started your Play application")
}
}