Skip to main content

data_sources

Creates, updates, deletes, gets or lists a data_sources resource.

Overview

Namedata_sources
TypeResource
Idaws.bedrock_agent.data_sources

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the data source. (pattern: <code>([0-9a-zA-Z][_-]?){1,100}</code>)
created_atstring (date-time)The time at which the data source was created.
data_deletion_policystringThe data deletion policy for the data source. (RETAIN, DELETE)
data_source_configurationobjectThe connection configuration for the data source.
data_source_idstringThe unique identifier of the data source. (pattern: <code>[0-9a-zA-Z]{10}</code>)
descriptionstringThe description of the data source.
failure_reasonsarrayThe detailed reasons on the failure to delete a data source.
knowledge_base_idstringThe unique identifier of the knowledge base to which the data source belongs. (pattern: <code>[0-9a-zA-Z]{10}</code>)
server_side_encryption_configurationobjectContains the configuration for server-side encryption for your managed knowledge base.
statusstringThe status of the data source. The following statuses are possible: Available – The data source has been created and is ready for ingestion into the knowledge base. Deleting – The data source is being deleted. (AVAILABLE, DELETING, DELETE_UNSUCCESSFUL, CREATING, UPDATING, FAILED)
updated_atstring (date-time)The time at which the data source was last updated.
vector_ingestion_configurationobjectContains details about how to ingest the documents in a data source.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_data_sourceselectknowledge_base_id, data_source_id, regionGets information about a data source.
list_data_sourcesselectknowledge_base_id, regionLists the data sources in a knowledge base and information about each one.
create_data_sourceinsertknowledge_base_id, region, name, dataSourceConfigurationConnects a knowledge base to a data source. You specify the configuration for the specific data source service in the dataSourceConfiguration field. You can't change the chunkingConfiguration after you create the data source connector.
update_data_sourceupdateknowledge_base_id, data_source_id, region, name, dataSourceConfigurationUpdates the configurations for a data source connector. You can't change the chunkingConfiguration after you create the data source connector. Specify the existing chunkingConfiguration.
delete_data_sourcedeleteknowledge_base_id, data_source_id, regionDeletes a data source from a knowledge base.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
data_source_idstringThe unique identifier of the data source to delete.
knowledge_base_idstringThe unique identifier of the knowledge base from which to delete the data source.
regionstringAWS region (default: us-east-1)

SELECT examples

Gets information about a data source.

SELECT
name,
created_at,
data_deletion_policy,
data_source_configuration,
data_source_id,
description,
failure_reasons,
knowledge_base_id,
server_side_encryption_configuration,
status,
updated_at,
vector_ingestion_configuration
FROM aws.bedrock_agent.data_sources
WHERE knowledge_base_id = '{{ knowledge_base_id }}' -- required
AND data_source_id = '{{ data_source_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Connects a knowledge base to a data source. You specify the configuration for the specific data source service in the dataSourceConfiguration field. You can't change the chunkingConfiguration after you create the data source connector.

INSERT INTO aws.bedrock_agent.data_sources (
clientToken,
name,
description,
dataSourceConfiguration,
dataDeletionPolicy,
serverSideEncryptionConfiguration,
vectorIngestionConfiguration,
knowledge_base_id,
region
)
SELECT
'{{ clientToken }}',
'{{ name }}' /* required */,
'{{ description }}',
'{{ dataSourceConfiguration }}' /* required */,
'{{ dataDeletionPolicy }}',
'{{ serverSideEncryptionConfiguration }}',
'{{ vectorIngestionConfiguration }}',
'{{ knowledge_base_id }}',
'{{ region }}'
RETURNING
data_source
;

UPDATE examples

Updates the configurations for a data source connector. You can't change the chunkingConfiguration after you create the data source connector. Specify the existing chunkingConfiguration.

UPDATE aws.bedrock_agent.data_sources
SET
name = '{{ name }}',
description = '{{ description }}',
dataSourceConfiguration = '{{ dataSourceConfiguration }}',
dataDeletionPolicy = '{{ dataDeletionPolicy }}',
serverSideEncryptionConfiguration = '{{ serverSideEncryptionConfiguration }}',
vectorIngestionConfiguration = '{{ vectorIngestionConfiguration }}'
WHERE
knowledge_base_id = '{{ knowledge_base_id }}' --required
AND data_source_id = '{{ data_source_id }}' --required
AND region = '{{ region }}' --required
AND name = '{{ name }}' --required
AND dataSourceConfiguration = '{{ dataSourceConfiguration }}' --required
RETURNING
data_source;

DELETE examples

Deletes a data source from a knowledge base.

DELETE FROM aws.bedrock_agent.data_sources
WHERE knowledge_base_id = '{{ knowledge_base_id }}' --required
AND data_source_id = '{{ data_source_id }}' --required
AND region = '{{ region }}' --required
;