- Newest
- Most votes
- Most comments
Hello.
CloudFormation itself supports managed knowledge bases.
You can create one as follows:
https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/TemplateReference/aws-properties-bedrock-knowledgebase-managedknowledgebaseconfiguration.html
BedrockKnowledgeBase:
Type: AWS::Bedrock::KnowledgeBase
Properties:
Name: test-kb
Description: test kb
RoleArn: !GetAtt IAMRole.Arn
KnowledgeBaseConfiguration:
Type: MANAGED
DataSource:
Type: AWS::Bedrock::DataSource
Properties:
Name: test-datasource
KnowledgeBaseId: !GetAtt BedrockKnowledgeBase.KnowledgeBaseId
DataSourceConfiguration:
Type: MANAGED_KNOWLEDGE_BASE_CONNECTOR
ManagedKnowledgeBaseConnectorConfiguration:
ConnectorParameters:
type: S3
version: "1"
connectionConfiguration:
bucketName: !Ref DataSourceBucket
bucketOwnerAccountId: !Ref AWS::AccountId
If you look at the following documentation, you will see that properties for managed knowledge bases are available, so it may be possible to execute this.
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrock.CfnKnowledgeBase.ManagedKnowledgeBaseConfigurationProperty.html
CloudFormation support for Amazon Bedrock Knowledge Bases is already available. CloudFormation support for both Amazon Bedrock Agents and Amazon Bedrock Knowledge Bases was introduced on April 5, 2024. This means you can now set up and manage your Amazon Bedrock Knowledge Bases resources using CloudFormation.
Since CloudFormation support is available, AWS CDK support is also available, as CDK generates CloudFormation templates. The CDK provides constructs for creating managed knowledge bases, including the CfnKnowledgeBase construct which allows you to configure various aspects such as the knowledge base configuration, storage configuration, and embedding models. You can use CDK to create knowledge bases with different storage backends, including S3-backed vector stores with OpenSearch Serverless.
The CDK constructs include properties for configuring managed knowledge base settings, such as ManagedKnowledgeBaseConfigurationProperty for embedding model configuration and ManagedKnowledgeBaseConnectorConfigurationProperty for connector data sources. These are available across multiple programming languages including Python, TypeScript, Java, Go, and .NET.
If you're experiencing issues finding or using these resources, ensure you're using the latest version of the AWS CDK, as the support has been available since early April 2024.
Sources
Document history for the Amazon Bedrock User Guide - Amazon Bedrock
interface ManagedKnowledgeBaseConfigurationProperty · AWS CDK
Use the AWS CDK to create an Amazon Bedrock agent | AWS re:Post
interface ManagedKnowledgeBaseConnectorConfigurationProperty · AWS CDK
answered 14 days ago
Relevant content
asked 9 months ago
asked 9 months ago
