Synchronize Amazon Bedrock Knowledge Bases

Amazon EventBridge Scheduler → AWS Step Functions → Amazon Bedrock

Create an automated workflow using Amazon EventBridge Scheduler and AWS Step Functions to synchronize Amazon Bedrock Knowledge Base.

This sample project demonstrates how to use EventBridge Scheduler and a Step Functions workflow to synchronize multiple Amazon Bedrock Knowledge Bases. The pattern automates the synchronization process using native service integrations, with a focus on handling multiple Knowledge Bases efficiently.
The Step Functions workflow is designed with nested Map states: the outer Map state processes multiple Knowledge Bases, while the inner Map state handles data sources for each Knowledge Base. Although designed for parallel processing, Amazon Bedrock data source synchronizations are sequential.
The workflow includes comprehensive status checking and result reporting for each sync operation. For each Knowledge Base, it retrieves all associated data sources, initiates sync operations sequentially, monitors progress, and aggregates results. The pattern deploys one EventBridge Scheduler schedule (running every 15 minutes), one Step Functions state machine with nested Map states, Amazon S3 buckets for data sources, and configures the necessary IAM roles and permissions for Bedrock Knowledge Base integration.

< 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/eventbridge-scheduled-stepfunction-bedrock-kb-sync

Deploy

cdk deploy --all


Testing

1. Upload sample documents to the created Amazon S3 bucket (kb-data-source-{account-id})
2. Wait for the next scheduled execution (15-minute intervals)
3. Monitor Step Functions execution in AWS Console
4. Verify sync status in Bedrock Knowledge Base console

Cleanup

1. Empty the S3 bucket
2. Delete the stack: cdk destroy --all

Created by:

Shankar Srinivasan

I am a Cloud Application Architect at AWS. I specialize in architecting and developing serverless, event-driven solutions on AWS.

Follow on LinkedIn