UpdateIndexCommand

Updates an Amazon Kendra index.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { KendraClient, UpdateIndexCommand } from "@aws-sdk/client-kendra"; // ES Modules import
// const { KendraClient, UpdateIndexCommand } = require("@aws-sdk/client-kendra"); // CommonJS import
const client = new KendraClient(config);
const input = { // UpdateIndexRequest
  Id: "STRING_VALUE", // required
  Name: "STRING_VALUE",
  RoleArn: "STRING_VALUE",
  Description: "STRING_VALUE",
  DocumentMetadataConfigurationUpdates: [ // DocumentMetadataConfigurationList
    { // DocumentMetadataConfiguration
      Name: "STRING_VALUE", // required
      Type: "STRING_VALUE" || "STRING_LIST_VALUE" || "LONG_VALUE" || "DATE_VALUE", // required
      Relevance: { // Relevance
        Freshness: true || false,
        Importance: Number("int"),
        Duration: "STRING_VALUE",
        RankOrder: "ASCENDING" || "DESCENDING",
        ValueImportanceMap: { // ValueImportanceMap
          "<keys>": Number("int"),
        },
      },
      Search: { // Search
        Facetable: true || false,
        Searchable: true || false,
        Displayable: true || false,
        Sortable: true || false,
      },
    },
  ],
  CapacityUnits: { // CapacityUnitsConfiguration
    StorageCapacityUnits: Number("int"), // required
    QueryCapacityUnits: Number("int"), // required
  },
  UserTokenConfigurations: [ // UserTokenConfigurationList
    { // UserTokenConfiguration
      JwtTokenTypeConfiguration: { // JwtTokenTypeConfiguration
        KeyLocation: "URL" || "SECRET_MANAGER", // required
        URL: "STRING_VALUE",
        SecretManagerArn: "STRING_VALUE",
        UserNameAttributeField: "STRING_VALUE",
        GroupAttributeField: "STRING_VALUE",
        Issuer: "STRING_VALUE",
        ClaimRegex: "STRING_VALUE",
      },
      JsonTokenTypeConfiguration: { // JsonTokenTypeConfiguration
        UserNameAttributeField: "STRING_VALUE", // required
        GroupAttributeField: "STRING_VALUE", // required
      },
    },
  ],
  UserContextPolicy: "ATTRIBUTE_FILTER" || "USER_TOKEN",
  UserGroupResolutionConfiguration: { // UserGroupResolutionConfiguration
    UserGroupResolutionMode: "AWS_SSO" || "NONE", // required
  },
};
const command = new UpdateIndexCommand(input);
const response = await client.send(command);
// {};

UpdateIndexCommand Input

See UpdateIndexCommandInput for more details

Parameter
Type
Description
Id
Required
string | undefined

The identifier of the index you want to update.

CapacityUnits
CapacityUnitsConfiguration | undefined

Sets the number of additional document 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, or make 5 API calls.

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

Description
string | undefined

A new description for the index.

DocumentMetadataConfigurationUpdates
DocumentMetadataConfiguration[] | undefined

The document metadata configuration you want to update for the index. Document metadata are fields or attributes associated with your documents. For example, the company department name associated with each document.

Name
string | undefined

A new name for the index.

RoleArn
string | undefined

An Identity and Access Management (IAM) role that gives Amazon Kendra permission to access Amazon CloudWatch logs and metrics.

UserContextPolicy
UserContextPolicy | undefined

The user context policy.

If you're using an Amazon Kendra Gen AI Enterprise Edition index, you can only use ATTRIBUTE_FILTER to filter search results by user context. If you're using an Amazon Kendra Gen AI Enterprise Edition index and you try to use USER_TOKEN to configure user context policy, Amazon Kendra returns a ValidationException error.

UserGroupResolutionConfiguration
UserGroupResolutionConfiguration | undefined

Gets users and groups from IAM Identity Center identity source. To configure this, see UserGroupResolutionConfiguration . This is useful for user context filtering, where search results are filtered based on the user or their group access to documents.

If you're using an Amazon Kendra Gen AI Enterprise Edition index, UserGroupResolutionConfiguration isn't supported.

UserTokenConfigurations
UserTokenConfiguration[] | undefined

The user token configuration.

If you're using an Amazon Kendra Gen AI Enterprise Edition index and you try to use UserTokenConfigurations to configure user context policy, Amazon Kendra returns a ValidationException error.

UpdateIndexCommand Output

See UpdateIndexCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
AccessDeniedException
client

You don't have sufficient access to perform this action. Please ensure you have the required permission policies and user accounts and try again.

ConflictException
client

A conflict occurred with the request. Please fix any inconsistences with your resources and try again.

InternalServerException
server

An issue occurred with the internal server used for your Amazon Kendra service. Please wait a few minutes and try again, or contact Support  for help.

ResourceNotFoundException
client

The resource you want to use doesn’t exist. Please check you have provided the correct resource and try again.

ServiceQuotaExceededException
client

You have exceeded the set limits for your Amazon Kendra service. Please see Quotas  for more information, or contact Support  to inquire about an increase of limits.

ThrottlingException
client

The request was denied due to request throttling. Please reduce the number of requests and try again.

ValidationException
client

The input fails to satisfy the constraints set by the Amazon Kendra service. Please provide the correct input and try again.

KendraServiceException
Base exception class for all service exceptions from Kendra service.