

# CreateIndex
<a name="API_CreateIndex"></a>

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](https://docs.aws.amazon.com/kendra/latest/dg/data-sources.html).

For an example of creating an index and data source using the Python SDK, see [Getting started with Python SDK](https://docs.aws.amazon.com/kendra/latest/dg/gs-python.html). For an example of creating an index and data source using the Java SDK, see [Getting started with Java SDK](https://docs.aws.amazon.com/kendra/latest/dg/gs-java.html).

## Request Syntax
<a name="API_CreateIndex_RequestSyntax"></a>

```
{
   "ClientToken": "string",
   "Description": "string",
   "Edition": "string",
   "Name": "string",
   "RoleArn": "string",
   "ServerSideEncryptionConfiguration": { 
      "KmsKeyId": "string"
   },
   "Tags": [ 
      { 
         "Key": "string",
         "Value": "string"
      }
   ],
   "UserContextPolicy": "string",
   "UserGroupResolutionConfiguration": { 
      "UserGroupResolutionMode": "string"
   },
   "UserTokenConfigurations": [ 
      { 
         "JsonTokenTypeConfiguration": { 
            "GroupAttributeField": "string",
            "UserNameAttributeField": "string"
         },
         "JwtTokenTypeConfiguration": { 
            "ClaimRegex": "string",
            "GroupAttributeField": "string",
            "Issuer": "string",
            "KeyLocation": "string",
            "SecretManagerArn": "string",
            "URL": "string",
            "UserNameAttributeField": "string"
         }
      }
   ]
}
```

## Request Parameters
<a name="API_CreateIndex_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [ClientToken](#API_CreateIndex_RequestSyntax) **   <a name="kendra-CreateIndex-request-ClientToken"></a>
A token that you provide to identify the request to create an index. Multiple calls to the `CreateIndex` API with the same client token will create only one index.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 100.  
Required: No

 ** [Description](#API_CreateIndex_RequestSyntax) **   <a name="kendra-CreateIndex-request-Description"></a>
A description for the index.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1000.  
Pattern: `^\P{C}*$`   
Required: No

 ** [Edition](#API_CreateIndex_RequestSyntax) **   <a name="kendra-CreateIndex-request-Edition"></a>
The Amazon Kendra edition to use for the index. Choose `DEVELOPER_EDITION` for indexes intended for development, testing, or proof of concept. Use `ENTERPRISE_EDITION` for production. Use `GEN_AI_ENTERPRISE_EDITION` for creating generative AI applications. Once you set the edition for an index, it can't be changed.   
The `Edition` parameter is optional. If you don't supply a value, the default is `ENTERPRISE_EDITION`.  
For more information on quota limits for Gen AI Enterprise Edition, Enterprise Edition, and Developer Edition indices, see [Quotas](https://docs.aws.amazon.com/kendra/latest/dg/quotas.html).  
Type: String  
Valid Values: `DEVELOPER_EDITION | ENTERPRISE_EDITION | GEN_AI_ENTERPRISE_EDITION`   
Required: No

 ** [Name](#API_CreateIndex_RequestSyntax) **   <a name="kendra-CreateIndex-request-Name"></a>
A name for the index.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 1000.  
Pattern: `[a-zA-Z0-9][a-zA-Z0-9_-]*`   
Required: Yes

 ** [RoleArn](#API_CreateIndex_RequestSyntax) **   <a name="kendra-CreateIndex-request-RoleArn"></a>
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](https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html).  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1284.  
Pattern: `arn:[a-z0-9-\.]{1,63}:[a-z0-9-\.]{0,63}:[a-z0-9-\.]{0,63}:[a-z0-9-\.]{0,63}:[^/].{0,1023}`   
Required: Yes

 ** [ServerSideEncryptionConfiguration](#API_CreateIndex_RequestSyntax) **   <a name="kendra-CreateIndex-request-ServerSideEncryptionConfiguration"></a>
The identifier of the AWS KMS customer managed key (CMK) that's used to encrypt data indexed by Amazon Kendra. Amazon Kendra doesn't support asymmetric CMKs.  
Type: [ServerSideEncryptionConfiguration](API_ServerSideEncryptionConfiguration.md) object  
Required: No

 ** [Tags](#API_CreateIndex_RequestSyntax) **   <a name="kendra-CreateIndex-request-Tags"></a>
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: \$1 . : / = \$1 - @.  
Type: Array of [Tag](API_Tag.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 200 items.  
Required: No

 ** [UserContextPolicy](#API_CreateIndex_RequestSyntax) **   <a name="kendra-CreateIndex-request-UserContextPolicy"></a>
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.  
ATTRIBUTE\$1FILTER  
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_id` and `_group_ids` or you can provide user and group information in `UserContext`.   
USER\$1TOKEN  
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. 
Type: String  
Valid Values: `ATTRIBUTE_FILTER | USER_TOKEN`   
Required: No

 ** [UserGroupResolutionConfiguration](#API_CreateIndex_RequestSyntax) **   <a name="kendra-CreateIndex-request-UserGroupResolutionConfiguration"></a>
Gets users and groups from AWS IAM Identity Center identity source. To configure this, see [UserGroupResolutionConfiguration](https://docs.aws.amazon.com/kendra/latest/dg/API_UserGroupResolutionConfiguration.html). 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.
Type: [UserGroupResolutionConfiguration](API_UserGroupResolutionConfiguration.md) object  
Required: No

 ** [UserTokenConfigurations](#API_CreateIndex_RequestSyntax) **   <a name="kendra-CreateIndex-request-UserTokenConfigurations"></a>
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.
Type: Array of [UserTokenConfiguration](API_UserTokenConfiguration.md) objects  
Array Members: Maximum number of 1 item.  
Required: No

## Response Syntax
<a name="API_CreateIndex_ResponseSyntax"></a>

```
{
   "Id": "string"
}
```

## Response Elements
<a name="API_CreateIndex_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [Id](#API_CreateIndex_ResponseSyntax) **   <a name="kendra-CreateIndex-response-Id"></a>
The identifier of the index. Use this identifier when you query an index, set up a data source, or index a document.  
Type: String  
Length Constraints: Fixed length of 36.  
Pattern: `[a-zA-Z0-9][a-zA-Z0-9-]*` 

## Errors
<a name="API_CreateIndex_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** 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.  
HTTP Status Code: 400

 ** ConflictException **   
A conflict occurred with the request. Please fix any inconsistences with your resources and try again.  
HTTP Status Code: 400

 ** 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](http://aws.amazon.com/contact-us/) for help.  
HTTP Status Code: 500

 ** ResourceAlreadyExistException **   
The resource you want to use already exists. Please check you have provided the correct resource and try again.  
HTTP Status Code: 400

 ** ServiceQuotaExceededException **   
You have exceeded the set limits for your Amazon Kendra service. Please see [Quotas](https://docs.aws.amazon.com/kendra/latest/dg/quotas.html) for more information, or contact [Support](http://aws.amazon.com/contact-us/) to inquire about an increase of limits.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was denied due to request throttling. Please reduce the number of requests and try again.  
HTTP Status Code: 400

 ** ValidationException **   
The input fails to satisfy the constraints set by the Amazon Kendra service. Please provide the correct input and try again.  
HTTP Status Code: 400

## See Also
<a name="API_CreateIndex_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/kendra-2019-02-03/CreateIndex) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/kendra-2019-02-03/CreateIndex) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/kendra-2019-02-03/CreateIndex) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/kendra-2019-02-03/CreateIndex) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/kendra-2019-02-03/CreateIndex) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/kendra-2019-02-03/CreateIndex) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/kendra-2019-02-03/CreateIndex) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/kendra-2019-02-03/CreateIndex) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/kendra-2019-02-03/CreateIndex) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/kendra-2019-02-03/CreateIndex) 