Handling async AWS Lambda functions with Amazon S3 when payload size is large

SendPayloadFunction → payload-S3-bucket → AsynchronousFunction

Lambda invokes another Lambda asynchronously. If payload exceeds the quota, it is saved to S3 which triggers the second Lambda.

This sample project demonstrates how to use a Lambda function to invoke another Lambda function asynchronously.
The AWS SAM template provided deploys two Lambda functions. First Lambda function invokes second Lambda function asynchronously.
When the payload size exceeds the invocation payload size quota, then payload is saved to an Amazon S3 bucket.
S3 bucket `s3:ObjectCreated` event triggers second Lambda function.
Using Lambda function asynchronous invocation saves time and cost.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/lambda-s3-async-lambda

Deploy

sam deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: sam delete.

Created by:

Seoyeon Park

Seoyeon Park

Seoyeon is an Associate Application Developer at AWS Professional Services based in Seoul.