Rust Lambda Function to Process Input Data and Return Output Data
Project Link: Click this link
This project demonstrates a simple AWS Lambda function written in Rust using the lambda_runtime
crate.
Overview
The Lambda function takes an input data structure, processes it, and returns an output data structure.
- Input Data Structure:
InputData
- Output Data Structure:
OutputData
Screenshots
Deploy to AWS Lambda
Note: Due to billing and security reasons, only IAM user can access the above link. You may need to deploy the lambda function to your AWS account manually.
Requirements
- Rust (https://www.rust-lang.org/)
cargo-lambda
(https://www.cargo-lambda.info/guide/getting-started.html)- AWS CLI configured with appropriate permissions
Setup
-
Clone this repository:
git clone [email protected]:Yer1k/cargo_lambda.git
-
Navigate to the project directory:
cd lambda_function
-
Build the Lambda function:
cargo lambda build --release
-
Deploy the Lambda function to AWS:
cargo lambda deploy --region <AWS_REGION>
Replace
<AWS_REGION>
with your desired AWS region.
Usage
Once deployed, you can invoke the Lambda function using the AWS Management Console, AWS CLI, or AWS SDKs. The function expects input data in the format specified by the InputData
struct and returns output data in the format specified by the OutputData
struct.
Testing
You can test the Lambda function locally using the cargo-lambda
tool or by setting up a local development environment. For testing purposes, you can modify the handler
function in src/main.rs
to simulate different input scenarios and observe the output.
License
This project is licensed under the MIT License - see the LICENSE file for details.