- Newest
- Most votes
- Most comments
You can run multiple Lambda functions locally using a few different approaches:
- Using AWS SAM (Serverless Application Model):
- The
sam local invokecommand allows you to invoke Lambda functions locally - You can create sample event payloads to test your functions with different triggers
- For multiple functions, you can invoke each one separately with their specific event files
- Using AWS Application Builder in your IDE (like VS Code):
- Navigate to your function and select "Local Invoke and Debug Configuration"
- Configure how to invoke the function locally and set up debug configurations
- Select or create sample event payloads that simulate different triggers
- Invoke each function with its appropriate event
- For distributed applications with multiple Lambdas:
- Consider using distributed tracing tools like OpenTelemetry during local development
- This helps understand the interactions between multiple Lambda functions
- It's particularly useful when you have many Lambdas (e.g., 50-60) working together
When testing locally with multiple triggers, you'll need to create separate event JSON files that simulate each trigger type (S3, DynamoDB, API Gateway, etc.). This approach allows you to test each Lambda function with its expected trigger payload.
For complex scenarios where Lambdas interact with each other, you might need to orchestrate the local invocations manually or use more advanced local testing strategies.
Sources
Locally invoke Lambda functions with AWS SAM - AWS Serverless Application Model
Introducing an enhanced local IDE experience for AWS Lambda developers | AWS Compute Blog
Community | The .NET on AWS Show, Featuring Martin Thwaites!
I was thinking about multiples lambdas running locally and communicating each other. Regards
answered 7 months ago
Relevant content
asked 3 years ago
asked 6 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
