holy-lambda 2022-06-03

I have a lambda with a Babashka runtime but it’s failing at runtime:

1: (ns example.core
2022-06-03T10:39:54.221+01:00	2: (:gen-class)
2022-06-03T10:39:54.221+01:00	3: (:require
2022-06-03T10:39:54.221+01:00	^--- Could not find namespace: fierycod.holy-lambda.response.
2022-06-03T10:39:54.221+01:00	4: [babashka.pods :as pods]
2022-06-03T10:39:54.221+01:00	5: [fierycod.holy-lambda.response :as hr]
2022-06-03T10:39:54.221+01:00	6: [fierycod.holy-lambda.core :as h]
2022-06-03T10:39:54.221+01:00	7: ;; shipped with Babashka, hence no dependency in deps.edn
2022-06-03T10:39:54.221+01:00	8: [hiccup.core :as hiccup]))

the relevant bit in my template.yml

Resources:
  BabashkaDepsLayer:
    Type: AWS::Serverless::LayerVersion
    Properties:
      LayerName: BabashkaDepsLayer
      ContentUri: ./.holy-lambda/bb-clj-deps

  BabashkaPodsLayer:
    Type: AWS::Serverless::LayerVersion
    Properties:
      LayerName: BabashkaPodsLayer
      Description: Shared pods for stack.
      ContentUri: ./.holy-lambda/pods
      CompatibleRuntimes:
        - provided.al2

ExampleLambdaFunction:
    Type: AWS::Serverless::Function
    Properties:
      FunctionName: "ExampleLambda"
      Runtime: provided.al2
      Architectures:
        - arm64
      Handler: example.core.ExampleLambda
      CodeUri: src
      Timeout: 40
      MemorySize: 2048
      Events:
        GetEvent:
          Type: HttpApi
          Properties:
            ApiId: !Ref ExampleHttpApi
            Path: /my-path/{id}
            Method: GET
      Layers:
        - !Sub "arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:layer:holy-lambda-babashka-runtime-arm64:1"
        - !Ref BabashkaDepsLayer
        - !Ref BabashkaPodsLayer

I’d deployed the ARM runtime to my account via this link:

I’m using the HL layer, so it’s strange that the namespace fierycod.holy-lambda.response is reported as something that cannot be found.

This is using HL 0.6.6 with latest tasks

The latest BB runtimes are not shipping HL directly.

You have to include the dependency in bb.edn 🙂

what do I need to include?

HL dependency

Hmmm - I already have it:

:deps    {org.clojure/clojure                  {:mvn/version "1.11.1"}
           io.github.FieryCod/holy-lambda       {:mvn/version "0.6.6"}
           com.github.clj-easy/graal-build-time {:mvn/version "0.1.4"}}

I’ll try without the graal-build-time

I assume Clojure 1.11.1 is ok?

Do you have it in bb.edn?

Nothing explicit for HL in bb.deps

is there a specific pod I need to add?

You need to place io.github.FieryCod/holy-lambda {:mvn/version "0.6.6"} in bb.edn deps

This is because for babashka runtime the BB is handling deps not HL tasks

> This is because for babashka runtime the BB is handling deps not HL. Which is something I always forget!

Perfect - that worked. Thank you @karol.wojcik

You are very welcome 🙂