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
DescriptionKendra DataSource
Idawscc.kendra.data_sources

Fields

NameDatatypeDescription
idstringUnique ID of index
arnstring
namestringName of index
index_idstringUnique ID of Index
typestringData source type
data_source_configurationobject
descriptionstring
schedulestringSchedule
role_arnstringRole Arn
tagsarrayTags for labeling the data source
custom_document_enrichment_configurationobject
language_codestringThe code for a language.
regionstringAWS region.

For more information, see AWS::Kendra::DataSource.

Methods

NameResourceAccessible byRequired Params
create_resourcedata_sourcesINSERTName, IndexId, Type, region
delete_resourcedata_sourcesDELETEIdentifier, region
update_resourcedata_sourcesUPDATEIdentifier, PatchDocument, region
list_resourcesdata_sources_list_onlySELECTregion
get_resourcedata_sourcesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual data_source.

SELECT
region,
id,
arn,
name,
index_id,
type,
data_source_configuration,
description,
schedule,
role_arn,
tags,
custom_document_enrichment_configuration,
language_code
FROM awscc.kendra.data_sources
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}|{{ index_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new data_source resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.kendra.data_sources (
Name,
IndexId,
Type,
region
)
SELECT
'{{ name }}',
'{{ index_id }}',
'{{ type }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a data_source resource, using stack-deploy.

/*+ update */
UPDATE awscc.kendra.data_sources
SET PatchDocument = string('{{ {
"Name": name,
"DataSourceConfiguration": data_source_configuration,
"Description": description,
"Schedule": schedule,
"RoleArn": role_arn,
"Tags": tags,
"CustomDocumentEnrichmentConfiguration": custom_document_enrichment_configuration,
"LanguageCode": language_code
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}|{{ index_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.kendra.data_sources
WHERE
Identifier = '{{ id }}|{{ index_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the data_sources resource, the following permissions are required:

kendra:CreateDataSource,
kendra:DescribeDataSource,
kendra:ListTagsForResource,
iam:PassRole,
kendra:TagResource