ryands17 / rust-lambda

This is a CDK project that deploys a Rust function using the Rust runtime for Lambda. This creates a basic handler that logs some data sent as input

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rust runtime for Lambda with the CDK

Build Status

This is a CDK project that deploys a Rust function using the Rust runtime for Lambda. This creates a basic handler that logs some data sent as input.

Update: I have updated the Lambda function to use the newly introduced Graviton Processor for faster and cheaper workloads.

Prerequisites

  • Follow instructions mentioned in this post that explains how to build Rust functions for AWS Lambda.

Note: As we are using arm as the architecture, we need to add the following target:

rustup target add aarch64-unknown-linux-musl

And then follow the instructions as specified in this post for cross-compilation.

  • Create a cdk.context.json with the region key to specify the region of your choice (default is us-east-2).
{
  "region": "us-east-1"
}

The cdk.json file tells the CDK Toolkit how to execute your app.

Useful commands

  • yarn build compile typescript to js
  • yarn watch watch for changes and compile
  • yarn test perform the jest unit tests
  • yarn deploy deploy this stack to your default AWS account/region
  • yarn cdk diff compare deployed stack with current state
  • yarn cdk synth emits the synthesized CloudFormation template

About

This is a CDK project that deploys a Rust function using the Rust runtime for Lambda. This creates a basic handler that logs some data sent as input


Languages

Language:TypeScript 63.5%Language:Rust 18.9%Language:JavaScript 11.4%Language:Shell 6.2%