Skip to content

update_index async

update_index(
    id: IndexId,
    *,
    config_overrides: Optional[AsynckendraClientConfig] = None,
    name: Optional[IndexName] = None,
    role_arn: Optional[RoleArn] = None,
    description: Optional[Description] = None,
    document_metadata_configuration_updates: Optional[
        DocumentMetadataConfigurationList
    ] = None,
    capacity_units: Optional[CapacityUnitsConfiguration] = None,
    user_token_configurations: Optional[UserTokenConfigurationList] = None,
    user_context_policy: Optional[UserContextPolicy] = None,
    user_group_resolution_configuration: Optional[
        UserGroupResolutionConfiguration
    ] = None,
) -> None

Updates an Amazon Kendra index.

Parameters:

  • id (IndexId) –

    The identifier of the index you want to update.

  • name (Optional[IndexName], default: None ) –

    A new name for the index.

  • role_arn (Optional[RoleArn], default: None ) –

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

  • description (Optional[Description], default: None ) –

    A new description for the index.

  • document_metadata_configuration_updates (Optional[DocumentMetadataConfigurationList], default: None ) –

    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.

  • capacity_units (Optional[CapacityUnitsConfiguration], default: None ) –

    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.

  • user_token_configurations (Optional[UserTokenConfigurationList], default: None ) –

    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.

  • user_context_policy (Optional[UserContextPolicy], default: None ) –

    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.

  • user_group_resolution_configuration (Optional[UserGroupResolutionConfiguration], default: None ) –

    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.

Raises:

  • AccessDeniedException –

    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 –

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

  • InternalServerException –

    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 –

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

  • ServiceQuotaExceededException –

    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 –

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

  • ValidationException –

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

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_kendra/_services/async_kendra.py
async def update_index(
    self,
    id: "capo_kendra.types.index_id.IndexId",
    *,
    config_overrides: Optional[AsynckendraClientConfig] = None,
    name: Optional["capo_kendra.types.index_name.IndexName"] = None,
    role_arn: Optional["capo_kendra.types.role_arn.RoleArn"] = None,
    description: Optional["capo_kendra.types.description.Description"] = None,
    document_metadata_configuration_updates: Optional[
        "capo_kendra.types.document_metadata_configuration_list.DocumentMetadataConfigurationList"
    ] = None,
    capacity_units: Optional[
        "capo_kendra.types.capacity_units_configuration.CapacityUnitsConfiguration"
    ] = None,
    user_token_configurations: Optional[
        "capo_kendra.types.user_token_configuration_list.UserTokenConfigurationList"
    ] = None,
    user_context_policy: Optional[
        "capo_kendra.types.user_context_policy.UserContextPolicy"
    ] = None,
    user_group_resolution_configuration: Optional[
        "capo_kendra.types.user_group_resolution_configuration.UserGroupResolutionConfiguration"
    ] = None,
) -> None:
    """<p>Updates an Amazon Kendra index.</p>

    Args:
        id: <p>The identifier of the index you want to update.</p>
        name: <p>A new name for the index.</p>
        role_arn: <p>An Identity and Access Management (IAM) role that gives Amazon Kendra permission to access Amazon CloudWatch logs and metrics.</p>
        description: <p>A new description for the index.</p>
        document_metadata_configuration_updates: <p>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.</p>
        capacity_units: <p>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.</p> <p>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.</p>
        user_token_configurations: <p>The user token configuration.</p> <important> <p>If you're using an Amazon Kendra Gen AI Enterprise Edition index and you try to use <code>UserTokenConfigurations</code> to configure user context policy, Amazon Kendra returns a <code>ValidationException</code> error.</p> </important>
        user_context_policy: <p>The user context policy.</p> <important> <p>If you're using an Amazon Kendra Gen AI Enterprise Edition index, you can only use <code>ATTRIBUTE_FILTER</code> to filter search results by user context. If you're using an Amazon Kendra Gen AI Enterprise Edition index and you try to use <code>USER_TOKEN</code> to configure user context policy, Amazon Kendra returns a <code>ValidationException</code> error.</p> </important>
        user_group_resolution_configuration: <p>Gets users and groups from IAM Identity Center identity source. To configure this, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_UserGroupResolutionConfiguration.html">UserGroupResolutionConfiguration</a>. This is useful for user context filtering, where search results are filtered based on the user or their group access to documents.</p> <important> <p>If you're using an Amazon Kendra Gen AI Enterprise Edition index, <code>UserGroupResolutionConfiguration</code> isn't supported.</p> </important>

    Raises:
        capo_kendra.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this action. Please ensure you have the required permission policies and user accounts and try again.</p>
        capo_kendra.errors.conflict_exception.ConflictException: <p>A conflict occurred with the request. Please fix any inconsistences with your resources and try again.</p>
        capo_kendra.errors.internal_server_exception.InternalServerException: <p>An issue occurred with the internal server used for your Amazon Kendra service. Please wait a few minutes and try again, or contact <a href="http://aws.amazon.com/contact-us/">Support</a> for help.</p>
        capo_kendra.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource you want to use doesn’t exist. Please check you have provided the correct resource and try again.</p>
        capo_kendra.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have exceeded the set limits for your Amazon Kendra service. Please see <a href="https://docs.aws.amazon.com/kendra/latest/dg/quotas.html">Quotas</a> for more information, or contact <a href="http://aws.amazon.com/contact-us/">Support</a> to inquire about an increase of limits.</p>
        capo_kendra.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Please reduce the number of requests and try again.</p>
        capo_kendra.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints set by the Amazon Kendra service. Please provide the correct input and try again.</p>
        capo_kendra.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_kendra.types.update_index_request.UpdateIndexRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_kendra._operations.aws_kendra_frontend_service.update_index

        (
            output,
            http_response,
        ) = await capo_kendra._operations.aws_kendra_frontend_service.update_index.async_update_index(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateIndex")
    )
    input_: capo_kendra.types.update_index_request.UpdateIndexRequest = {"id": id}
    if name is not None:
        input_["name"] = name
    if role_arn is not None:
        input_["role_arn"] = role_arn
    if description is not None:
        input_["description"] = description
    if document_metadata_configuration_updates is not None:
        input_["document_metadata_configuration_updates"] = (
            document_metadata_configuration_updates
        )
    if capacity_units is not None:
        input_["capacity_units"] = capacity_units
    if user_token_configurations is not None:
        input_["user_token_configurations"] = user_token_configurations
    if user_context_policy is not None:
        input_["user_context_policy"] = user_context_policy
    if user_group_resolution_configuration is not None:
        input_["user_group_resolution_configuration"] = (
            user_group_resolution_configuration
        )

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output