kendra / Client / create_thesaurus



Creates a thesaurus for an index. The thesaurus contains a list of synonyms in Solr format.

For an example of adding a thesaurus file to an index, see Adding custom synonyms to an index.

See also: AWS API Documentation

Request Syntax

response = client.create_thesaurus(
            'Key': 'string',
            'Value': 'string'
        'Bucket': 'string',
        'Key': 'string'
  • IndexId (string) –


    The identifier of the index for the thesaurus.

  • Name (string) –


    A name for the thesaurus.

  • Description (string) – A description for the thesaurus.

  • RoleArn (string) –


    The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 bucket that contains the thesaurus file. For more information, see IAM access roles for Amazon Kendra.

  • Tags (list) –

    A list of key-value pairs that identify or categorize the thesaurus. You can also use tags to help control access to the thesaurus. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.

    • (dict) –

      A list of key/value pairs that identify an index, FAQ, or data source. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.

      • Key (string) – [REQUIRED]

        The key for the tag. Keys are not case sensitive and must be unique for the index, FAQ, or data source.

      • Value (string) – [REQUIRED]

        The value associated with the tag. The value may be an empty string but it can’t be null.

  • SourceS3Path (dict) –


    The path to the thesaurus file in S3.

    • Bucket (string) – [REQUIRED]

      The name of the S3 bucket that contains the file.

    • Key (string) – [REQUIRED]

      The name of the file.

  • ClientToken (string) –

    A token that you provide to identify the request to create a thesaurus. Multiple calls to the CreateThesaurus API with the same client token will create only one thesaurus.

    This field is autopopulated if not provided.

Return type:



Response Syntax

    'Id': 'string'

Response Structure

  • (dict) –

    • Id (string) –

      The identifier of the thesaurus.


  • kendra.Client.exceptions.ValidationException

  • kendra.Client.exceptions.ConflictException

  • kendra.Client.exceptions.ResourceNotFoundException

  • kendra.Client.exceptions.ThrottlingException

  • kendra.Client.exceptions.ServiceQuotaExceededException

  • kendra.Client.exceptions.AccessDeniedException

  • kendra.Client.exceptions.InternalServerException