Local AWS Lambda testing: generate realistic trigger events and invoke handlers with mocked AWS services
Project description
lambdaforge
Local AWS Lambda testing made simple.
Generate realistic trigger event payloads and invoke your Python Lambda handler locally — with optional in-memory AWS service mocking via moto. No Docker. No SAM. No LocalStack.
Install
pip install lambdaforge-local
Quick Start
# 1. Generate a realistic event file for your trigger type
lambdaforge generate --trigger apigateway
# 2. Edit event.json with your actual path, body, etc.
# 3. Invoke your handler
lambdaforge invoke --handler src/handler.py::lambda_handler
# With mocked DynamoDB and S3 (boto3 calls intercepted, no real AWS)
lambdaforge invoke --handler src/handler.py::lambda_handler --mock dynamodb,s3
Supported Triggers
| Trigger | CLI value |
|---|---|
| API Gateway REST proxy | apigateway |
| SQS | sqs |
| S3 object created | s3 |
| SNS | sns |
| EventBridge / scheduled | eventbridge |
Supported Mock Services
Pass any combination via --mock: dynamodb, s3, ssm, sqs, sns
Note: Mocked services start empty. Pre-populate state in your handler behind an env var guard if needed. Seed file support is planned for v2.
How It Works
generate writes a complete AWS event JSON to a file (default: event.json). User-supplied fields are marked with "<placeholder>" strings.
invoke loads your handler via Python's import system, builds a mock LambdaContext, optionally activates moto's mock_aws() context, and calls handler(event, context). Output is formatted with rich.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lambdaforge_local-0.1.1.tar.gz.
File metadata
- Download URL: lambdaforge_local-0.1.1.tar.gz
- Upload date:
- Size: 26.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea6768e2473c2aa82f2938032cce38654dfe5404828e5d1d086a55721af786d4
|
|
| MD5 |
29d119cd08578e3ff17ad4f0a91e69e3
|
|
| BLAKE2b-256 |
c97c66c7c7921cb01af3297db5918500a184d45dc18348e63359c69a1be1a751
|
File details
Details for the file lambdaforge_local-0.1.1-py3-none-any.whl.
File metadata
- Download URL: lambdaforge_local-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1feccbd85bf3e72a3f4378561716de7ef95f15aa15cd359ecc1cf58cd42d4ebe
|
|
| MD5 |
1093e9f2e5e9bea1148baf8d3075f4f1
|
|
| BLAKE2b-256 |
515a78c1fd3d3e197c09b6b5dbb0444701fb87597ead19d99b8e5ea021d3ed3a
|