The lambda-chaos-extension allows you to inject faults into Lambda functions without modifying the function code.

Overview

Actions Status Actions Status

Chaos Extension - Seamless, Universal & Lightning-Fast

A futuristic neon lit chaos

The lambda-chaos-extension allows you to inject faults into Lambda functions without modifying the function code. Unlike previous chaos implementations that required tight coupling with the Lambda runtime, this extension is runtime-agnostic. It can operate with any runtime that utilizes Amazon Linux 2. Currently, the supported runtimes include:

  • Node.js 18
  • Node.js 16
  • Node.js 14
  • Python 3.10
  • Python 3.9
  • Python 3.8
  • Java 17
  • Java 11
  • Java 8
  • .NET 6
  • Ruby 3.2
  • Ruby 2.7
  • provided.al2

The extension can inject two types of faults based on the configuration:

  1. Induce latency.
  2. Modify function response.

Main Benefits

  • 🔄 Seamless Integration: Requires no code changes. Simply plug and play!
  • 🌐 Universal Compatibility: Completely agnostic to the Lambda runtime. Flexibility at its finest!
  • 🚀 Blazing Fast: Written in Rust for peak performance. Zero impact on your Lambda's behavior when turned off, ensuring smooth operations.

Configuration

Control the extension via environment variables:

Latency Fault

  • CHAOS_EXTENSION__LAMBDA__ENABLE_LATENCY - Enables latency fault injection. Accepts true or false. Default is false.
  • CHAOS_EXTENSION__LAMBDA__LATENCY_VALUE - Specifies the latency duration (in seconds) to introduce. Default is 900 seconds.
  • CHAOS_EXTENSION__LAMBDA__LATENCY_PROBABILITY - A probability value between 0 and 1 that determines the likelihood of fault injection. Default is 0.9.

Response Fault

  • CHAOS_EXTENSION__RESPONSE__ENABLE_CHANGE_RESPONSE_BODY - Enables response fault injection. Accepts true or false. Default is false.
  • CHAOS_EXTENSION__RESPONSE__DEFAULT_RESPONSE - Specifies the response to return in stringified JSON format. Default is:
{
    "statusCode": 500,
    "body": "hello, Chaos!!!"
}
  • CHAOS_EXTENSION__RESPONSE__CHANGE_RESPONSE_PROBABILITY - A probability value between 0 and 1 that determines the likelihood of fault injection. Default is 0.9.

Deployment

The chaos extension is publicly available as a layer. For the latest versions of the layer, refer to LAYERS.md. Incorporate the layer using the AWS Console, or your preferred IAC solution. Additionally, when incorporating the layer, remember to set an environment variable in your Lambda. This variable should be named AWS_LAMBDA_EXEC_WRAPPER and have /opt/bootstrap as its value.

See the AWS SAM usage example in the examples directory.

Running Locally

Unit testing

  • Utilize cargo for build and test management.
  • We employ just as a command runner.
  • Execute just gate to run all checks locally.

Deployment for testing

  • Use just deploy-debug-extension to deploy a debug version of the extension to us-east-1 using x86_64-unknown-linux-gnu as target.
  • Use just deploy-release-extension to deploy a release version of the extension to us-east-1 using x86_64-unknown-linux-gnu as target.

These just tasks also accept arguments to change the region and the target. Use just --list to get more details about the various deploy options.

Logs

  • Use RUST_LOG environment variable to change the extension log level. Default is error.

Contributing

For contribution guidelines, see our CONTRIBUTION page.

You might also like...
bevy_blender is a Bevy library that allows you to use assets created in Blender directly from the .blend file
bevy_blender is a Bevy library that allows you to use assets created in Blender directly from the .blend file

bevy_blender bevy_blender is a Bevy library that allows you to use assets created in Blender directly from the .blend file.

This crate allows you to safely initialize Dynamically Sized Types (DST) using only safe Rust.

This crate allows you to safely initialize Dynamically Sized Types (DST) using only safe Rust.

File Tree Fuzzer allows you to create a pseudo-random directory hierarchy filled with some number of files.

FTZZ File Tree Fuzzer allows you to create a pseudo-random directory hierarchy filled with some number of files. Installation $ cargo +nightly install

UnTeX is both a library and an executable that allows you to manipulate and understand TeX files.

UnTeX UnTeX is both a library and an executable that allows you to manipulate and understand TeX files. Usage Executable If you wish to use the execut

Twidge is a fresh approach to productivity. It integrates with your workflow and allows you to be your most productive self.

Twidge A productivity app which is an extension to your mind Twidge is a cross platform productivity app, powered by rust, tauri, prisma-client-rust T

You can name anonymous Future from async fn without dyn or Box!

rename-future You can name anonymous Future from async fn without dyn or Box! PLEASE READ THIS THIS PROJECT NOT YET WELL TESTED! DON'T USE THIS IN PRO

A Rust runtime for AWS Lambda

Rust Runtime for AWS Lambda This package makes it easy to run AWS Lambda Functions written in Rust. This workspace includes multiple crates: lambda-ru

The classic game Pong, written in lambda calculus, and a thin layer of Rust.

What? The good old game Pong, written in lambda calculus, and a thin layer of Rust. Why? I was bored. No, seriously, why? Everyone keeps saying that l

Examples of how to use Rust with Serverless Framework, Lambda, API Gateway v1 and v2, SQS, GraphQL, etc

Rust Serverless Examples All examples live in their own directories: project: there is nothing here, just a simple cargo new project_name with a custo

Owner
AWS CLI Tools
AWS CLI Tools
cargo-lambda is a Cargo subcommand to help you work with AWS Lambda.

cargo-lambda cargo-lambda is a Cargo subcommand to help you work with AWS Lambda. The new subcommand creates a basic Rust package from a well defined

null 184 Jan 5, 2023
📦 🚀 a smooth-talking smuggler of Rust HTTP functions into AWS lambda

lando ?? maintenance mode ahead ?? As of this announcement AWS not officialy supports Rust through this project. As mentioned below this projects goal

Doug Tangren 68 Dec 7, 2021
A tool to run web applications on AWS Lambda without changing code.

AWS Lambda Adapter A tool to run web applications on AWS Lambda without changing code. How does it work? AWS Lambda Adapter supports AWS Lambda functi

AWS Samples 321 Jan 2, 2023
A lambda extension to hot reload parameters from SSM Parameter Store, Secrets Manager, DynamoDB, AppConfig

A lambda extension to hot reload parameters from SSM Parameter Store, Secrets Manager, DynamoDB, AppConfig

Jake Scott 7 Jun 12, 2022
Rust Lambda Extension for any Runtime to preload SSM Parameters as 🔐 Secure Environment Variables!

?? Crypteia Rust Lambda Extension for any Runtime to preload SSM Parameters as Secure Environment Variables! Super fast and only performaned once duri

Custom Ink 34 Jan 7, 2023
Demonstration of flexible function calls in Rust with function overloading and optional arguments

Table of Contents Table of Contents flexible-fn-rs What is this trying to demo? How is the code structured? Named/Unnamed and Optional arguments Mecha

Tien Duc (TiDu) Nguyen 81 Nov 3, 2022
A simple workshop to learn how to write, test and deploy AWS Lambda functions using the Rust programming language

Rust Lambda Workshop Material to host a workshop on how to build and deploy Rust Lambda functions with AWS SAM and Cargo Lambda. Intro What is Serverl

Luciano Mammino 13 Mar 28, 2024
Searchbuddy is a browser extension that lets you chat with people that are searching for what you're searching for.

searchbuddy Make friends while searching! Searchbuddy is a browser extension that lets you chat with people that are searching for what you're searchi

Joseph Gerber 14 May 23, 2022
Tons of extension utility functions for Rust

LazyExt Tons of extension utility functions for Rust. English | 简体中文 Status Name Status Crate Documents Introduction lazyext-slice Alpha Thousands of

Al Liu 2 Dec 5, 2022
Peekable iterator that allows to peek the next N elements without consuming them.

peekaboo docs - crates.io Peekable iterator that allows to peek the next N elements without consuming them. It's no_std compatible by default. It also

annie 6 Nov 27, 2022