humdum
looking at https://github.com/StediInc/lambda, wondering if the generated jar would be fed to Graal native-image, and the library would generate a handler that works with the Lambda custom layer machinery...
I’ve been eyeballing this https://github.com/dainiusjocas/babashka-lambda-layer
Babashka can already do all kinds of things.. Just wondering if there was a lambda-layer that had babashka and AWS Command-Line Client.. That would cover a huge chunk of my lambda-needs. With native speed of course. 🙂
While having a Clojure-like language and dev-experience
I’ll look into this during holidays
ah, aws pod
that would be neat
pods as layers, hmm...
random google: https://github.com/aws-samples/aws-lambda-layer-awscli
didn't check if that is v2 cli though
so I haven't actually used lambda layers, but trying to remember if they were stackable and if so, a bb layer ontop of that would be neat...
hmm, I guess one can combine those two
0% cat handler.clj
(ns handler
(:require [clojure.java.shell :refer [sh]]))
(defn handle [event context]
(println (sh "/opt/awscli/aws" "sts" "get-caller-identity"))
(assoc event "babashka" "rocks even harder"))
0% make invoke
START RequestId: c4e9f43c-da50-49b4-84ba-1c49a3af8cb7 Version: $LATEST
{:exit 0, :out {
"Account": "096681235511",
"UserId": "AROARNAVGSQ35VYJVCMF7:babashka-lambda-example",
"Arn": "arn:aws:sts::096681235511:assumed-role/hello-role-qryue13v/babashka-lambda-example"
}
, :err }
laalaa
had forgotten about the SAR thing, installs layers via CloudFormation, just few clicks and you have babashka layer + awscli layer on your account, then copy ARNs to the babashka laer example Makefile and off you go 🙂
ah and bb has cheshire built in
0% cat handler.clj
(ns handler
(:require [clojure.java.shell :refer [sh]]
[cheshire.core :as json]))
(defn handle [event context]
(-> (sh "/opt/awscli/aws" "sts" "get-caller-identity")
:out
(json/parse-string true)
:UserId
(println "says hi!")))
0% make invoke
START RequestId: a170b304-b30a-42ea-a194-d423e94ea843 Version: $LATEST
AROARNAVGSQ35VYJVCMF7:babashka-lambda-example says hi!
Thanks for the idea valtteri! 🙂