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
Idawscc.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.

For more information, see AWS::Bedrock::KnowledgeBase.

Methods

NameResourceAccessible byRequired Params
create_resourceknowledge_basesINSERTKnowledgeBaseConfiguration, Name, RoleArn, region
delete_resourceknowledge_basesDELETEIdentifier, region
update_resourceknowledge_basesUPDATEIdentifier, PatchDocument, region
list_resourcesknowledge_bases_list_onlySELECTregion
get_resourceknowledge_basesSELECTIdentifier, region

SELECT examples

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 awscc.bedrock.knowledge_bases
WHERE
region = '{{ region }}' AND
Identifier = '{{ knowledge_base_id }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.bedrock.knowledge_bases (
KnowledgeBaseConfiguration,
Name,
RoleArn,
region
)
SELECT
'{{ knowledge_base_configuration }}',
'{{ name }}',
'{{ role_arn }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

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

/*+ update */
UPDATE awscc.bedrock.knowledge_bases
SET PatchDocument = string('{{ {
"Description": description,
"Name": name,
"RoleArn": role_arn,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ knowledge_base_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.bedrock.knowledge_bases
WHERE
Identifier = '{{ knowledge_base_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

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

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