Skip to content

developerDebmeet/RustLambdaAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Lambda API

This repository contains a RESTful API implemented in Rust, which performs Create and Read operations for a "Course" entity. Each Course has three attributes:

  • course_id
  • course_name
  • course_category

Development

  1. Write/Edit Rust code in the src/bin folder

  2. Format the Rust code using :

    cargo fmt 
  3. Compile binaries of the Rust Code :

    cargo lambda build --release

Deployment

The infrastructure is provisioned using AWS CDK.

To deploy the API, follow these steps:

  1. Navigate to the deploy directory:
    cd deploy
  2. Install the required dependencies:
    npm install
  3. Generate the CloudFormation template using CDK:
    cdk synth
  4. Deploy the infrastructure using CDK:
    cdk deploy

This will create the necessary AWS resources, including:

  • Three Lambdas: getById, getByCategory, and create, each with its own Function URL.
  • One DynamoDB table: CourseTable.
  • One API Gateway with three endpoints: /get, /getByCategory, and /create.

The Lambdas are implemented using three separate Rust handlers, each compiled into a binary.


Prerequisites

Before developing/deploying the API, make sure you have the following prerequisites:

  • Rust compiler installed on your system.
  • AWS CDK installed.
  • Cargo Lambda installed.

References

Here are some references that I found helpful and also want to give credit to:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published