Skip to main content

knowledge_bases

Creates, updates, deletes or gets a knowledge_base resource or lists knowledge_bases in a region

Overview

Nameknowledge_bases
TypeResource
DescriptionDefinition of AWS::Bedrock::KnowledgeBase Resource Type
Idaws.bedrock.knowledge_bases

Fields

NameDatatypeDescription
descriptionstringDescription of the Resource.
knowledge_base_configurationobjectContains details about the embeddings model used for the knowledge base.
knowledge_base_idstringThe unique identifier of the knowledge base.
knowledge_base_arnstringThe ARN of the knowledge base.
namestringThe name of the knowledge base.
statusstringThe status of a knowledge base.
role_arnstringThe ARN of the IAM role with permissions to invoke API operations on the knowledge base. The ARN must begin with AmazonBedrockExecutionRoleForKnowledgeBase_
created_atstringThe time at which the knowledge base was created.
failure_reasonsarrayA list of reasons that the API operation on the knowledge base failed.
updated_atstringThe time at which the knowledge base was last updated.
storage_configurationobjectThe vector store service in which the knowledge base is stored.
tagsobjectA map of tag keys and values
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTKnowledgeBaseConfiguration, Name, RoleArn, StorageConfiguration, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all knowledge_bases in a region.

SELECT
region,
description,
knowledge_base_configuration,
knowledge_base_id,
knowledge_base_arn,
name,
status,
role_arn,
created_at,
failure_reasons,
updated_at,
storage_configuration,
tags
FROM aws.bedrock.knowledge_bases
WHERE region = 'us-east-1';

Gets all properties from an individual knowledge_base.

SELECT
region,
description,
knowledge_base_configuration,
knowledge_base_id,
knowledge_base_arn,
name,
status,
role_arn,
created_at,
failure_reasons,
updated_at,
storage_configuration,
tags
FROM aws.bedrock.knowledge_bases
WHERE region = 'us-east-1' AND data__Identifier = '<KnowledgeBaseId>';

INSERT example

Use the following StackQL query and manifest file to create a new knowledge_base resource, using stack-deploy.

/*+ create */
INSERT INTO aws.bedrock.knowledge_bases (
KnowledgeBaseConfiguration,
Name,
RoleArn,
StorageConfiguration,
region
)
SELECT
'{{ KnowledgeBaseConfiguration }}',
'{{ Name }}',
'{{ RoleArn }}',
'{{ StorageConfiguration }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.bedrock.knowledge_bases
WHERE data__Identifier = '<KnowledgeBaseId>'
AND region = 'us-east-1';

Permissions

To operate on the knowledge_bases resource, the following permissions are required:

Create

bedrock:CreateKnowledgeBase,
bedrock:GetKnowledgeBase,
bedrock:TagResource,
bedrock:ListTagsForResource,
bedrock:AssociateThirdPartyKnowledgeBase,
iam:PassRole

Read

bedrock:GetKnowledgeBase,
bedrock:ListTagsForResource

Update

bedrock:GetKnowledgeBase,
bedrock:UpdateKnowledgeBase,
bedrock:TagResource,
bedrock:UntagResource,
bedrock:ListTagsForResource,
bedrock:AssociateThirdPartyKnowledgeBase,
iam:PassRole

Delete

bedrock:GetKnowledgeBase,
bedrock:DeleteKnowledgeBase,
bedrock:ListDataSources

List

bedrock:ListKnowledgeBases