Skip to main content

data_sources

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

Overview

Namedata_sources
TypeResource
Idaws.kendra.data_sources

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
configurationobjectConfiguration details for the data source connector. This shows how the data source is configured. The configuration options for a data source depend on the data source provider.
created_atstring (date-time)The Unix timestamp when the data source connector was created.
custom_document_enrichment_configurationobjectConfiguration information for altering document metadata and content during the document ingestion process when you describe a data source. For more information on how to create, modify and delete document metadata, or make other content alterations when you ingest documents into Amazon Kendra, see Customizing document metadata during the ingestion process.
descriptionstringThe description for the data source connector. (pattern: <code>^\P{C}*$</code>)
error_messagestringWhen the Status field value is FAILED, the ErrorMessage field contains a description of the error that caused the data source to fail. (pattern: <code>^\P{C}*$</code>)
idstringThe identifier of the data source connector. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9_-]*</code>)
index_idstringThe identifier of the index used with the data source connector. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9-]*</code>)
language_codestringThe code for a language. This shows a supported language for all documents in the data source. English is supported by default. For more information on supported languages, including their codes, see Adding documents in languages other than English. (pattern: <code>[a-zA-Z-]*</code>)
namestringThe name for the data source connector. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9_-]*</code>)
role_arnstringThe Amazon Resource Name (ARN) of the IAM 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>)
schedulestringThe schedule for Amazon Kendra to update the index.
statusstringThe current status of the data source connector. When the status is ACTIVE the data source is ready to use. When the status is FAILED, the ErrorMessage field contains the reason that the data source failed. (CREATING, DELETING, FAILED, UPDATING, ACTIVE)
typestringThe type of the data source. For example, SHAREPOINT. (S3, SHAREPOINT, DATABASE, SALESFORCE, ONEDRIVE, SERVICENOW, CUSTOM, CONFLUENCE, GOOGLEDRIVE, WEBCRAWLER, WORKDOCS, FSX, SLACK, BOX, QUIP, JIRA, GITHUB, ALFRESCO, TEMPLATE)
updated_atstring (date-time)The Unix timestamp when the data source connector was last updated.
vpc_configurationobjectProvides the configuration information to connect to an Amazon VPC.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_data_sourceselectregionGets information about an Amazon Kendra data source connector.
create_data_sourceinsertregion, IndexIdCreates a data source connector that you want to use with an Amazon Kendra index. You specify a name, data source connector type and description for your data source. You also specify configuration information for the data source connector. CreateDataSource is a synchronous operation. The operation returns 200 if the data source was successfully created. Otherwise, an exception is raised. For an example of creating an index and data source using the Python SDK, see Getting started with Python SDK. For an example of creating an index and data source using the Java SDK, see Getting started with Java SDK.
update_data_sourceupdateregion, IndexIdUpdates an Amazon Kendra data source connector.
delete_data_sourcedeleteregionDeletes an Amazon Kendra data source connector. An exception is not thrown if the data source is already being deleted. While the data source is being deleted, the Status field returned by a call to the DescribeDataSource API is set to DELETING. For more information, see Deleting Data Sources. Deleting an entire data source or re-syncing your index after deleting specific documents from a data source could take up to an hour or more, depending on the number of documents you want to delete.
list_data_sourcesexecregion, IndexIdLists the data source connectors that you have created.
start_data_source_sync_jobexecregion, IndexIdStarts a synchronization job for a data source connector. If a synchronization job is already in progress, Amazon Kendra returns a ResourceInUseException exception. Re-syncing your data source with your index after modifying, adding, or deleting documents from your data source respository could take up to an hour or more, depending on the number of documents to sync.
stop_data_source_sync_jobexecregion, IndexIdStops a synchronization job that is currently running. You can't stop a scheduled synchronization job.

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
regionstringAWS region (default: us-east-1)

SELECT examples

Gets information about an Amazon Kendra data source connector.

SELECT
configuration,
created_at,
custom_document_enrichment_configuration,
description,
error_message,
id,
index_id,
language_code,
name,
role_arn,
schedule,
status,
type,
updated_at,
vpc_configuration
FROM aws.kendra.data_sources
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a data source connector that you want to use with an Amazon Kendra index. You specify a name, data source connector type and description for your data source. You also specify configuration information for the data source connector. CreateDataSource is a synchronous operation. The operation returns 200 if the data source was successfully created. Otherwise, an exception is raised. For an example of creating an index and data source using the Python SDK, see Getting started with Python SDK. For an example of creating an index and data source using the Java SDK, see Getting started with Java SDK.

INSERT INTO aws.kendra.data_sources (
Name,
IndexId,
Type,
Configuration,
VpcConfiguration,
Description,
Schedule,
RoleArn,
Tags,
ClientToken,
LanguageCode,
CustomDocumentEnrichmentConfiguration,
region
)
SELECT
'{{ Name }}',
'{{ IndexId }}' /* required */,
'{{ Type }}',
'{{ Configuration }}',
'{{ VpcConfiguration }}',
'{{ Description }}',
'{{ Schedule }}',
'{{ RoleArn }}',
'{{ Tags }}',
'{{ ClientToken }}',
'{{ LanguageCode }}',
'{{ CustomDocumentEnrichmentConfiguration }}',
'{{ region }}'
RETURNING
id
;

UPDATE examples

Updates an Amazon Kendra data source connector.

UPDATE aws.kendra.data_sources
SET
Id = '{{ Id }}',
Name = '{{ Name }}',
IndexId = '{{ IndexId }}',
Configuration = '{{ Configuration }}',
VpcConfiguration = '{{ VpcConfiguration }}',
Description = '{{ Description }}',
Schedule = '{{ Schedule }}',
RoleArn = '{{ RoleArn }}',
LanguageCode = '{{ LanguageCode }}',
CustomDocumentEnrichmentConfiguration = '{{ CustomDocumentEnrichmentConfiguration }}'
WHERE
region = '{{ region }}' --required
AND IndexId = '{{ IndexId }}' --required;

DELETE examples

Deletes an Amazon Kendra data source connector. An exception is not thrown if the data source is already being deleted. While the data source is being deleted, the Status field returned by a call to the DescribeDataSource API is set to DELETING. For more information, see Deleting Data Sources. Deleting an entire data source or re-syncing your index after deleting specific documents from a data source could take up to an hour or more, depending on the number of documents you want to delete.

DELETE FROM aws.kendra.data_sources
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Lists the data source connectors that you have created.

EXEC aws.kendra.data_sources.list_data_sources
@region='{{ region }}' --required
@@json=
'{
"IndexId": "{{ IndexId }}",
"NextToken": "{{ NextToken }}",
"MaxResults": {{ MaxResults }}
}'
;