Skip to main content
Version: 2.x

Introduction to ZIO Lambda

ZIO Lambda is a ZIO-based AWS Custom Runtime compatible with GraalVM Native Image. It lets you write an AWS Lambda function as a ZIO program, with typed JSON events in and typed JSON responses out, and deploy it as a GraalVM native binary.

Development CI Badge Sonatype Releases Sonatype Snapshots javadoc ZIO Lambda

Installationโ€‹

ZIO Lambda is published for Scala 2.12, 2.13 and 3, and runs on the JVM, including as a GraalVM native image. Add the core module to your build.sbt:

libraryDependencies ++= Seq(
// The runtime: ZLambdaRunner, Context. JVM only. It brings zio-json with it
"dev.zio" %% "zio-lambda" % "1.0.7"
)

Modulesโ€‹

The event and response modules are optional. Add them when you want ready-made Scala types for AWS events and responses:

libraryDependencies ++= Seq(
// Scala types for the events that AWS services send to Lambda. JVM only
"dev.zio" %% "zio-lambda-event" % "1.0.7",

// Scala types for the responses that some AWS integrations expect. JVM only
"dev.zio" %% "zio-lambda-response" % "1.0.7"
)

See Event and Response Types for what the two modules contain.

Where to Go Nextโ€‹

  1. Getting Started shows how to write a handler with custom event and response types.
  2. The Reference section describes ZLambdaRunner, Context and every event and response type.
  3. Build an HTTP API walks through an HTTP API on API Gateway step by step.
  4. The how-to guides cover testing a handler locally and deploying it to AWS Lambda.

ZIO Chat

Hi there! ๐Ÿ‘‹ I'm ZIO Chat, your friendly neighborhood ZIO expert. I'm here to help you navigate the world of ZIO. Whether you're a seasoned pro or just starting out, fire away with your ZIO questions. I will hit you back with the best insights I've got. Let's dive into the world of ZIO together!