Fork me on GitHub
#aws-lambda
<
2024-06-18
Alonso Suarez05:06:35

Hola blob-wave I've been toying with this idea of using Infra as Github Actions :thinking_face: nbb is pretty easy to use, with Github Actions it's also easy to host πŸ™Œ For example:

# .github/workflows/on-push-main.yaml
...
      - uses: alonch/actions-aws-backend-setup@main
        with: 
          instance: demo
      - uses: alonch/actions-aws-function-clojurescript@main
        id: function
        with: 
          name: actions-aws-function-clojurescript-sample
          entrypoint-file: index.cljs
          entrypoint-function: handler
          artifacts: src
          allow-public-access: true
; src/index.cljs
(ns index)

(defn handler [event _ctx]
  (js/console.log event)
  (js/Promise.resolve (clj->js {:statusCode 200
                                :headers {"Content-Type" "*/*"}
                                :body "hello ClojureScript"})))
; export handler
#js {:handler handler}
That's all πŸ™‚ the action will provision the Lambda with URL in less than a minute 🏎️ full sample https://github.com/alonch/actions-aws-function-clojurescript-sample literally those 2 files πŸ˜…

πŸŽ‰ 1
πŸ‘ 1
Stephan Renatus07:06:07

…and the action is done in TF. πŸ’‘ nicely done, thanks for sharing

πŸ™Œ 1