Simple Serverless Web Applications

Osiris is a library for building and deploying serverless web applications on Amazon Web Services, with a focus on simplicity and ease of use.

An application built with Osiris is deployed to AWS as a Lambda function and an API Gateway API. Configuration is generated for CloudFormation to define the application resources.

Osiris runs on the JVM and provides a DSL written in Kotlin. It is open source and is released under the Apache 2.0 license.

The simplest application you can build with Osiris looks something like this:

val api = api<ComponentsProvider> {
    get("/helloworld") { req ->
        "hello, world!"



Osiris provides a familiar DSL for defining HTTP endpoints, inspired by libraries like Sinatra and SparkJava.


Osiris provides plugins for Maven and Gradle that:

  • Create the initial project
  • Build the project
  • Generate the AWS configuration
  • Deploy the application to AWS

Local Server

Osiris includes a local server so applications can be developed and debugged without being deployed to AWS.

Osiris aims to make building and deploying a serverless web application as easy as building an application that runs in a traditional server.

AWS Lambda and API Gateway are an excellent platform for hosting web applications. They allow applications to handle high load without needing to provision server capacity in advance. They also scale down to zero when not required, making it viable to build applications whose cost couldn't be justified running on a dedicated server.

Unfortunately they also have a steep learning curve. API Gateway in particular requires a deep understanding and a great deal of configuration to achieve something that would normally be possible in a few lines of code.

The Osiris DSL allows a REST API to be defined in a simple, familiar way, and the Maven or Gradle plugin generates all the configuration needed to define the application in AWS.

The plugin also builds the application artifacts, uploads them to AWS and deploys the application in a single operation.

Osiris allows you to go from an empty directory to a deployed application in two Maven commands.