data_sources
Creates, updates, deletes or gets a data_source
resource or lists data_sources
in a region
Overview
Name | data_sources |
Type | Resource |
Description | Definition of AWS::Bedrock::DataSource Resource Type |
Id | aws.bedrock.data_sources |
Fields
Name | Datatype | Description |
---|---|---|
data_source_configuration | object | Specifies a raw data source location to ingest. |
data_source_id | string | Identifier for a resource. |
description | string | Description of the Resource. |
knowledge_base_id | string | The unique identifier of the knowledge base to which to add the data source. |
data_source_status | string | The status of a data source. |
name | string | The name of the data source. |
server_side_encryption_configuration | object | Contains details about the server-side encryption for the data source. |
vector_ingestion_configuration | object | Details about how to chunk the documents in the data source. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried. |
data_deletion_policy | string | The deletion policy for the data source. |
created_at | string | The time at which the data source was created. |
updated_at | string | The time at which the knowledge base was last updated. |
failure_reasons | array | The details of the failure reasons related to the data source. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | DataSourceConfiguration, Name, KnowledgeBaseId, 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 data_sources
in a region.
SELECT
region,
data_source_configuration,
data_source_id,
description,
knowledge_base_id,
data_source_status,
name,
server_side_encryption_configuration,
vector_ingestion_configuration,
data_deletion_policy,
created_at,
updated_at,
failure_reasons
FROM aws.bedrock.data_sources
WHERE region = 'us-east-1';
Gets all properties from an individual data_source
.
SELECT
region,
data_source_configuration,
data_source_id,
description,
knowledge_base_id,
data_source_status,
name,
server_side_encryption_configuration,
vector_ingestion_configuration,
data_deletion_policy,
created_at,
updated_at,
failure_reasons
FROM aws.bedrock.data_sources
WHERE region = 'us-east-1' AND data__Identifier = '<KnowledgeBaseId>|<DataSourceId>';
INSERT
example
Use the following StackQL query and manifest file to create a new data_source
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.bedrock.data_sources (
DataSourceConfiguration,
KnowledgeBaseId,
Name,
region
)
SELECT
'{{ DataSourceConfiguration }}',
'{{ KnowledgeBaseId }}',
'{{ Name }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.bedrock.data_sources (
DataSourceConfiguration,
Description,
KnowledgeBaseId,
Name,
ServerSideEncryptionConfiguration,
VectorIngestionConfiguration,
DataDeletionPolicy,
region
)
SELECT
'{{ DataSourceConfiguration }}',
'{{ Description }}',
'{{ KnowledgeBaseId }}',
'{{ Name }}',
'{{ ServerSideEncryptionConfiguration }}',
'{{ VectorIngestionConfiguration }}',
'{{ DataDeletionPolicy }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: data_source
props:
- name: DataSourceConfiguration
value:
Type: '{{ Type }}'
S3Configuration:
BucketArn: '{{ BucketArn }}'
InclusionPrefixes:
- '{{ InclusionPrefixes[0] }}'
BucketOwnerAccountId: '{{ BucketOwnerAccountId }}'
- name: Description
value: '{{ Description }}'
- name: KnowledgeBaseId
value: '{{ KnowledgeBaseId }}'
- name: Name
value: '{{ Name }}'
- name: ServerSideEncryptionConfiguration
value:
KmsKeyArn: '{{ KmsKeyArn }}'
- name: VectorIngestionConfiguration
value:
ChunkingConfiguration:
ChunkingStrategy: '{{ ChunkingStrategy }}'
FixedSizeChunkingConfiguration:
MaxTokens: '{{ MaxTokens }}'
OverlapPercentage: '{{ OverlapPercentage }}'
- name: DataDeletionPolicy
value: '{{ DataDeletionPolicy }}'
DELETE
example
/*+ delete */
DELETE FROM aws.bedrock.data_sources
WHERE data__Identifier = '<KnowledgeBaseId|DataSourceId>'
AND region = 'us-east-1';
Permissions
To operate on the data_sources
resource, the following permissions are required:
Create
bedrock:CreateDataSource,
bedrock:GetDataSource,
bedrock:GetKnowledgeBase
Read
bedrock:GetDataSource
Update
bedrock:GetDataSource,
bedrock:UpdateDataSource
Delete
bedrock:GetDataSource,
bedrock:DeleteDataSource
List
bedrock:ListDataSources