create_index
async
¶
create_index(
name: IndexName,
role_arn: RoleArn,
*,
config_overrides: Optional[AsynckendraClientConfig] = None,
edition: Optional[IndexEdition] = None,
server_side_encryption_configuration: Optional[
ServerSideEncryptionConfiguration
] = None,
description: Optional[Description] = None,
client_token: Optional[ClientTokenName] = None,
tags: Optional[TagList] = None,
user_token_configurations: Optional[UserTokenConfigurationList] = None,
user_context_policy: Optional[UserContextPolicy] = None,
user_group_resolution_configuration: Optional[
UserGroupResolutionConfiguration
] = None,
) -> CreateIndexResponse
Creates an Amazon Kendra index. Index creation is an asynchronous API. 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 API or using one of the supported data sources.
For an example of creating an index and data source using the Python SDK, see Getting started with Python SDK. For an example of creating an index and data source using the Java SDK, see Getting started with Java SDK.
Parameters:
-
name(IndexName) –A name for the index.
-
edition(Optional[IndexEdition], default:None) –The Amazon Kendra edition to use for the index. Choose
DEVELOPER_EDITIONfor indexes intended for development, testing, or proof of concept. UseENTERPRISE_EDITIONfor production. UseGEN_AI_ENTERPRISE_EDITIONfor creating generative AI applications. Once you set the edition for an index, it can't be changed.The
Editionparameter is optional. If you don't supply a value, the default isENTERPRISE_EDITION.For more information on quota limits for Gen AI Enterprise Edition, Enterprise Edition, and Developer Edition indices, see Quotas.
-
role_arn(RoleArn) –The Amazon Resource Name (ARN) of an IAM role with permission to access your Amazon CloudWatch logs and metrics. For more information, see IAM access roles for Amazon Kendra.
-
server_side_encryption_configuration(Optional[ServerSideEncryptionConfiguration], default:None) –The identifier of the KMS customer managed key (CMK) that's used to encrypt data indexed by Amazon Kendra. Amazon Kendra doesn't support asymmetric CMKs.
-
description(Optional[Description], default:None) –A description for the index.
-
client_token(Optional[ClientTokenName], default:None) –A token that you provide to identify the request to create an index. Multiple calls to the
CreateIndexAPI with the same client token will create only one index. -
tags(Optional[TagList], default:None) –A list of key-value pairs that identify or categorize the index. You can also use tags to help control access to the index. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.
-
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
UserTokenConfigurationsto configure user context policy, Amazon Kendra returns aValidationExceptionerror. -
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_FILTERto filter search results by user context. If you're using an Amazon Kendra Gen AI Enterprise Edition index and you try to useUSER_TOKENto configure user context policy, Amazon Kendra returns aValidationExceptionerror.- 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_idand_group_idsor you can provide user and group information inUserContext. - 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.
-
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,
UserGroupResolutionConfigurationisn'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.
-
ResourceAlreadyExistException–The resource you want to use already exists. Please check you have provided the correct resource and try again.
-
ServiceQuotaExceededException– -
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
1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 | |