knowledge_bases
Creates, updates, deletes or gets a knowledge_base
resource or lists knowledge_bases
in a region
Overview
Name | knowledge_bases |
Type | Resource |
Description | Definition of AWS::Bedrock::KnowledgeBase Resource Type |
Id | aws.bedrock.knowledge_bases |
Fields
Name | Datatype | Description |
---|---|---|
description | string | Description of the Resource. |
knowledge_base_configuration | object | Contains details about the embeddings model used for the knowledge base. |
knowledge_base_id | string | The unique identifier of the knowledge base. |
knowledge_base_arn | string | The ARN of the knowledge base. |
name | string | The name of the knowledge base. |
status | string | The status of a knowledge base. |
role_arn | string | The ARN of the IAM role with permissions to invoke API operations on the knowledge base. The ARN must begin with AmazonBedrockExecutionRoleForKnowledgeBase_ |
created_at | string | The time at which the knowledge base was created. |
failure_reasons | array | A list of reasons that the API operation on the knowledge base failed. |
updated_at | string | The time at which the knowledge base was last updated. |
storage_configuration | object | The vector store service in which the knowledge base is stored. |
tags | object | A map of tag keys and values |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | KnowledgeBaseConfiguration, Name, RoleArn, StorageConfiguration, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.bedrock.knowledge_bases (
KnowledgeBaseConfiguration,
Name,
RoleArn,
StorageConfiguration,
region
)
SELECT
'{{ KnowledgeBaseConfiguration }}',
'{{ Name }}',
'{{ RoleArn }}',
'{{ StorageConfiguration }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.bedrock.knowledge_bases (
Description,
KnowledgeBaseConfiguration,
Name,
RoleArn,
StorageConfiguration,
Tags,
region
)
SELECT
'{{ Description }}',
'{{ KnowledgeBaseConfiguration }}',
'{{ Name }}',
'{{ RoleArn }}',
'{{ StorageConfiguration }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: knowledge_base
props:
- name: Description
value: '{{ Description }}'
- name: KnowledgeBaseConfiguration
value:
Type: '{{ Type }}'
VectorKnowledgeBaseConfiguration:
EmbeddingModelArn: '{{ EmbeddingModelArn }}'
- name: Name
value: '{{ Name }}'
- name: RoleArn
value: '{{ RoleArn }}'
- name: StorageConfiguration
value:
Type: '{{ Type }}'
OpensearchServerlessConfiguration:
CollectionArn: '{{ CollectionArn }}'
VectorIndexName: '{{ VectorIndexName }}'
FieldMapping:
VectorField: '{{ VectorField }}'
TextField: '{{ TextField }}'
MetadataField: '{{ MetadataField }}'
PineconeConfiguration:
ConnectionString: '{{ ConnectionString }}'
CredentialsSecretArn: '{{ CredentialsSecretArn }}'
Namespace: '{{ Namespace }}'
FieldMapping:
TextField: '{{ TextField }}'
MetadataField: '{{ MetadataField }}'
RdsConfiguration:
ResourceArn: '{{ ResourceArn }}'
CredentialsSecretArn: '{{ CredentialsSecretArn }}'
DatabaseName: '{{ DatabaseName }}'
TableName: '{{ TableName }}'
FieldMapping:
PrimaryKeyField: '{{ PrimaryKeyField }}'
VectorField: '{{ VectorField }}'
TextField: '{{ TextField }}'
MetadataField: '{{ MetadataField }}'
- name: Tags
value: {}
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