-
Notifications
You must be signed in to change notification settings - Fork 51
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
feat: bedrock agent custom resources and constructs #207
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #207 +/- ##
==========================================
+ Coverage 93.82% 95.07% +1.25%
==========================================
Files 19 30 +11
Lines 5766 7679 +1913
Branches 152 201 +49
==========================================
+ Hits 5410 7301 +1891
- Misses 356 378 +22 ☔ View full report in Codecov by Sentry. |
Might be best to divide this into smaller PRs, isolating 1 construct at a time. PR is showing +7k changes with other changes suggested on top of constructs, e.g. a migration from a v1 physical name funct to v2 |
Would that really be much better than reviewing everything in this PR? It's almost all new code in new files. The constructs could be evaluated in the following order to understand dependencies:
The only changed file is utils. I tried adapting |
Thank you @jstrunk, awesome contribution ! I will review today |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please describe why the *.ts.snap
files are committed or remove.
They're included as a simple form of integration test to confirm that the different constructs work together. If we don't see value in using snapshot tests, then I don't have a problem removing them. We should also add that guidance to CONTRIBUTING to advise not to use snapshot testing. |
|
Overall looks great, awesome contribution, thank you again @jstrunk ! Questions/thoughts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- move files as discussed in previous comment to match existing folder structure
- add documentation
These aren't patterns. These are L2 constructs for Bedrock Agents and OpenSearch as a Vector store. Per @dineshSajwan in #169 (comment) , it makes since to create a new directory called I think it makes sense to put the OpenSearch ones under cdk-lib as well. |
Per our call
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great contribution.
Summary of my comments:
- you have created few utilities functions that might have broader use than your constructs. Consider contributing them to the CDK
- add the possibility to pass existing OS Index resource to the KnowledgeBase construct
- us
knowledgeBaseId
instead ofkbId
. Same for...Arn
lambda/opensearch-serverless-custom-resources/custom_resources/__init__.py
Show resolved
Hide resolved
lambda/opensearch-serverless-custom-resources/custom_resources/__init__.py
Show resolved
Hide resolved
Head branch was pushed to by a user without write access
b5c8c39
to
fa82023
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this contribution. Small changes are easier to test, review, and approve. Please consider breaking up future PRs.
Fixes #169
This PR implements custom resources and constructs for Bedrock Agents and Knowledge Bases and OpenSearch Serverless vector indices.
Test it with https://github.com/jstrunk/generative-ai-cdk-constructs-samples/tree/bedrock-agent/samples/bedrock-agent
New constructs:
OpenSearch Serverless
Bedrock
Missing features
It includes a new function to generate physical names and deprecates the old one to avoid breaking stacks.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.