Amazon S3 to AWS Lambda to Amazon Bedrock using AWS SAM

Amazon S3 → AWS Lambda → Amazon Bedrock

This pattern uses AWS Lambda to generate vector embeddings from text data uploaded to S3 using Amazon Bedrock.

When a new object is uploaded to an S3 bucket, S3 detects the putObject event and invokes a Lambda function asynchronously, passing details about the uploaded object. The Lambda function then retrieves the object's content and sends it to the Amazon Bedrock Titan Embedding service, which generates vector embeddings representing the content's meaning and context.

< 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-js-sam

Deploy

sam buildsam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

sam delete

Created by:

Achintya Veer Singh

Achintya Veer Singh

Solutions Architect @ AWS

Follow on LinkedIn

Rohit Raj

Rohit Raj

Solutions Architect @ AWS

Follow on LinkedIn