CreateDataSource
Creates a data source that you use to with an Amazon Kendra index.
You specify a name, data source connector type and description for your data source. You also specify configuration information such as document metadata (author, source URI, and so on) and user context information.
CreateDataSource
is a synchronous operation. The operation returns 200 if the
data source was successfully created. Otherwise, an exception is raised.
Request Syntax
{
"ClientToken": "string
",
"Configuration": {
"ConfluenceConfiguration": {
"AttachmentConfiguration": {
"AttachmentFieldMappings": [
{
"DataSourceFieldName": "string
",
"DateFieldFormat": "string
",
"IndexFieldName": "string
"
}
],
"CrawlAttachments": boolean
},
"BlogConfiguration": {
"BlogFieldMappings": [
{
"DataSourceFieldName": "string
",
"DateFieldFormat": "string
",
"IndexFieldName": "string
"
}
]
},
"ExclusionPatterns": [ "string
" ],
"InclusionPatterns": [ "string
" ],
"PageConfiguration": {
"PageFieldMappings": [
{
"DataSourceFieldName": "string
",
"DateFieldFormat": "string
",
"IndexFieldName": "string
"
}
]
},
"SecretArn": "string
",
"ServerUrl": "string
",
"SpaceConfiguration": {
"CrawlArchivedSpaces": boolean
,
"CrawlPersonalSpaces": boolean
,
"ExcludeSpaces": [ "string
" ],
"IncludeSpaces": [ "string
" ],
"SpaceFieldMappings": [
{
"DataSourceFieldName": "string
",
"DateFieldFormat": "string
",
"IndexFieldName": "string
"
}
]
},
"Version": "string
",
"VpcConfiguration": {
"SecurityGroupIds": [ "string
" ],
"SubnetIds": [ "string
" ]
}
},
"DatabaseConfiguration": {
"AclConfiguration": {
"AllowedGroupsColumnName": "string
"
},
"ColumnConfiguration": {
"ChangeDetectingColumns": [ "string
" ],
"DocumentDataColumnName": "string
",
"DocumentIdColumnName": "string
",
"DocumentTitleColumnName": "string
",
"FieldMappings": [
{
"DataSourceFieldName": "string
",
"DateFieldFormat": "string
",
"IndexFieldName": "string
"
}
]
},
"ConnectionConfiguration": {
"DatabaseHost": "string
",
"DatabaseName": "string
",
"DatabasePort": number
,
"SecretArn": "string
",
"TableName": "string
"
},
"DatabaseEngineType": "string
",
"SqlConfiguration": {
"QueryIdentifiersEnclosingOption": "string
"
},
"VpcConfiguration": {
"SecurityGroupIds": [ "string
" ],
"SubnetIds": [ "string
" ]
}
},
"GoogleDriveConfiguration": {
"ExcludeMimeTypes": [ "string
" ],
"ExcludeSharedDrives": [ "string
" ],
"ExcludeUserAccounts": [ "string
" ],
"ExclusionPatterns": [ "string
" ],
"FieldMappings": [
{
"DataSourceFieldName": "string
",
"DateFieldFormat": "string
",
"IndexFieldName": "string
"
}
],
"InclusionPatterns": [ "string
" ],
"SecretArn": "string
"
},
"OneDriveConfiguration": {
"DisableLocalGroups": boolean
,
"ExclusionPatterns": [ "string
" ],
"FieldMappings": [
{
"DataSourceFieldName": "string
",
"DateFieldFormat": "string
",
"IndexFieldName": "string
"
}
],
"InclusionPatterns": [ "string
" ],
"OneDriveUsers": {
"OneDriveUserList": [ "string
" ],
"OneDriveUserS3Path": {
"Bucket": "string
",
"Key": "string
"
}
},
"SecretArn": "string
",
"TenantDomain": "string
"
},
"S3Configuration": {
"AccessControlListConfiguration": {
"KeyPath": "string
"
},
"BucketName": "string
",
"DocumentsMetadataConfiguration": {
"S3Prefix": "string
"
},
"ExclusionPatterns": [ "string
" ],
"InclusionPatterns": [ "string
" ],
"InclusionPrefixes": [ "string
" ]
},
"SalesforceConfiguration": {
"ChatterFeedConfiguration": {
"DocumentDataFieldName": "string
",
"DocumentTitleFieldName": "string
",
"FieldMappings": [
{
"DataSourceFieldName": "string
",
"DateFieldFormat": "string
",
"IndexFieldName": "string
"
}
],
"IncludeFilterTypes": [ "string
" ]
},
"CrawlAttachments": boolean
,
"ExcludeAttachmentFilePatterns": [ "string
" ],
"IncludeAttachmentFilePatterns": [ "string
" ],
"KnowledgeArticleConfiguration": {
"CustomKnowledgeArticleTypeConfigurations": [
{
"DocumentDataFieldName": "string
",
"DocumentTitleFieldName": "string
",
"FieldMappings": [
{
"DataSourceFieldName": "string
",
"DateFieldFormat": "string
",
"IndexFieldName": "string
"
}
],
"Name": "string
"
}
],
"IncludedStates": [ "string
" ],
"StandardKnowledgeArticleTypeConfiguration": {
"DocumentDataFieldName": "string
",
"DocumentTitleFieldName": "string
",
"FieldMappings": [
{
"DataSourceFieldName": "string
",
"DateFieldFormat": "string
",
"IndexFieldName": "string
"
}
]
}
},
"SecretArn": "string
",
"ServerUrl": "string
",
"StandardObjectAttachmentConfiguration": {
"DocumentTitleFieldName": "string
",
"FieldMappings": [
{
"DataSourceFieldName": "string
",
"DateFieldFormat": "string
",
"IndexFieldName": "string
"
}
]
},
"StandardObjectConfigurations": [
{
"DocumentDataFieldName": "string
",
"DocumentTitleFieldName": "string
",
"FieldMappings": [
{
"DataSourceFieldName": "string
",
"DateFieldFormat": "string
",
"IndexFieldName": "string
"
}
],
"Name": "string
"
}
]
},
"ServiceNowConfiguration": {
"HostUrl": "string
",
"KnowledgeArticleConfiguration": {
"CrawlAttachments": boolean
,
"DocumentDataFieldName": "string
",
"DocumentTitleFieldName": "string
",
"ExcludeAttachmentFilePatterns": [ "string
" ],
"FieldMappings": [
{
"DataSourceFieldName": "string
",
"DateFieldFormat": "string
",
"IndexFieldName": "string
"
}
],
"IncludeAttachmentFilePatterns": [ "string
" ]
},
"SecretArn": "string
",
"ServiceCatalogConfiguration": {
"CrawlAttachments": boolean
,
"DocumentDataFieldName": "string
",
"DocumentTitleFieldName": "string
",
"ExcludeAttachmentFilePatterns": [ "string
" ],
"FieldMappings": [
{
"DataSourceFieldName": "string
",
"DateFieldFormat": "string
",
"IndexFieldName": "string
"
}
],
"IncludeAttachmentFilePatterns": [ "string
" ]
},
"ServiceNowBuildVersion": "string
"
},
"SharePointConfiguration": {
"CrawlAttachments": boolean
,
"DisableLocalGroups": boolean
,
"DocumentTitleFieldName": "string
",
"ExclusionPatterns": [ "string
" ],
"FieldMappings": [
{
"DataSourceFieldName": "string
",
"DateFieldFormat": "string
",
"IndexFieldName": "string
"
}
],
"InclusionPatterns": [ "string
" ],
"SecretArn": "string
",
"SharePointVersion": "string
",
"Urls": [ "string
" ],
"UseChangeLog": boolean
,
"VpcConfiguration": {
"SecurityGroupIds": [ "string
" ],
"SubnetIds": [ "string
" ]
}
}
},
"Description": "string
",
"IndexId": "string
",
"Name": "string
",
"RoleArn": "string
",
"Schedule": "string
",
"Tags": [
{
"Key": "string
",
"Value": "string
"
}
],
"Type": "string
"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- ClientToken
-
A token that you provide to identify the request to create a data source. Multiple calls to the
CreateDataSource
operation with the same client token will create only one data source.Type: String
Length Constraints: Minimum length of 1. Maximum length of 100.
Required: No
- Configuration
-
The connector configuration information that is required to access the repository.
You can't specify the
Configuration
parameter when theType
parameter is set toCUSTOM
. If you do, you receive aValidationException
exception.The
Configuration
parameter is required for all other data sources.Type: DataSourceConfiguration object
Required: No
- Description
-
A description for the data source.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 1000.
Pattern:
^\P{C}*$
Required: No
- IndexId
-
The identifier of the index that should be associated with this data source.
Type: String
Length Constraints: Fixed length of 36.
Pattern:
[a-zA-Z0-9][a-zA-Z0-9-]*
Required: Yes
- Name
-
A unique name for the data source. A data source name can't be changed without deleting and recreating the data source.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 1000.
Pattern:
[a-zA-Z0-9][a-zA-Z0-9_-]*
Required: Yes
- RoleArn
-
The Amazon Resource Name (ARN) of a role with permission to access the data source. For more information, see IAM Roles for Amazon Kendra.
You can't specify the
RoleArn
parameter when theType
parameter is set toCUSTOM
. If you do, you receive aValidationException
exception.The
RoleArn
parameter is required for all other data sources.Type: String
Length Constraints: Minimum length of 1. Maximum length of 1284.
Pattern:
arn:[a-z0-9-\.]{1,63}:[a-z0-9-\.]{0,63}:[a-z0-9-\.]{0,63}:[a-z0-9-\.]{0,63}:[^/].{0,1023}
Required: No
- Schedule
-
Sets the frequency that Amazon Kendra will check the documents in your repository and update the index. If you don't set a schedule Amazon Kendra will not periodically update the index. You can call the
StartDataSourceSyncJob
operation to update the index.You can't specify the
Schedule
parameter when theType
parameter is set toCUSTOM
. If you do, you receive aValidationException
exception.Type: String
Required: No
- Tags
-
A list of key-value pairs that identify the data source. You can use the tags to identify and organize your resources and to control access to resources.
Type: Array of Tag objects
Array Members: Minimum number of 0 items. Maximum number of 200 items.
Required: No
- Type
-
The type of repository that contains the data source.
Type: String
Valid Values:
S3 | SHAREPOINT | DATABASE | SALESFORCE | ONEDRIVE | SERVICENOW | CUSTOM | CONFLUENCE | GOOGLEDRIVE
Required: Yes
Response Syntax
{
"Id": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- Id
-
A unique identifier for the data source.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 100.
Pattern:
[a-zA-Z0-9][a-zA-Z0-9_-]*
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedException
-
HTTP Status Code: 400
- ConflictException
-
HTTP Status Code: 400
- InternalServerException
-
HTTP Status Code: 500
- ResourceAlreadyExistException
-
HTTP Status Code: 400
- ResourceNotFoundException
-
HTTP Status Code: 400
- ServiceQuotaExceededException
-
HTTP Status Code: 400
- ThrottlingException
-
HTTP Status Code: 400
- ValidationException
-
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: