Welcome @coyotesqrl!
Q: is there a technique/example of using bb as an AWS lambda handler?
I prefer the latter. I do all docker builds locally and that sounds simpler
would be simpler than setting up a Graal clj or java project. might be worth the perf tradeoff
Something like this? https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:209523798522:applications~babashka-runtime
New Docker runtime stuff should make it pretty easy to use bb in Lambda, no more layers etc
It boils down to doing a GET to get the args, and POST-ing the result: https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html
@lukaszkorecki Is that similar to this one? https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:209523798522:applications~babashka-runtime Or is it even easier now?
I notice he's doing some requests in this namespace similar to what you describe: https://github.com/dainiusjocas/babashka-lambda-layer/blob/ddec711dcb261eb1fa2798da45c060c0112b3887/src/lambda/impl/runtime.clj#L6
I think this is based on the "old" way of providing custom runtimes for Lambda, now you "just" build a container image and bundle whatever files and tools you need. The "layers" approach had some limitations in terms of size and what you can actually ship
but, that namespace does look handy - I think AWS just opened up all the nitty gritty of how Lambdas are put together by introducing Docker support
needless to say, I'll be trying it out as we need to replace a couple of Lambdas using the Java runtime
cool
exactly like that. I’ll need to update it to get the latest bb with aws pods but that’s great.
thanks!
that’s good to know. I’ll try pure docker as well
Make sure to force downloading the pod so it's already available in the docker image
it's downloaded to $HOME/.babashka so you'd have to copy that dir inside the image after you call load-pod