Skip to main content

data_sources

Creates, updates, deletes or gets a data_source resource or lists data_sources in a region

Overview

Namedata_sources
TypeResource
DescriptionDefinition of AWS::Bedrock::DataSource Resource Type
Idaws.bedrock.data_sources

Fields

NameDatatypeDescription
data_source_configurationobjectSpecifies a raw data source location to ingest.
data_source_idstringIdentifier for a resource.
descriptionstringDescription of the Resource.
knowledge_base_idstringThe unique identifier of the knowledge base to which to add the data source.
data_source_statusstringThe status of a data source.
namestringThe name of the data source.
server_side_encryption_configurationobjectContains details about the server-side encryption for the data source.
vector_ingestion_configurationobjectDetails 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_policystringThe deletion policy for the data source.
created_atstringThe time at which the data source was created.
updated_atstringThe time at which the knowledge base was last updated.
failure_reasonsarrayThe details of the failure reasons related to the data source.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTDataSourceConfiguration, Name, KnowledgeBaseId, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__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.

/*+ create */
INSERT INTO aws.bedrock.data_sources (
DataSourceConfiguration,
KnowledgeBaseId,
Name,
region
)
SELECT
'{{ DataSourceConfiguration }}',
'{{ KnowledgeBaseId }}',
'{{ Name }}',
'{{ region }}';

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