Local AWS Lambda is a Python package that allows you to simulate AWS Lambda functions in your local development environment. This helps you test and debug your serverless applications without deploying them to AWS.
pip install local-aws-lambdafrom local_lambda import LocalLambda
def handler(event, context):
return {"message": "Hello from Local AWS Lambda!", "event": event}
lambda_runtime = LocalLambda(handler)
event = {"key": "value"}
print(lambda_runtime.invoke(event))You can customize the Lambda environment:
lambda_runtime = LocalLambda(handler, timeout=5, memory=256)timeout: Max execution time (in seconds)memory: Simulated memory allocation (in MB)
Contributions are welcome! 🚀
- Fork the repository
- Create a new branch (
git checkout -b feature-xyz) - Commit your changes (
git commit -m 'Add new feature') - Push to the branch (
git push origin feature-xyz) - Open a Pull Request
pytest tests/This project is licensed under the MIT License. See the LICENSE file for details.