Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New serverless pattern - EventBridge-Bedrock-S3-AOSS #2381

Conversation

rajavaid77
Copy link
Contributor

@rajavaid77 rajavaid77 commented Jul 15, 2024

Issue #, if available: 2382

Description of changes:

Added a serverless pattern to automate syncing an S3 data source sources to knowledge base for Amazon Bedrock using EventBridge scheduler. An EventBridge schedule is configured to run at a regular rate (default of 5mins). The EventBridge uses the universal target to trigger the StartIngestionJob API on the Amazon Bedrock Agent service. The StartIngestionJob operation in turn would sync the data source so that it is re-indexed to the knowledge base. Syncing is incremental, so Amazon Bedrock only processes added, modified, or deleted documents since the last sync.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Contributor

@pputhran pputhran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running into an error on deployment.
BedrockServiceRoleAccessPolicyStack and OpenSearchServerlessStack got deployed successfully.

BedrockKnowledgebaseStack is failing with the folliwing error

Resource handler returned message: "bedrock-rag-jcrob6 already exists (Service: S3, Status Code: 0, Request ID: null)" (RequestToken: f84ae2ac-9ac4-ad30-44c1-4a2c0a9bb599, HandlerErrorCode: AlreadyExists)

eventbridge-bedrock-s3-aoss/example-pattern.json Outdated Show resolved Hide resolved
s3-lambda-bedrock-aoss/README.md Outdated Show resolved Hide resolved
apigw-lambda-bedrock-s3-cdk-python/README.md Outdated Show resolved Hide resolved
eventbridge-bedrock-s3-aoss/template.yaml Outdated Show resolved Hide resolved
```
1. From the command line, use AWS CDK to deploy the AWS resources.
```
cdk deploy --all
Copy link
Contributor

@pputhran pputhran Jul 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running into an error on deployment.
BedrockServiceRoleAccessPolicyStack and OpenSearchServerlessStack got deployed successfully.

BedrockKnowledgebaseStack is failing with the folliwing error

KBDataSourceS3Bucket

Resource handler returned message: "bedrock-rag-jcrob6 already exists (Service: S3, Status Code: 0, Request ID: null)" (RequestToken: f84ae2ac-9ac4-ad30-44c1-4a2c0a9bb599, HandlerErrorCode: AlreadyExists)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed the errors.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately ran into another error with the new changes with BedrockKBStack

Resource handler returned message: "Supplied Policy document is breaching Cloudwatch Logs policy length limit. (Service: CloudWatchLogs, Status Code: 400, Request ID: 39ff2d15-9eca-423f-bf0c-bf61d8d5bd4e)" (RequestToken: 972f5e1f-da40-7437-4d9b-5d6c5f5fea2e, HandlerErrorCode: AccessDenied)

@rajavaid77 rajavaid77 force-pushed the rajavaid-feature-eventbridge-bedrock-s3-aoss branch from 8c78e40 to b35c787 Compare July 18, 2024 23:47
Copy link
Contributor

@pputhran pputhran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately ran into another error with the new changes with BedrockKBStack

```
1. From the command line, use AWS CDK to deploy the AWS resources.
```
cdk deploy --all
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately ran into another error with the new changes with BedrockKBStack

Resource handler returned message: "Supplied Policy document is breaching Cloudwatch Logs policy length limit. (Service: CloudWatchLogs, Status Code: 400, Request ID: 39ff2d15-9eca-423f-bf0c-bf61d8d5bd4e)" (RequestToken: 972f5e1f-da40-7437-4d9b-5d6c5f5fea2e, HandlerErrorCode: AccessDenied)

@rajavaid77 rajavaid77 requested a review from pputhran July 30, 2024 09:32
@rajavaid77
Copy link
Contributor Author

Unfortunately ran into another error with the new changes with BedrockKBStack

This appears to be specific to a situation in the AWS account used for deploying the stack. Fixed by adding an explicitly policy that should solve the issue around limits.

@pputhran pputhran removed their request for review September 10, 2024 19:45
@rajavaid77 rajavaid77 closed this Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants