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::Wisdom::KnowledgeBase Resource Type |
| Id | awscc.wisdom.knowledge_bases |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
description | string | |
knowledge_base_arn | string | |
knowledge_base_id | string | |
knowledge_base_type | string | |
name | string | |
rendering_configuration | object | |
server_side_encryption_configuration | object | |
source_configuration | object | |
vector_ingestion_configuration | object | |
tags | array | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
knowledge_base_id | string | |
region | string | AWS region. |
For more information, see AWS::Wisdom::KnowledgeBase.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | knowledge_bases | INSERT | KnowledgeBaseType, Name, region |
delete_resource | knowledge_bases | DELETE | Identifier, region |
update_resource | knowledge_bases | UPDATE | Identifier, PatchDocument, region |
list_resources | knowledge_bases_list_only | SELECT | region |
get_resource | knowledge_bases | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual knowledge_base.
SELECT
region,
description,
knowledge_base_arn,
knowledge_base_id,
knowledge_base_type,
name,
rendering_configuration,
server_side_encryption_configuration,
source_configuration,
vector_ingestion_configuration,
tags
FROM awscc.wisdom.knowledge_bases
WHERE
region = '{{ region }}' AND
Identifier = '{{ knowledge_base_id }}';
Lists all knowledge_bases in a region.
SELECT
region,
knowledge_base_id
FROM awscc.wisdom.knowledge_bases_list_only
WHERE
region = '{{ region }}';
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 awscc.wisdom.knowledge_bases (
KnowledgeBaseType,
Name,
region
)
SELECT
'{{ knowledge_base_type }}',
'{{ name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.wisdom.knowledge_bases (
Description,
KnowledgeBaseType,
Name,
RenderingConfiguration,
ServerSideEncryptionConfiguration,
SourceConfiguration,
VectorIngestionConfiguration,
Tags,
region
)
SELECT
'{{ description }}',
'{{ knowledge_base_type }}',
'{{ name }}',
'{{ rendering_configuration }}',
'{{ server_side_encryption_configuration }}',
'{{ source_configuration }}',
'{{ vector_ingestion_configuration }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
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: knowledge_base_type
value: '{{ knowledge_base_type }}'
- name: name
value: '{{ name }}'
- name: rendering_configuration
value:
template_uri: '{{ template_uri }}'
- name: server_side_encryption_configuration
value:
kms_key_id: '{{ kms_key_id }}'
- name: source_configuration
value: null
- name: vector_ingestion_configuration
value:
chunking_configuration:
chunking_strategy: '{{ chunking_strategy }}'
fixed_size_chunking_configuration:
max_tokens: null
overlap_percentage: null
hierarchical_chunking_configuration:
level_configurations:
- max_tokens: null
overlap_tokens: null
semantic_chunking_configuration:
max_tokens: null
buffer_size: null
breakpoint_percentile_threshold: null
parsing_configuration:
parsing_strategy: '{{ parsing_strategy }}'
bedrock_foundation_model_configuration:
model_arn: '{{ model_arn }}'
parsing_prompt:
parsing_prompt_text: '{{ parsing_prompt_text }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a knowledge_base resource, using stack-deploy.
/*+ update */
UPDATE awscc.wisdom.knowledge_bases
SET PatchDocument = string('{{ {
"RenderingConfiguration": rendering_configuration,
"VectorIngestionConfiguration": vector_ingestion_configuration
} | 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.wisdom.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:
| Parameter | Description |
|---|---|
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:
- Create
- Update
- Delete
- List
- Read
appflow:CreateFlow,
appflow:DeleteFlow,
appflow:StartFlow,
appflow:TagResource,
appflow:UseConnectorProfile,
app-integrations:CreateDataIntegrationAssociation,
app-integrations:GetDataIntegration,
kms:DescribeKey,
kms:CreateGrant,
kms:ListGrants,
wisdom:CreateKnowledgeBase,
wisdom:TagResource
wisdom:GetKnowledgeBase
appflow:DeleteFlow,
appflow:StopFlow,
app-integrations:DeleteDataIntegrationAssociation,
wisdom:DeleteKnowledgeBase
wisdom:ListKnowledgeBases
wisdom:GetKnowledgeBase