A demonstration deployment of Haskell on AWS Lambda

https://lobste.rs/rss Hits: 1
Summary

#Lambda on Lambda: Serverless Haskell on AWS This repository is an end-to-end demonstration of how to build OCI container images for deployment to AWS Lambda, as well as OpenTofu workspaces to provision the AWS resources. The container images can also run under Docker for local testing. It is designed to be a "concept sketch" of what real infrastructure might look like: more than a ClickOps guide that won't scale, but not a full end-to-end deployment where it's too hard to understand all the moving parts. The idea is that you will be able to map each part of this demonstration onto your IaC and CI/CD processes in a way that makes sense for your tools. #Infrastructure overview To deploy a Lambda Function to AWS using containers, Lambda needs to told to reference a container image existing in an ECR repository. The cleanest separation I've found for this is to have two distinct workspaces connected by an image build/push step: The first workspace provides the ECR repositories only, and exports information about them as outputs for the second workspace to find. The second workspace imports the repository information from the first, and uses variables to be told which image tags to deploy. scripts/build-and-push-image is the image build/push step. It stands in for a CI/CD system by building the container images, pushing them to ECR, and updating a .tfvars.json file with the image tags. #Recommendations for deploying Haskell to AWS Lambda #Infrastructure Use the two-workspace pattern above to split your infrastructure-as-code from your code's build->push->deploy lifecycle; Avoid ECR Lifecycle Policies on your ECR Repositories, as they are not very expressive and risk deleting images that your Lambda Functions depend on. Regrettably, you will probably have to find a third-party tool to do this or implement garbage collection yourself. Push images using tags like YYYYMMDD-HHMM-abcdef12(-dirty)that includes date/time information as well as git SHA, so you know when the imag...

First seen: 2026-05-26 00:25

Last seen: 2026-05-26 00:25