updateAccessControlConfiguration method

Future<void> updateAccessControlConfiguration({
  1. required String id,
  2. required String indexId,
  3. List<Principal>? accessControlList,
  4. String? description,
  5. List<HierarchicalPrincipal>? hierarchicalAccessControlList,
  6. String? name,
})

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.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter id : The identifier of the access control configuration you want to update.

Parameter indexId : The identifier of the index for an access control configuration.

Parameter accessControlList : 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.

Parameter description : A new description for the access control configuration.

Parameter hierarchicalAccessControlList : The updated list of principal lists that define the hierarchy for which documents users should have access to.

Parameter name : A new name for the access control configuration.

Implementation

Future<void> updateAccessControlConfiguration({
  required String id,
  required String indexId,
  List<Principal>? accessControlList,
  String? description,
  List<HierarchicalPrincipal>? hierarchicalAccessControlList,
  String? name,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'AWSKendraFrontendService.UpdateAccessControlConfiguration'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Id': id,
      'IndexId': indexId,
      if (accessControlList != null) 'AccessControlList': accessControlList,
      if (description != null) 'Description': description,
      if (hierarchicalAccessControlList != null)
        'HierarchicalAccessControlList': hierarchicalAccessControlList,
      if (name != null) 'Name': name,
    },
  );
}