Amazon Bedrock to Amazon DynamoDB

AWS Lambda → Amazon Bedrock → Amazon DynamoDB

Invoke Amazon Bedrock with AWS Lambda and store results in Amazon DynamoDB.

This pattern demonstrates processing queries with AWS Lambda and Amazon Bedrock's Claude 3 Haiku model then storing the results in Amazon DynamoDB.
The Lambda function is invoked with an event containing a query, which is processed using Bedrock. Both the query and the response are stored in a DynamoDB table.
This patterns forms the basis of persisting the conversation of user and model in a NoSQL database
This pattern deploys one Lambda function, one DynamoDB table, and the necessary IAM roles and permissions.

< 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-bedrock-dynamodb-sam

Deploy

sam buildsam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: sam delete
Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus"

Created by:

Svvs Koudinya

Svvs Koudinya

I am an Solutions Architect with AWS. I enjoy working with customers all across the Industries and help them to build efficient and scalable solutions on AWS.

Follow on LinkedIn

Monalisa Nath

Monalisa Nath

I am a Solutions Architect at AWS and help our strategic customers build and operate their key workloads on AWS.

Follow on LinkedIn