AWSKendraFrontendService

2021/10/06 - AWSKendraFrontendService - 3 updated api methods

Changes  Amazon Kendra now supports integration with AWS SSO

CreateIndex (updated) Link ¶
Changes (request)
{'UserGroupResolutionConfiguration': {'UserGroupResolutionMode': 'AWS_SSO | '
                                                                 'NONE'}}

Creates a new Amazon Kendra index. Index creation is an asynchronous operation. To determine if index creation has completed, check the Status field returned from a call to DescribeIndex. The Status field is set to ACTIVE when the index is ready to use.

Once the index is active you can index your documents using the BatchPutDocument operation or using one of the supported data sources.

See also: AWS API Documentation

Request Syntax

client.create_index(
    Name='string',
    Edition='DEVELOPER_EDITION'|'ENTERPRISE_EDITION',
    RoleArn='string',
    ServerSideEncryptionConfiguration={
        'KmsKeyId': 'string'
    },
    Description='string',
    ClientToken='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    UserTokenConfigurations=[
        {
            'JwtTokenTypeConfiguration': {
                'KeyLocation': 'URL'|'SECRET_MANAGER',
                'URL': 'string',
                'SecretManagerArn': 'string',
                'UserNameAttributeField': 'string',
                'GroupAttributeField': 'string',
                'Issuer': 'string',
                'ClaimRegex': 'string'
            },
            'JsonTokenTypeConfiguration': {
                'UserNameAttributeField': 'string',
                'GroupAttributeField': 'string'
            }
        },
    ],
    UserContextPolicy='ATTRIBUTE_FILTER'|'USER_TOKEN',
    UserGroupResolutionConfiguration={
        'UserGroupResolutionMode': 'AWS_SSO'|'NONE'
    }
)
type Name:

string

param Name:

[REQUIRED]

The name for the new index.

type Edition:

string

param Edition:

The Amazon Kendra edition to use for the index. Choose DEVELOPER_EDITION for indexes intended for development, testing, or proof of concept. Use ENTERPRISE_EDITION for your production databases. Once you set the edition for an index, it can't be changed.

The Edition parameter is optional. If you don't supply a value, the default is ENTERPRISE_EDITION.

For more information on quota limits for enterprise and developer editions, see Quotas.

type RoleArn:

string

param RoleArn:

[REQUIRED]

An Identity and Access Management(IAM) role that gives Amazon Kendra permissions to access your Amazon CloudWatch logs and metrics. This is also the role used when you use the BatchPutDocument operation to index documents from an Amazon S3 bucket.

type ServerSideEncryptionConfiguration:

dict

param ServerSideEncryptionConfiguration:

The identifier of the KMScustomer managed key (CMK) to use to encrypt data indexed by Amazon Kendra. Amazon Kendra doesn't support asymmetric CMKs.

  • KmsKeyId (string) --

    The identifier of the KMScustomer master key (CMK). Amazon Kendra doesn't support asymmetric CMKs.

type Description:

string

param Description:

A description for the index.

type ClientToken:

string

param ClientToken:

A token that you provide to identify the request to create an index. Multiple calls to the CreateIndex operation with the same client token will create only one index.

This field is autopopulated if not provided.

type Tags:

list

param Tags:

A list of key-value pairs that identify the index. You can use the tags to identify and organize your resources and to control access to resources.

  • (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.

type UserTokenConfigurations:

list

param UserTokenConfigurations:

The user token configuration.

  • (dict) --

    Provides configuration information for a token configuration.

    • JwtTokenTypeConfiguration (dict) --

      Information about the JWT token type configuration.

      • KeyLocation (string) -- [REQUIRED]

        The location of the key.

      • URL (string) --

        The signing key URL.

      • SecretManagerArn (string) --

        The Amazon Resource Name (arn) of the secret.

      • UserNameAttributeField (string) --

        The user name attribute field.

      • GroupAttributeField (string) --

        The group attribute field.

      • Issuer (string) --

        The issuer of the token.

      • ClaimRegex (string) --

        The regular expression that identifies the claim.

    • JsonTokenTypeConfiguration (dict) --

      Information about the JSON token type configuration.

      • UserNameAttributeField (string) -- [REQUIRED]

        The user name attribute field.

      • GroupAttributeField (string) -- [REQUIRED]

        The group attribute field.

type UserContextPolicy:

string

param UserContextPolicy:

The user context policy.

ATTRIBUTE_FILTER

All indexed content is searchable and displayable for all users. If you want to filter search results on user context, you can use the attribute filters of _user_id and _group_ids or you can provide user and group information in UserContext.

USER_TOKEN

Enables token-based user access control to filter search results on user context. All documents with no access control and all documents accessible to the user will be searchable and displayable.

type UserGroupResolutionConfiguration:

dict

param UserGroupResolutionConfiguration:

Enables fetching access levels of groups and users from an AWS Single Sign-On identity source. To configure this, see UserGroupResolutionConfiguration.

  • UserGroupResolutionMode (string) -- [REQUIRED]

    The identity store provider (mode) you want to use to fetch access levels of groups and users. AWS Single Sign-On is currently the only available mode. Your users and groups must exist in an AWS SSO identity source in order to use this mode.

rtype:

dict

returns:

Response Syntax

{
    'Id': 'string'
}

Response Structure

  • (dict) --

    • Id (string) --

      The unique identifier of the index. Use this identifier when you query an index, set up a data source, or index a document.

DescribeIndex (updated) Link ¶
Changes (response)
{'UserGroupResolutionConfiguration': {'UserGroupResolutionMode': 'AWS_SSO | '
                                                                 'NONE'}}

Describes an existing Amazon Kendra index

See also: AWS API Documentation

Request Syntax

client.describe_index(
    Id='string'
)
type Id:

string

param Id:

[REQUIRED]

The name of the index to describe.

rtype:

dict

returns:

Response Syntax

{
    'Name': 'string',
    'Id': 'string',
    'Edition': 'DEVELOPER_EDITION'|'ENTERPRISE_EDITION',
    'RoleArn': 'string',
    'ServerSideEncryptionConfiguration': {
        'KmsKeyId': 'string'
    },
    'Status': 'CREATING'|'ACTIVE'|'DELETING'|'FAILED'|'UPDATING'|'SYSTEM_UPDATING',
    'Description': 'string',
    'CreatedAt': datetime(2015, 1, 1),
    'UpdatedAt': datetime(2015, 1, 1),
    'DocumentMetadataConfigurations': [
        {
            'Name': 'string',
            'Type': 'STRING_VALUE'|'STRING_LIST_VALUE'|'LONG_VALUE'|'DATE_VALUE',
            'Relevance': {
                'Freshness': True|False,
                'Importance': 123,
                'Duration': 'string',
                'RankOrder': 'ASCENDING'|'DESCENDING',
                'ValueImportanceMap': {
                    'string': 123
                }
            },
            'Search': {
                'Facetable': True|False,
                'Searchable': True|False,
                'Displayable': True|False,
                'Sortable': True|False
            }
        },
    ],
    'IndexStatistics': {
        'FaqStatistics': {
            'IndexedQuestionAnswersCount': 123
        },
        'TextDocumentStatistics': {
            'IndexedTextDocumentsCount': 123,
            'IndexedTextBytes': 123
        }
    },
    'ErrorMessage': 'string',
    'CapacityUnits': {
        'StorageCapacityUnits': 123,
        'QueryCapacityUnits': 123
    },
    'UserTokenConfigurations': [
        {
            'JwtTokenTypeConfiguration': {
                'KeyLocation': 'URL'|'SECRET_MANAGER',
                'URL': 'string',
                'SecretManagerArn': 'string',
                'UserNameAttributeField': 'string',
                'GroupAttributeField': 'string',
                'Issuer': 'string',
                'ClaimRegex': 'string'
            },
            'JsonTokenTypeConfiguration': {
                'UserNameAttributeField': 'string',
                'GroupAttributeField': 'string'
            }
        },
    ],
    'UserContextPolicy': 'ATTRIBUTE_FILTER'|'USER_TOKEN',
    'UserGroupResolutionConfiguration': {
        'UserGroupResolutionMode': 'AWS_SSO'|'NONE'
    }
}

Response Structure

  • (dict) --

    • Name (string) --

      The name of the index.

    • Id (string) --

      The name of the index.

    • Edition (string) --

      The Amazon Kendra edition used for the index. You decide the edition when you create the index.

    • RoleArn (string) --

      The Amazon Resource Name (ARN) of the IAM role that gives Amazon Kendra permission to write to your Amazon Cloudwatch logs.

    • ServerSideEncryptionConfiguration (dict) --

      The identifier of the KMScustomer master key (CMK) used to encrypt your data. Amazon Kendra doesn't support asymmetric CMKs.

      • KmsKeyId (string) --

        The identifier of the KMScustomer master key (CMK). Amazon Kendra doesn't support asymmetric CMKs.

    • Status (string) --

      The current status of the index. When the value is ACTIVE, the index is ready for use. If the Status field value is FAILED, the ErrorMessage field contains a message that explains why.

    • Description (string) --

      The description of the index.

    • CreatedAt (datetime) --

      The Unix datetime that the index was created.

    • UpdatedAt (datetime) --

      The Unix datetime that the index was last updated.

    • DocumentMetadataConfigurations (list) --

      Configuration settings for any metadata applied to the documents in the index.

      • (dict) --

        Specifies the properties of a custom index field.

        • Name (string) --

          The name of the index field.

        • Type (string) --

          The data type of the index field.

        • Relevance (dict) --

          Provides manual tuning parameters to determine how the field affects the search results.

          • Freshness (boolean) --

            Indicates that this field determines how "fresh" a document is. For example, if document 1 was created on November 5, and document 2 was created on October 31, document 1 is "fresher" than document 2. You can only set the Freshness field on one DATE type field. Only applies to DATE fields.

          • Importance (integer) --

            The relative importance of the field in the search. Larger numbers provide more of a boost than smaller numbers.

          • Duration (string) --

            Specifies the time period that the boost applies to. For example, to make the boost apply to documents with the field value within the last month, you would use "2628000s". Once the field value is beyond the specified range, the effect of the boost drops off. The higher the importance, the faster the effect drops off. If you don't specify a value, the default is 3 months. The value of the field is a numeric string followed by the character "s", for example "86400s" for one day, or "604800s" for one week.

            Only applies to DATE fields.

          • RankOrder (string) --

            Determines how values should be interpreted.

            When the RankOrder field is ASCENDING, higher numbers are better. For example, a document with a rating score of 10 is higher ranking than a document with a rating score of 1.

            When the RankOrder field is DESCENDING, lower numbers are better. For example, in a task tracking application, a priority 1 task is more important than a priority 5 task.

            Only applies to LONG and DOUBLE fields.

          • ValueImportanceMap (dict) --

            A list of values that should be given a different boost when they appear in the result list. For example, if you are boosting a field called "department," query terms that match the department field are boosted in the result. However, you can add entries from the department field to boost documents with those values higher.

            For example, you can add entries to the map with names of departments. If you add "HR",5 and "Legal",3 those departments are given special attention when they appear in the metadata of a document. When those terms appear they are given the specified importance instead of the regular importance for the boost.

            • (string) --

              • (integer) --

        • Search (dict) --

          Provides information about how the field is used during a search.

          • Facetable (boolean) --

            Indicates that the field can be used to create search facets, a count of results for each value in the field. The default is false .

          • Searchable (boolean) --

            Determines whether the field is used in the search. If the Searchable field is true, you can use relevance tuning to manually tune how Amazon Kendra weights the field in the search. The default is true for string fields and false for number and date fields.

          • Displayable (boolean) --

            Determines whether the field is returned in the query response. The default is true.

          • Sortable (boolean) --

            Determines whether the field can be used to sort the results of a query. If you specify sorting on a field that does not have Sortable set to true, Amazon Kendra returns an exception. The default is false.

    • IndexStatistics (dict) --

      Provides information about the number of FAQ questions and answers and the number of text documents indexed.

      • FaqStatistics (dict) --

        The number of question and answer topics in the index.

        • IndexedQuestionAnswersCount (integer) --

          The total number of FAQ questions and answers contained in the index.

      • TextDocumentStatistics (dict) --

        The number of text documents indexed.

        • IndexedTextDocumentsCount (integer) --

          The number of text documents indexed.

        • IndexedTextBytes (integer) --

          The total size, in bytes, of the indexed documents.

    • ErrorMessage (string) --

      When th e Status field value is FAILED, the ErrorMessage field contains a message that explains why.

    • CapacityUnits (dict) --

      For Enterprise edition indexes, you can choose to use additional capacity to meet the needs of your application. This contains the capacity units used for the index. A 0 for the query capacity or the storage capacity indicates that the index is using the default capacity for the index.

      • StorageCapacityUnits (integer) --

        The amount of extra storage capacity for an index. A single capacity unit provides 30 GB of storage space or 100,000 documents, whichever is reached first.

      • QueryCapacityUnits (integer) --

        The amount of extra query capacity for an index and GetQuerySuggestions capacity.

        A single extra capacity unit for an index provides 0.1 queries per second or approximately 8,000 queries per day.

        GetQuerySuggestions capacity is five times the provisioned query capacity for an index, or the base capacity of 2.5 calls per second, whichever is higher. For example, the base capacity for an index is 0.1 queries per second, and GetQuerySuggestions capacity has a base of 2.5 calls per second. If you add another 0.1 queries per second to total 0.2 queries per second for an index, the GetQuerySuggestions capacity is 2.5 calls per second (higher than five times 0.2 queries per second).

    • UserTokenConfigurations (list) --

      The user token configuration for the Amazon Kendra index.

      • (dict) --

        Provides configuration information for a token configuration.

        • JwtTokenTypeConfiguration (dict) --

          Information about the JWT token type configuration.

          • KeyLocation (string) --

            The location of the key.

          • URL (string) --

            The signing key URL.

          • SecretManagerArn (string) --

            The Amazon Resource Name (arn) of the secret.

          • UserNameAttributeField (string) --

            The user name attribute field.

          • GroupAttributeField (string) --

            The group attribute field.

          • Issuer (string) --

            The issuer of the token.

          • ClaimRegex (string) --

            The regular expression that identifies the claim.

        • JsonTokenTypeConfiguration (dict) --

          Information about the JSON token type configuration.

          • UserNameAttributeField (string) --

            The user name attribute field.

          • GroupAttributeField (string) --

            The group attribute field.

    • UserContextPolicy (string) --

      The user context policy for the Amazon Kendra index.

    • UserGroupResolutionConfiguration (dict) --

      Shows whether you have enabled the configuration for fetching access levels of groups and users from an AWS Single Sign-On identity source.

      • UserGroupResolutionMode (string) --

        The identity store provider (mode) you want to use to fetch access levels of groups and users. AWS Single Sign-On is currently the only available mode. Your users and groups must exist in an AWS SSO identity source in order to use this mode.

UpdateIndex (updated) Link ¶
Changes (request)
{'UserGroupResolutionConfiguration': {'UserGroupResolutionMode': 'AWS_SSO | '
                                                                 'NONE'}}

Updates an existing Amazon Kendra index.

See also: AWS API Documentation

Request Syntax

client.update_index(
    Id='string',
    Name='string',
    RoleArn='string',
    Description='string',
    DocumentMetadataConfigurationUpdates=[
        {
            'Name': 'string',
            'Type': 'STRING_VALUE'|'STRING_LIST_VALUE'|'LONG_VALUE'|'DATE_VALUE',
            'Relevance': {
                'Freshness': True|False,
                'Importance': 123,
                'Duration': 'string',
                'RankOrder': 'ASCENDING'|'DESCENDING',
                'ValueImportanceMap': {
                    'string': 123
                }
            },
            'Search': {
                'Facetable': True|False,
                'Searchable': True|False,
                'Displayable': True|False,
                'Sortable': True|False
            }
        },
    ],
    CapacityUnits={
        'StorageCapacityUnits': 123,
        'QueryCapacityUnits': 123
    },
    UserTokenConfigurations=[
        {
            'JwtTokenTypeConfiguration': {
                'KeyLocation': 'URL'|'SECRET_MANAGER',
                'URL': 'string',
                'SecretManagerArn': 'string',
                'UserNameAttributeField': 'string',
                'GroupAttributeField': 'string',
                'Issuer': 'string',
                'ClaimRegex': 'string'
            },
            'JsonTokenTypeConfiguration': {
                'UserNameAttributeField': 'string',
                'GroupAttributeField': 'string'
            }
        },
    ],
    UserContextPolicy='ATTRIBUTE_FILTER'|'USER_TOKEN',
    UserGroupResolutionConfiguration={
        'UserGroupResolutionMode': 'AWS_SSO'|'NONE'
    }
)
type Id:

string

param Id:

[REQUIRED]

The identifier of the index to update.

type Name:

string

param Name:

The name of the index to update.

type RoleArn:

string

param RoleArn:

A new IAM role that gives Amazon Kendra permission to access your Amazon CloudWatch logs.

type Description:

string

param Description:

A new description for the index.

type DocumentMetadataConfigurationUpdates:

list

param DocumentMetadataConfigurationUpdates:

The document metadata to update.

  • (dict) --

    Specifies the properties of a custom index field.

    • Name (string) -- [REQUIRED]

      The name of the index field.

    • Type (string) -- [REQUIRED]

      The data type of the index field.

    • Relevance (dict) --

      Provides manual tuning parameters to determine how the field affects the search results.

      • Freshness (boolean) --

        Indicates that this field determines how "fresh" a document is. For example, if document 1 was created on November 5, and document 2 was created on October 31, document 1 is "fresher" than document 2. You can only set the Freshness field on one DATE type field. Only applies to DATE fields.

      • Importance (integer) --

        The relative importance of the field in the search. Larger numbers provide more of a boost than smaller numbers.

      • Duration (string) --

        Specifies the time period that the boost applies to. For example, to make the boost apply to documents with the field value within the last month, you would use "2628000s". Once the field value is beyond the specified range, the effect of the boost drops off. The higher the importance, the faster the effect drops off. If you don't specify a value, the default is 3 months. The value of the field is a numeric string followed by the character "s", for example "86400s" for one day, or "604800s" for one week.

        Only applies to DATE fields.

      • RankOrder (string) --

        Determines how values should be interpreted.

        When the RankOrder field is ASCENDING, higher numbers are better. For example, a document with a rating score of 10 is higher ranking than a document with a rating score of 1.

        When the RankOrder field is DESCENDING, lower numbers are better. For example, in a task tracking application, a priority 1 task is more important than a priority 5 task.

        Only applies to LONG and DOUBLE fields.

      • ValueImportanceMap (dict) --

        A list of values that should be given a different boost when they appear in the result list. For example, if you are boosting a field called "department," query terms that match the department field are boosted in the result. However, you can add entries from the department field to boost documents with those values higher.

        For example, you can add entries to the map with names of departments. If you add "HR",5 and "Legal",3 those departments are given special attention when they appear in the metadata of a document. When those terms appear they are given the specified importance instead of the regular importance for the boost.

        • (string) --

          • (integer) --

    • Search (dict) --

      Provides information about how the field is used during a search.

      • Facetable (boolean) --

        Indicates that the field can be used to create search facets, a count of results for each value in the field. The default is false .

      • Searchable (boolean) --

        Determines whether the field is used in the search. If the Searchable field is true, you can use relevance tuning to manually tune how Amazon Kendra weights the field in the search. The default is true for string fields and false for number and date fields.

      • Displayable (boolean) --

        Determines whether the field is returned in the query response. The default is true.

      • Sortable (boolean) --

        Determines whether the field can be used to sort the results of a query. If you specify sorting on a field that does not have Sortable set to true, Amazon Kendra returns an exception. The default is false.

type CapacityUnits:

dict

param CapacityUnits:

Sets the number of additional storage and query capacity units that should be used by the index. You can change the capacity of the index up to 5 times per day.

If you are using extra storage units, you can't reduce the storage capacity below that required to meet the storage needs for your index.

  • StorageCapacityUnits (integer) -- [REQUIRED]

    The amount of extra storage capacity for an index. A single capacity unit provides 30 GB of storage space or 100,000 documents, whichever is reached first.

  • QueryCapacityUnits (integer) -- [REQUIRED]

    The amount of extra query capacity for an index and GetQuerySuggestions capacity.

    A single extra capacity unit for an index provides 0.1 queries per second or approximately 8,000 queries per day.

    GetQuerySuggestions capacity is five times the provisioned query capacity for an index, or the base capacity of 2.5 calls per second, whichever is higher. For example, the base capacity for an index is 0.1 queries per second, and GetQuerySuggestions capacity has a base of 2.5 calls per second. If you add another 0.1 queries per second to total 0.2 queries per second for an index, the GetQuerySuggestions capacity is 2.5 calls per second (higher than five times 0.2 queries per second).

type UserTokenConfigurations:

list

param UserTokenConfigurations:

The user token configuration.

  • (dict) --

    Provides configuration information for a token configuration.

    • JwtTokenTypeConfiguration (dict) --

      Information about the JWT token type configuration.

      • KeyLocation (string) -- [REQUIRED]

        The location of the key.

      • URL (string) --

        The signing key URL.

      • SecretManagerArn (string) --

        The Amazon Resource Name (arn) of the secret.

      • UserNameAttributeField (string) --

        The user name attribute field.

      • GroupAttributeField (string) --

        The group attribute field.

      • Issuer (string) --

        The issuer of the token.

      • ClaimRegex (string) --

        The regular expression that identifies the claim.

    • JsonTokenTypeConfiguration (dict) --

      Information about the JSON token type configuration.

      • UserNameAttributeField (string) -- [REQUIRED]

        The user name attribute field.

      • GroupAttributeField (string) -- [REQUIRED]

        The group attribute field.

type UserContextPolicy:

string

param UserContextPolicy:

The user context policy.

type UserGroupResolutionConfiguration:

dict

param UserGroupResolutionConfiguration:

Enables fetching access levels of groups and users from an AWS Single Sign-On identity source. To configure this, see UserGroupResolutionConfiguration.

  • UserGroupResolutionMode (string) -- [REQUIRED]

    The identity store provider (mode) you want to use to fetch access levels of groups and users. AWS Single Sign-On is currently the only available mode. Your users and groups must exist in an AWS SSO identity source in order to use this mode.

returns:

None