data_sources
Creates, updates, deletes, gets or lists a data_sources resource.
Overview
| Name | data_sources |
| Type | Resource |
| Id | aws.bedrock_agent.data_sources |
Fields
The following fields are returned by SELECT queries:
- get_data_source
- list_data_sources
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the data source. (pattern: <code>([0-9a-zA-Z][_-]?){1,100}</code>) |
created_at | string (date-time) | The time at which the data source was created. |
data_deletion_policy | string | The data deletion policy for the data source. (RETAIN, DELETE) |
data_source_configuration | object | The connection configuration for the data source. |
data_source_id | string | The unique identifier of the data source. (pattern: <code>[0-9a-zA-Z]{10}</code>) |
description | string | The description of the data source. |
failure_reasons | array | The detailed reasons on the failure to delete a data source. |
knowledge_base_id | string | The unique identifier of the knowledge base to which the data source belongs. (pattern: <code>[0-9a-zA-Z]{10}</code>) |
server_side_encryption_configuration | object | Contains the configuration for server-side encryption for your managed knowledge base. |
status | string | The 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_at | string (date-time) | The time at which the data source was last updated. |
vector_ingestion_configuration | object | Contains details about how to ingest the documents in a data source. |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the data source. (pattern: <code>([0-9a-zA-Z][_-]?){1,100}</code>) |
data_source_id | string | The unique identifier of the data source. (pattern: <code>[0-9a-zA-Z]{10}</code>) |
description | string | The description of the data source. |
knowledge_base_id | string | The unique identifier of the knowledge base to which the data source belongs. (pattern: <code>[0-9a-zA-Z]{10}</code>) |
status | string | The status of the data source. (AVAILABLE, DELETING, DELETE_UNSUCCESSFUL, CREATING, UPDATING, FAILED) |
updated_at | string (date-time) | The time at which the data source was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_data_source | select | knowledge_base_id, data_source_id, region | Gets information about a data source. | |
list_data_sources | select | knowledge_base_id, region | Lists the data sources in a knowledge base and information about each one. | |
create_data_source | insert | knowledge_base_id, region, name, dataSourceConfiguration | 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. | |
update_data_source | update | knowledge_base_id, data_source_id, region, name, dataSourceConfiguration | 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. | |
delete_data_source | delete | knowledge_base_id, data_source_id, region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
data_source_id | string | The unique identifier of the data source to delete. |
knowledge_base_id | string | The unique identifier of the knowledge base from which to delete the data source. |
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_data_source
- list_data_sources
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
;
Lists the data sources in a knowledge base and information about each one.
SELECT
name,
data_source_id,
description,
knowledge_base_id,
status,
updated_at
FROM aws.bedrock_agent.data_sources
WHERE knowledge_base_id = '{{ knowledge_base_id }}' -- required
AND region = '{{ region }}' -- required
;
INSERT examples
- create_data_source
- Manifest
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
;
# Description fields are for documentation purposes
- name: data_sources
props:
- name: knowledge_base_id
value: "{{ knowledge_base_id }}"
description: Required parameter for the data_sources resource.
- name: region
value: "{{ region }}"
description: Required parameter for the data_sources resource.
- name: clientToken
value: "{{ clientToken }}"
- name: name
value: "{{ name }}"
- name: description
value: "{{ description }}"
- name: dataSourceConfiguration
description: |
The connection configuration for the data source.
value:
type_: "{{ type_ }}"
managedKnowledgeBaseConnectorConfiguration:
deletionProtectionConfiguration:
deletionProtectionStatus: "{{ deletionProtectionStatus }}"
deletionProtectionThreshold: {{ deletionProtectionThreshold }}
mediaExtractionConfiguration:
imageExtractionConfiguration:
imageExtractionStatus: "{{ imageExtractionStatus }}"
audioExtractionConfiguration:
audioExtractionStatus: "{{ audioExtractionStatus }}"
videoExtractionConfiguration:
videoExtractionStatus: "{{ videoExtractionStatus }}"
connectorParameters: "{{ connectorParameters }}"
s3Configuration:
bucketArn: "{{ bucketArn }}"
inclusionPrefixes:
- "{{ inclusionPrefixes }}"
bucketOwnerAccountId: "{{ bucketOwnerAccountId }}"
webConfiguration:
sourceConfiguration:
urlConfiguration:
seedUrls:
- url: "{{ url }}"
crawlerConfiguration:
crawlerLimits:
rateLimit: {{ rateLimit }}
maxPages: {{ maxPages }}
inclusionFilters:
- "{{ inclusionFilters }}"
exclusionFilters:
- "{{ exclusionFilters }}"
scope: "{{ scope }}"
userAgent: "{{ userAgent }}"
userAgentHeader: "{{ userAgentHeader }}"
confluenceConfiguration:
sourceConfiguration:
hostUrl: "{{ hostUrl }}"
hostType: "{{ hostType }}"
authType: "{{ authType }}"
credentialsSecretArn: "{{ credentialsSecretArn }}"
crawlerConfiguration:
filterConfiguration:
type_: "{{ type_ }}"
patternObjectFilter:
filters: "{{ filters }}"
salesforceConfiguration:
sourceConfiguration:
hostUrl: "{{ hostUrl }}"
authType: "{{ authType }}"
credentialsSecretArn: "{{ credentialsSecretArn }}"
crawlerConfiguration:
filterConfiguration:
type_: "{{ type_ }}"
patternObjectFilter:
filters: "{{ filters }}"
sharePointConfiguration:
sourceConfiguration:
tenantId: "{{ tenantId }}"
domain: "{{ domain }}"
siteUrls:
- "{{ siteUrls }}"
hostType: "{{ hostType }}"
authType: "{{ authType }}"
credentialsSecretArn: "{{ credentialsSecretArn }}"
crawlerConfiguration:
filterConfiguration:
type_: "{{ type_ }}"
patternObjectFilter:
filters: "{{ filters }}"
- name: dataDeletionPolicy
value: "{{ dataDeletionPolicy }}"
valid_values: ['RETAIN', 'DELETE']
- name: serverSideEncryptionConfiguration
description: |
Contains the configuration for server-side encryption for your managed knowledge base.
value:
kmsKeyArn: "{{ kmsKeyArn }}"
- name: vectorIngestionConfiguration
description: |
Contains details about how to ingest the documents in a data source.
value:
chunkingConfiguration:
chunkingStrategy: "{{ chunkingStrategy }}"
fixedSizeChunkingConfiguration:
maxTokens: {{ maxTokens }}
overlapPercentage: {{ overlapPercentage }}
hierarchicalChunkingConfiguration:
levelConfigurations:
- maxTokens: {{ maxTokens }}
overlapTokens: {{ overlapTokens }}
semanticChunkingConfiguration:
maxTokens: {{ maxTokens }}
bufferSize: {{ bufferSize }}
breakpointPercentileThreshold: {{ breakpointPercentileThreshold }}
customTransformationConfiguration:
intermediateStorage:
s3Location:
uri: "{{ uri }}"
transformations:
- transformationFunction:
transformationLambdaConfiguration:
lambdaArn: "{{ lambdaArn }}"
stepToApply: "{{ stepToApply }}"
parsingConfiguration:
parsingStrategy: "{{ parsingStrategy }}"
bedrockFoundationModelConfiguration:
modelArn: "{{ modelArn }}"
parsingPrompt:
parsingPromptText: "{{ parsingPromptText }}"
parsingModality: "{{ parsingModality }}"
bedrockDataAutomationConfiguration:
parsingModality: "{{ parsingModality }}"
contextEnrichmentConfiguration:
type_: "{{ type_ }}"
bedrockFoundationModelConfiguration:
enrichmentStrategyConfiguration:
method: "{{ method }}"
modelArn: "{{ modelArn }}"
UPDATE examples
- update_data_source
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
- delete_data_source
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
;