Updates an access control configuration for your documents in an index. This includes user and group access information for your documents. This is useful for user context filtering, where search results are filtered based on the user or their group access to documents.
You can update an access control configuration you created without indexing all of your documents again. For example, your index contains top-secret company documents that only certain employees or users should access. You created an 'allow' access control configuration for one user who recently joined the 'top-secret' team, switching from a team with 'deny' access to top-secret documents. However, the user suddenly returns to their previous team and should no longer have access to top secret documents. You can update the access control configuration to re-configure access control for your documents as circumstances change.
You call the BatchPutDocument API to apply the updated access control configuration, with the AccessControlConfigurationId included in the Document object. If you use an S3 bucket as a data source, you synchronize your data source to apply the AccessControlConfigurationId in the .metadata.json file. Amazon Kendra currently only supports access control configuration for S3 data sources and documents indexed using the BatchPutDocument API.
You can't configure access control using CreateAccessControlConfiguration for an Amazon Kendra Gen AI Enterprise Edition index. Amazon Kendra will return a ValidationException error for a Gen_AI_ENTERPRISE_EDITION index.
Parameters:
-
index_id
(IndexId)
–
The identifier of the index for an access control configuration.
-
id
(AccessControlConfigurationId)
–
The identifier of the access control configuration you want to update.
-
name
(Optional[AccessControlConfigurationName], default:
None
)
–
A new name for the access control configuration.
-
description
(Optional[Description], default:
None
)
–
A new description for the access control configuration.
-
access_control_list
(Optional[PrincipalList], default:
None
)
–
Information you want to update on principals (users and/or groups) and which documents they should have access to. This is useful for user context filtering, where search results are filtered based on the user or their group access to documents.
-
hierarchical_access_control_list
(Optional[HierarchicalPrincipalList], default:
None
)
–
The updated list of principal lists that define the hierarchy for which documents users should have access to.
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_access_control_configuration(
self,
index_id: "capo_kendra.types.index_id.IndexId",
id: "capo_kendra.types.access_control_configuration_id.AccessControlConfigurationId",
*,
config_overrides: Optional[AsynckendraClientConfig] = None,
name: Optional[
"capo_kendra.types.access_control_configuration_name.AccessControlConfigurationName"
] = None,
description: Optional["capo_kendra.types.description.Description"] = None,
access_control_list: Optional[
"capo_kendra.types.principal_list.PrincipalList"
] = None,
hierarchical_access_control_list: Optional[
"capo_kendra.types.hierarchical_principal_list.HierarchicalPrincipalList"
] = None,
) -> "capo_kendra.types.update_access_control_configuration_response.UpdateAccessControlConfigurationResponse":
"""<p>Updates an access control configuration for your documents in an index. This includes user and group access information for your documents. This is useful for user context filtering, where search results are filtered based on the user or their group access to documents.</p> <p>You can update an access control configuration you created without indexing all of your documents again. For example, your index contains top-secret company documents that only certain employees or users should access. You created an 'allow' access control configuration for one user who recently joined the 'top-secret' team, switching from a team with 'deny' access to top-secret documents. However, the user suddenly returns to their previous team and should no longer have access to top secret documents. You can update the access control configuration to re-configure access control for your documents as circumstances change.</p> <p>You call the <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_BatchPutDocument.html">BatchPutDocument</a> API to apply the updated access control configuration, with the <code>AccessControlConfigurationId</code> included in the <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_Document.html">Document</a> object. If you use an S3 bucket as a data source, you synchronize your data source to apply the <code>AccessControlConfigurationId</code> in the <code>.metadata.json</code> file. Amazon Kendra currently only supports access control configuration for S3 data sources and documents indexed using the <code>BatchPutDocument</code> API.</p> <important> <p>You can't configure access control using <code>CreateAccessControlConfiguration</code> for an Amazon Kendra Gen AI Enterprise Edition index. Amazon Kendra will return a <code>ValidationException</code> error for a <code>Gen_AI_ENTERPRISE_EDITION</code> index.</p> </important>
Args:
index_id: <p>The identifier of the index for an access control configuration.</p>
id: <p>The identifier of the access control configuration you want to update.</p>
name: <p>A new name for the access control configuration.</p>
description: <p>A new description for the access control configuration.</p>
access_control_list: <p>Information you want to update on principals (users and/or groups) and which documents they should have access to. This is useful for user context filtering, where search results are filtered based on the user or their group access to documents.</p>
hierarchical_access_control_list: <p>The updated list of <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_Principal.html">principal</a> lists that define the hierarchy for which documents users should have access to.</p>
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_access_control_configuration_request.UpdateAccessControlConfigurationRequest]",
) -> AsyncOperationResponse[
"capo_kendra.types.update_access_control_configuration_response.UpdateAccessControlConfigurationResponse"
]:
import capo_kendra._operations.aws_kendra_frontend_service.update_access_control_configuration
(
output,
http_response,
) = await capo_kendra._operations.aws_kendra_frontend_service.update_access_control_configuration.async_update_access_control_configuration(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateAccessControlConfiguration")
)
input_: capo_kendra.types.update_access_control_configuration_request.UpdateAccessControlConfigurationRequest = {
"index_id": index_id,
"id": id,
}
if name is not None:
input_["name"] = name
if description is not None:
input_["description"] = description
if access_control_list is not None:
input_["access_control_list"] = access_control_list
if hierarchical_access_control_list is not None:
input_["hierarchical_access_control_list"] = (
hierarchical_access_control_list
)
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|