Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fargito/rust-cdk-serverless

Repository files navigation

Serverless CDK Rust

A sample serverless app with Rust. I'm just experimenting stuff here so don't take anything at face value πŸ™ƒ.

Features

Current features:

  • βœ… Synchronous lambdas
  • βœ… Asynchronous lambdas
  • βœ… IAC unit tests
  • πŸ•‘ Lambda unit tests
  • βœ… Integration tests
  • βœ… Preview environments
  • ❌ Frontend

Overview

A very simple todo API to create, retrieve and delete todos. No front for now.

This is the architecture schema:

Todo API schema

Setup

Requirements

NodeJS: See official NodeJS install docs. The current NodeJS version is stored in .nvmrc. If you use nvm, you can run:

nvm use

Pnpm: dependency manager. Install with:

npm install -g pnpm

Rust toolchain: the Rust version is pinned in rust-toolchain.toml. Follow the official install instructions.

Cargo Lambda: in order to cross-compile Rust code to Lambda runtime. Follow install instructions.

Installation

Install NodeJS dependencies:

pnpm install

AWS Setup

In order to deploy, you will need an AWS account. If you don't have one, refer to the AWS documentation.

Then install the AWS CLI: install docs.

Setup a local profile:

aws configure --profile <your-profile-name>

Build & Deploy

Build Rust Lambda code

pnpm build

Run tests

pnpm test

Deploy

⚠ Warning: you may have to log in to your AWS profile again, depending on the setup method.

pnpm run deploy --profile <your-profile-name>

Run integration tests

pnpm test-integration

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /