Skip to main content

data_sources

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

Overview

Namedata_sources
TypeResource
Idaws.qbusiness.data_sources

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
application_idstringThe identifier of the Amazon Q Business application. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9-]{35}</code>)
configurationobjectProvides the configuration information for an Amazon Q Business data source.
created_atstring (date-time)The Unix timestamp when the data source connector was created.
data_source_arnstringThe Amazon Resource Name (ARN) of the data source. (pattern: <code>arn:[a-z0-9-.]{1,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[^/].{0,1023}</code>)
data_source_idstringThe identifier of the data source connector. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9-]{35}</code>)
descriptionstringThe description for the data source connector. (pattern: <code>[\s\S]*</code>)
display_namestringThe name for the data source connector. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9_-]*</code>)
document_enrichment_configurationobjectProvides the configuration information for altering document metadata and content during the document ingestion process. For more information, see Custom document enrichment.
errorobjectProvides information about a Amazon Q Business request error.
index_idstringThe identifier of the index linked to the data source connector. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9-]{35}</code>)
media_extraction_configurationobjectThe configuration for extracting information from media in documents.
role_arnstringThe Amazon Resource Name (ARN) of the role with permission to access the data source and required resources. (pattern: <code>arn:[a-z0-9-.]{1,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[a-z0-9-.]{0,63}:[^/].{0,1023}</code>)
statusstringThe current status of the data source connector. When the Status field value is FAILED, the ErrorMessage field contains a description of the error that caused the data source connector to fail. (PENDING_CREATION, CREATING, ACTIVE, DELETING, FAILED, UPDATING)
sync_schedulestringThe schedule for Amazon Q Business to update the index. (pattern: <code>[\s\S]*</code>)
type_stringThe type of the data source connector. For example, S3.
updated_atstring (date-time)The Unix timestamp when the data source connector was last updated.
vpc_configurationobjectProvides configuration information needed to connect to an Amazon VPC (Virtual Private Cloud).

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_data_sourceselectapplication_id, index_id, data_source_id, regionGets information about an existing Amazon Q Business data source connector.
list_data_sourcesselectapplication_id, index_id, regionnextToken, maxResultsLists the Amazon Q Business data source connectors that you have created.
create_data_sourceinsertapplication_id, index_id, region, displayName, configurationCreates a data source connector for an Amazon Q Business application. CreateDataSource is a synchronous operation. The operation returns 200 if the data source was successfully created. Otherwise, an exception is raised.
update_data_sourceupdateapplication_id, index_id, data_source_id, regionUpdates an existing Amazon Q Business data source connector.
delete_data_sourcedeleteapplication_id, index_id, data_source_id, regionDeletes an Amazon Q Business data source connector. While the data source is being deleted, the Status field returned by a call to the DescribeDataSource API is set to DELETING.
start_data_source_sync_jobexecdata_source_id, application_id, index_id, regionStarts a data source connector synchronization job. If a synchronization job is already in progress, Amazon Q Business returns a ConflictException.
stop_data_source_sync_jobexecdata_source_id, application_id, index_id, regionStops an Amazon Q Business data source connector synchronization job already in progress.

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
application_idstringThe identifier of the Amazon Q Business application that the data source is connected to.
data_source_idstringThe identifier of the data source connector.
index_idstringThe identifier of the index used with the Amazon Q Business data source connector.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of data source connectors to return.
nextTokenstringIf the maxResults response was incomplete because there is more data to retrieve, Amazon Q Business returns a pagination token in the response. You can use this pagination token to retrieve the next set of Amazon Q Business data source connectors.

SELECT examples

Gets information about an existing Amazon Q Business data source connector.

SELECT
application_id,
configuration,
created_at,
data_source_arn,
data_source_id,
description,
display_name,
document_enrichment_configuration,
error,
index_id,
media_extraction_configuration,
role_arn,
status,
sync_schedule,
type_,
updated_at,
vpc_configuration
FROM aws.qbusiness.data_sources
WHERE application_id = '{{ application_id }}' -- required
AND index_id = '{{ index_id }}' -- required
AND data_source_id = '{{ data_source_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a data source connector for an Amazon Q Business application. CreateDataSource is a synchronous operation. The operation returns 200 if the data source was successfully created. Otherwise, an exception is raised.

INSERT INTO aws.qbusiness.data_sources (
displayName,
configuration,
vpcConfiguration,
description,
tags,
syncSchedule,
roleArn,
clientToken,
documentEnrichmentConfiguration,
mediaExtractionConfiguration,
application_id,
index_id,
region
)
SELECT
'{{ displayName }}' /* required */,
'{{ configuration }}' /* required */,
'{{ vpcConfiguration }}',
'{{ description }}',
'{{ tags }}',
'{{ syncSchedule }}',
'{{ roleArn }}',
'{{ clientToken }}',
'{{ documentEnrichmentConfiguration }}',
'{{ mediaExtractionConfiguration }}',
'{{ application_id }}',
'{{ index_id }}',
'{{ region }}'
RETURNING
data_source_arn,
data_source_id
;

UPDATE examples

Updates an existing Amazon Q Business data source connector.

UPDATE aws.qbusiness.data_sources
SET
displayName = '{{ displayName }}',
configuration = '{{ configuration }}',
vpcConfiguration = '{{ vpcConfiguration }}',
description = '{{ description }}',
syncSchedule = '{{ syncSchedule }}',
roleArn = '{{ roleArn }}',
documentEnrichmentConfiguration = '{{ documentEnrichmentConfiguration }}',
mediaExtractionConfiguration = '{{ mediaExtractionConfiguration }}'
WHERE
application_id = '{{ application_id }}' --required
AND index_id = '{{ index_id }}' --required
AND data_source_id = '{{ data_source_id }}' --required
AND region = '{{ region }}' --required;

DELETE examples

Deletes an Amazon Q Business data source connector. While the data source is being deleted, the Status field returned by a call to the DescribeDataSource API is set to DELETING.

DELETE FROM aws.qbusiness.data_sources
WHERE application_id = '{{ application_id }}' --required
AND index_id = '{{ index_id }}' --required
AND data_source_id = '{{ data_source_id }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Starts a data source connector synchronization job. If a synchronization job is already in progress, Amazon Q Business returns a ConflictException.

EXEC aws.qbusiness.data_sources.start_data_source_sync_job
@data_source_id='{{ data_source_id }}' --required,
@application_id='{{ application_id }}' --required,
@index_id='{{ index_id }}' --required,
@region='{{ region }}' --required
;