9.1 AWS Lambda

Support for AWS Lambda is implemented in the Micronaut AWS subproject.

Simple Functions with AWS Lambda

You can implement AWS Request Handlers with Micronaut that implement directly the AWS Lambda SDK API. See the documentation on Micronaut Request Handlers for more information.

Using the CLI

To create an AWS Lambda Function:

  1. $ mn create-function-app my-app features aws-lambda

Or with Micronaut Launch

  1. $ curl https://launch.micronaut.io/create/function/example\?features\=aws-lambda -o example.zip
  2. $ unzip example.zip -d example

HTTP Functions with AWS Lambda

You can deploy regular Micronaut applications that use @Controller etc. using Micronaut’s support for AWS API Gateway. See the documentation on AWS API Gateway Support for more information.

Using the CLI

To create an AWS API Gateway Proxy application:

  1. $ mn create-app my-app features aws-lambda

Or with Micronaut Launch

  1. $ curl https://launch.micronaut.io/example.zip\?features\=aws-lambda -o example.zip
  2. $ unzip example.zip -d example