Fork me on GitHub
#portkey
<
2020-06-02
>
viesti14:06:22

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...

valtteri16:06:54

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. 🙂

valtteri16:06:36

While having a Clojure-like language and dev-experience

valtteri16:06:34

I’ll look into this during holidays

viesti18:06:30

ah, aws pod

viesti18:06:37

that would be neat

viesti18:06:07

pods as layers, hmm...

viesti18:06:57

didn't check if that is v2 cli though

viesti18:06:14

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...

viesti18:06:47

hmm, I guess one can combine those two

viesti19:06:43

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 }

viesti19:06:05

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 🙂

viesti19:06:52

ah and bb has cheshire built in

viesti19:06:17

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!

parrot 8
viesti19:06:01

Thanks for the idea valtteri! 🙂