Coder Social home page Coder Social logo

discretetom / aws-lambda-runtime-proxy Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 137 KB

A helper lib to customize the communication between the lambda handler process and the lambda runtime api.

License: MIT License

Rust 98.30% JavaScript 1.23% Shell 0.47%
aws aws-lambda aws-lambda-runtime proxy rust

aws-lambda-runtime-proxy's Introduction

AWS Lambda Runtime Proxy

Crates.io Version license

overview

A helper lib to customize the communication between the lambda handler process and the lambda runtime api.

Usage

Installation

Add the following to the dependencies in your Cargo.toml:

aws-lambda-runtime-proxy = "0.2"

or run:

cargo add aws-lambda-runtime-proxy

A real world case: AWS Lambda Post Runner.

FAQ

What's the Purpose of this Project?

  • Override reserved environment variables like AWS_LAMBDA_RUNTIME_API.
  • Capture or modify the output of the handler function, including the stdout, stderr, or the return value.
  • Add additional command line arguments to the handler process.

How Does This Work?

proxy

This library will do the following:

  • Start an HTTP server to act as the fake AWS Lambda runtime API server, accepting requests from the handler process.
  • Spawn the handler process as a child process, with the environment variables modified to point to the fake AWS Lambda runtime API server.
  • (Optional) Forward requests from the handler process to the real AWS Lambda runtime API server.

Based on this setup, you can write your own logic to process the requests and responses between the handler process and the AWS Lambda runtime API.

Performance

See benchmark. TLDR: the proxy will introduce less than 2ms latency, which is acceptable for most use cases.

aws-lambda-runtime-proxy's People

Contributors

discretetom avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.