Amazon S3 to AWS Lambda to Amazon Bedrock

Amazon S3 → AWS Lambda → Amazon Bedrock

Generate vector embeddings for the documents uploaded to S3

This pattern creates an S3 bucket with event notification enabled to invoke a function when there is a new object. The Lambda function is integrated with Bedrock Titan Embedding Model.
When there is a new object in the S3 bucket, the S3 put request creates an event to the Lambda function that extracts the content from the object and calls Bedrock Titan Embedding Model.
The function returns the vector embeddings of the document as JSON.

< 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/s3-lambda-bedrock

Deploy

sam buildsam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: sam delete.

Additional resources

Created by:

Abdul Waheed

Abdul Waheed

Solutions Architect @ AWS