The aws:kendra/index:Index resource, part of the Pulumi AWS provider, provisions an Amazon Kendra index that stores and searches enterprise documents. This guide focuses on four capabilities: basic index creation with IAM roles, capacity scaling and encryption, access control via AWS SSO and JWT, and metadata field configuration.
Kendra indexes require IAM roles with permissions for CloudWatch, S3, and document ingestion. Access control features depend on AWS SSO or JWT integration. The examples are intentionally small. Combine them with your own data sources, query configuration, and document ingestion pipelines.
Create a basic index with name and IAM role
Most deployments start by creating an index with a name, edition, and IAM role for CloudWatch and S3 access.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.kendra.Index("example", {
name: "example",
description: "example",
edition: "DEVELOPER_EDITION",
roleArn: _this.arn,
tags: {
Key1: "Value1",
},
});
import pulumi
import pulumi_aws as aws
example = aws.kendra.Index("example",
name="example",
description="example",
edition="DEVELOPER_EDITION",
role_arn=this["arn"],
tags={
"Key1": "Value1",
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/kendra"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := kendra.NewIndex(ctx, "example", &kendra.IndexArgs{
Name: pulumi.String("example"),
Description: pulumi.String("example"),
Edition: pulumi.String("DEVELOPER_EDITION"),
RoleArn: pulumi.Any(this.Arn),
Tags: pulumi.StringMap{
"Key1": pulumi.String("Value1"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Kendra.Index("example", new()
{
Name = "example",
Description = "example",
Edition = "DEVELOPER_EDITION",
RoleArn = @this.Arn,
Tags =
{
{ "Key1", "Value1" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.kendra.Index;
import com.pulumi.aws.kendra.IndexArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Index("example", IndexArgs.builder()
.name("example")
.description("example")
.edition("DEVELOPER_EDITION")
.roleArn(this_.arn())
.tags(Map.of("Key1", "Value1"))
.build());
}
}
resources:
example:
type: aws:kendra:Index
properties:
name: example
description: example
edition: DEVELOPER_EDITION
roleArn: ${this.arn}
tags:
Key1: Value1
The edition property determines the index tier: DEVELOPER_EDITION for testing, ENTERPRISE_EDITION for production workloads. The roleArn grants Kendra permissions to write CloudWatch logs and read documents from S3 during ingestion. The index starts with default capacity and no encryption.
Scale query and storage capacity with capacity units
Production indexes often need more query throughput or document storage than the default allocation.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.kendra.Index("example", {
name: "example",
edition: "DEVELOPER_EDITION",
roleArn: _this.arn,
capacityUnits: {
queryCapacityUnits: 2,
storageCapacityUnits: 2,
},
});
import pulumi
import pulumi_aws as aws
example = aws.kendra.Index("example",
name="example",
edition="DEVELOPER_EDITION",
role_arn=this["arn"],
capacity_units={
"query_capacity_units": 2,
"storage_capacity_units": 2,
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/kendra"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := kendra.NewIndex(ctx, "example", &kendra.IndexArgs{
Name: pulumi.String("example"),
Edition: pulumi.String("DEVELOPER_EDITION"),
RoleArn: pulumi.Any(this.Arn),
CapacityUnits: &kendra.IndexCapacityUnitsArgs{
QueryCapacityUnits: pulumi.Int(2),
StorageCapacityUnits: pulumi.Int(2),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Kendra.Index("example", new()
{
Name = "example",
Edition = "DEVELOPER_EDITION",
RoleArn = @this.Arn,
CapacityUnits = new Aws.Kendra.Inputs.IndexCapacityUnitsArgs
{
QueryCapacityUnits = 2,
StorageCapacityUnits = 2,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.kendra.Index;
import com.pulumi.aws.kendra.IndexArgs;
import com.pulumi.aws.kendra.inputs.IndexCapacityUnitsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Index("example", IndexArgs.builder()
.name("example")
.edition("DEVELOPER_EDITION")
.roleArn(this_.arn())
.capacityUnits(IndexCapacityUnitsArgs.builder()
.queryCapacityUnits(2)
.storageCapacityUnits(2)
.build())
.build());
}
}
resources:
example:
type: aws:kendra:Index
properties:
name: example
edition: DEVELOPER_EDITION
roleArn: ${this.arn}
capacityUnits:
queryCapacityUnits: 2
storageCapacityUnits: 2
The capacityUnits block sets queryCapacityUnits for concurrent queries and storageCapacityUnits for document storage. Each unit increases capacity in fixed increments. Kendra charges per capacity unit, so scale based on actual usage patterns.
Encrypt indexed data with a KMS key
Organizations with compliance requirements encrypt indexed documents using customer-managed KMS keys.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.kendra.Index("example", {
name: "example",
roleArn: thisAwsIamRole.arn,
serverSideEncryptionConfiguration: {
kmsKeyId: _this.arn,
},
});
import pulumi
import pulumi_aws as aws
example = aws.kendra.Index("example",
name="example",
role_arn=this_aws_iam_role["arn"],
server_side_encryption_configuration={
"kms_key_id": this["arn"],
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/kendra"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := kendra.NewIndex(ctx, "example", &kendra.IndexArgs{
Name: pulumi.String("example"),
RoleArn: pulumi.Any(thisAwsIamRole.Arn),
ServerSideEncryptionConfiguration: &kendra.IndexServerSideEncryptionConfigurationArgs{
KmsKeyId: pulumi.Any(this.Arn),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Kendra.Index("example", new()
{
Name = "example",
RoleArn = thisAwsIamRole.Arn,
ServerSideEncryptionConfiguration = new Aws.Kendra.Inputs.IndexServerSideEncryptionConfigurationArgs
{
KmsKeyId = @this.Arn,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.kendra.Index;
import com.pulumi.aws.kendra.IndexArgs;
import com.pulumi.aws.kendra.inputs.IndexServerSideEncryptionConfigurationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Index("example", IndexArgs.builder()
.name("example")
.roleArn(thisAwsIamRole.arn())
.serverSideEncryptionConfiguration(IndexServerSideEncryptionConfigurationArgs.builder()
.kmsKeyId(this_.arn())
.build())
.build());
}
}
resources:
example:
type: aws:kendra:Index
properties:
name: example
roleArn: ${thisAwsIamRole.arn}
serverSideEncryptionConfiguration:
kmsKeyId: ${this.arn}
The serverSideEncryptionConfiguration block specifies the KMS key ARN. Kendra encrypts all indexed content and metadata with this key. The IAM role must have permissions to use the KMS key for encryption and decryption operations.
Integrate with AWS SSO for access control
When search results need to respect organizational access controls, Kendra fetches user and group information from AWS SSO.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.kendra.Index("example", {
name: "example",
roleArn: _this.arn,
userGroupResolutionConfiguration: {
userGroupResolutionMode: "AWS_SSO",
},
});
import pulumi
import pulumi_aws as aws
example = aws.kendra.Index("example",
name="example",
role_arn=this["arn"],
user_group_resolution_configuration={
"user_group_resolution_mode": "AWS_SSO",
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/kendra"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := kendra.NewIndex(ctx, "example", &kendra.IndexArgs{
Name: pulumi.String("example"),
RoleArn: pulumi.Any(this.Arn),
UserGroupResolutionConfiguration: &kendra.IndexUserGroupResolutionConfigurationArgs{
UserGroupResolutionMode: pulumi.String("AWS_SSO"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Kendra.Index("example", new()
{
Name = "example",
RoleArn = @this.Arn,
UserGroupResolutionConfiguration = new Aws.Kendra.Inputs.IndexUserGroupResolutionConfigurationArgs
{
UserGroupResolutionMode = "AWS_SSO",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.kendra.Index;
import com.pulumi.aws.kendra.IndexArgs;
import com.pulumi.aws.kendra.inputs.IndexUserGroupResolutionConfigurationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Index("example", IndexArgs.builder()
.name("example")
.roleArn(this_.arn())
.userGroupResolutionConfiguration(IndexUserGroupResolutionConfigurationArgs.builder()
.userGroupResolutionMode("AWS_SSO")
.build())
.build());
}
}
resources:
example:
type: aws:kendra:Index
properties:
name: example
roleArn: ${this.arn}
userGroupResolutionConfiguration:
userGroupResolutionMode: AWS_SSO
The userGroupResolutionConfiguration block enables AWS SSO integration. Setting userGroupResolutionMode to AWS_SSO tells Kendra to fetch group memberships from your SSO directory. Search results automatically filter based on the user’s group access.
Configure built-in document metadata fields
Kendra provides predefined metadata fields for common document attributes like authors, creation dates, and file types.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.kendra.Index("example", {
name: "example",
roleArn: _this.arn,
documentMetadataConfigurationUpdates: [
{
name: "_authors",
type: "STRING_LIST_VALUE",
search: {
displayable: false,
facetable: false,
searchable: false,
sortable: false,
},
relevance: {
importance: 1,
},
},
{
name: "_category",
type: "STRING_VALUE",
search: {
displayable: false,
facetable: false,
searchable: false,
sortable: true,
},
relevance: {
importance: 1,
valuesImportanceMap: {},
},
},
{
name: "_created_at",
type: "DATE_VALUE",
search: {
displayable: false,
facetable: false,
searchable: false,
sortable: true,
},
relevance: {
freshness: false,
importance: 1,
duration: "25920000s",
rankOrder: "ASCENDING",
},
},
{
name: "_data_source_id",
type: "STRING_VALUE",
search: {
displayable: false,
facetable: false,
searchable: false,
sortable: true,
},
relevance: {
importance: 1,
valuesImportanceMap: {},
},
},
{
name: "_document_title",
type: "STRING_VALUE",
search: {
displayable: true,
facetable: false,
searchable: true,
sortable: true,
},
relevance: {
importance: 2,
valuesImportanceMap: {},
},
},
{
name: "_excerpt_page_number",
type: "LONG_VALUE",
search: {
displayable: false,
facetable: false,
searchable: false,
sortable: false,
},
relevance: {
importance: 2,
rankOrder: "ASCENDING",
},
},
{
name: "_faq_id",
type: "STRING_VALUE",
search: {
displayable: false,
facetable: false,
searchable: false,
sortable: true,
},
relevance: {
importance: 1,
valuesImportanceMap: {},
},
},
{
name: "_file_type",
type: "STRING_VALUE",
search: {
displayable: false,
facetable: false,
searchable: false,
sortable: true,
},
relevance: {
importance: 1,
valuesImportanceMap: {},
},
},
{
name: "_language_code",
type: "STRING_VALUE",
search: {
displayable: false,
facetable: false,
searchable: false,
sortable: true,
},
relevance: {
importance: 1,
valuesImportanceMap: {},
},
},
{
name: "_last_updated_at",
type: "DATE_VALUE",
search: {
displayable: false,
facetable: false,
searchable: false,
sortable: true,
},
relevance: {
freshness: false,
importance: 1,
duration: "25920000s",
rankOrder: "ASCENDING",
},
},
{
name: "_source_uri",
type: "STRING_VALUE",
search: {
displayable: true,
facetable: false,
searchable: false,
sortable: false,
},
relevance: {
importance: 1,
valuesImportanceMap: {},
},
},
{
name: "_tenant_id",
type: "STRING_VALUE",
search: {
displayable: false,
facetable: false,
searchable: false,
sortable: true,
},
relevance: {
importance: 1,
valuesImportanceMap: {},
},
},
{
name: "_version",
type: "STRING_VALUE",
search: {
displayable: false,
facetable: false,
searchable: false,
sortable: true,
},
relevance: {
importance: 1,
valuesImportanceMap: {},
},
},
{
name: "_view_count",
type: "LONG_VALUE",
search: {
displayable: false,
facetable: false,
searchable: false,
sortable: true,
},
relevance: {
importance: 1,
rankOrder: "ASCENDING",
},
},
],
});
import pulumi
import pulumi_aws as aws
example = aws.kendra.Index("example",
name="example",
role_arn=this["arn"],
document_metadata_configuration_updates=[
{
"name": "_authors",
"type": "STRING_LIST_VALUE",
"search": {
"displayable": False,
"facetable": False,
"searchable": False,
"sortable": False,
},
"relevance": {
"importance": 1,
},
},
{
"name": "_category",
"type": "STRING_VALUE",
"search": {
"displayable": False,
"facetable": False,
"searchable": False,
"sortable": True,
},
"relevance": {
"importance": 1,
"values_importance_map": {},
},
},
{
"name": "_created_at",
"type": "DATE_VALUE",
"search": {
"displayable": False,
"facetable": False,
"searchable": False,
"sortable": True,
},
"relevance": {
"freshness": False,
"importance": 1,
"duration": "25920000s",
"rank_order": "ASCENDING",
},
},
{
"name": "_data_source_id",
"type": "STRING_VALUE",
"search": {
"displayable": False,
"facetable": False,
"searchable": False,
"sortable": True,
},
"relevance": {
"importance": 1,
"values_importance_map": {},
},
},
{
"name": "_document_title",
"type": "STRING_VALUE",
"search": {
"displayable": True,
"facetable": False,
"searchable": True,
"sortable": True,
},
"relevance": {
"importance": 2,
"values_importance_map": {},
},
},
{
"name": "_excerpt_page_number",
"type": "LONG_VALUE",
"search": {
"displayable": False,
"facetable": False,
"searchable": False,
"sortable": False,
},
"relevance": {
"importance": 2,
"rank_order": "ASCENDING",
},
},
{
"name": "_faq_id",
"type": "STRING_VALUE",
"search": {
"displayable": False,
"facetable": False,
"searchable": False,
"sortable": True,
},
"relevance": {
"importance": 1,
"values_importance_map": {},
},
},
{
"name": "_file_type",
"type": "STRING_VALUE",
"search": {
"displayable": False,
"facetable": False,
"searchable": False,
"sortable": True,
},
"relevance": {
"importance": 1,
"values_importance_map": {},
},
},
{
"name": "_language_code",
"type": "STRING_VALUE",
"search": {
"displayable": False,
"facetable": False,
"searchable": False,
"sortable": True,
},
"relevance": {
"importance": 1,
"values_importance_map": {},
},
},
{
"name": "_last_updated_at",
"type": "DATE_VALUE",
"search": {
"displayable": False,
"facetable": False,
"searchable": False,
"sortable": True,
},
"relevance": {
"freshness": False,
"importance": 1,
"duration": "25920000s",
"rank_order": "ASCENDING",
},
},
{
"name": "_source_uri",
"type": "STRING_VALUE",
"search": {
"displayable": True,
"facetable": False,
"searchable": False,
"sortable": False,
},
"relevance": {
"importance": 1,
"values_importance_map": {},
},
},
{
"name": "_tenant_id",
"type": "STRING_VALUE",
"search": {
"displayable": False,
"facetable": False,
"searchable": False,
"sortable": True,
},
"relevance": {
"importance": 1,
"values_importance_map": {},
},
},
{
"name": "_version",
"type": "STRING_VALUE",
"search": {
"displayable": False,
"facetable": False,
"searchable": False,
"sortable": True,
},
"relevance": {
"importance": 1,
"values_importance_map": {},
},
},
{
"name": "_view_count",
"type": "LONG_VALUE",
"search": {
"displayable": False,
"facetable": False,
"searchable": False,
"sortable": True,
},
"relevance": {
"importance": 1,
"rank_order": "ASCENDING",
},
},
])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/kendra"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := kendra.NewIndex(ctx, "example", &kendra.IndexArgs{
Name: pulumi.String("example"),
RoleArn: pulumi.Any(this.Arn),
DocumentMetadataConfigurationUpdates: kendra.IndexDocumentMetadataConfigurationUpdateArray{
&kendra.IndexDocumentMetadataConfigurationUpdateArgs{
Name: pulumi.String("_authors"),
Type: pulumi.String("STRING_LIST_VALUE"),
Search: &kendra.IndexDocumentMetadataConfigurationUpdateSearchArgs{
Displayable: pulumi.Bool(false),
Facetable: pulumi.Bool(false),
Searchable: pulumi.Bool(false),
Sortable: pulumi.Bool(false),
},
Relevance: &kendra.IndexDocumentMetadataConfigurationUpdateRelevanceArgs{
Importance: pulumi.Int(1),
},
},
&kendra.IndexDocumentMetadataConfigurationUpdateArgs{
Name: pulumi.String("_category"),
Type: pulumi.String("STRING_VALUE"),
Search: &kendra.IndexDocumentMetadataConfigurationUpdateSearchArgs{
Displayable: pulumi.Bool(false),
Facetable: pulumi.Bool(false),
Searchable: pulumi.Bool(false),
Sortable: pulumi.Bool(true),
},
Relevance: &kendra.IndexDocumentMetadataConfigurationUpdateRelevanceArgs{
Importance: pulumi.Int(1),
ValuesImportanceMap: pulumi.IntMap{},
},
},
&kendra.IndexDocumentMetadataConfigurationUpdateArgs{
Name: pulumi.String("_created_at"),
Type: pulumi.String("DATE_VALUE"),
Search: &kendra.IndexDocumentMetadataConfigurationUpdateSearchArgs{
Displayable: pulumi.Bool(false),
Facetable: pulumi.Bool(false),
Searchable: pulumi.Bool(false),
Sortable: pulumi.Bool(true),
},
Relevance: &kendra.IndexDocumentMetadataConfigurationUpdateRelevanceArgs{
Freshness: pulumi.Bool(false),
Importance: pulumi.Int(1),
Duration: pulumi.String("25920000s"),
RankOrder: pulumi.String("ASCENDING"),
},
},
&kendra.IndexDocumentMetadataConfigurationUpdateArgs{
Name: pulumi.String("_data_source_id"),
Type: pulumi.String("STRING_VALUE"),
Search: &kendra.IndexDocumentMetadataConfigurationUpdateSearchArgs{
Displayable: pulumi.Bool(false),
Facetable: pulumi.Bool(false),
Searchable: pulumi.Bool(false),
Sortable: pulumi.Bool(true),
},
Relevance: &kendra.IndexDocumentMetadataConfigurationUpdateRelevanceArgs{
Importance: pulumi.Int(1),
ValuesImportanceMap: pulumi.IntMap{},
},
},
&kendra.IndexDocumentMetadataConfigurationUpdateArgs{
Name: pulumi.String("_document_title"),
Type: pulumi.String("STRING_VALUE"),
Search: &kendra.IndexDocumentMetadataConfigurationUpdateSearchArgs{
Displayable: pulumi.Bool(true),
Facetable: pulumi.Bool(false),
Searchable: pulumi.Bool(true),
Sortable: pulumi.Bool(true),
},
Relevance: &kendra.IndexDocumentMetadataConfigurationUpdateRelevanceArgs{
Importance: pulumi.Int(2),
ValuesImportanceMap: pulumi.IntMap{},
},
},
&kendra.IndexDocumentMetadataConfigurationUpdateArgs{
Name: pulumi.String("_excerpt_page_number"),
Type: pulumi.String("LONG_VALUE"),
Search: &kendra.IndexDocumentMetadataConfigurationUpdateSearchArgs{
Displayable: pulumi.Bool(false),
Facetable: pulumi.Bool(false),
Searchable: pulumi.Bool(false),
Sortable: pulumi.Bool(false),
},
Relevance: &kendra.IndexDocumentMetadataConfigurationUpdateRelevanceArgs{
Importance: pulumi.Int(2),
RankOrder: pulumi.String("ASCENDING"),
},
},
&kendra.IndexDocumentMetadataConfigurationUpdateArgs{
Name: pulumi.String("_faq_id"),
Type: pulumi.String("STRING_VALUE"),
Search: &kendra.IndexDocumentMetadataConfigurationUpdateSearchArgs{
Displayable: pulumi.Bool(false),
Facetable: pulumi.Bool(false),
Searchable: pulumi.Bool(false),
Sortable: pulumi.Bool(true),
},
Relevance: &kendra.IndexDocumentMetadataConfigurationUpdateRelevanceArgs{
Importance: pulumi.Int(1),
ValuesImportanceMap: pulumi.IntMap{},
},
},
&kendra.IndexDocumentMetadataConfigurationUpdateArgs{
Name: pulumi.String("_file_type"),
Type: pulumi.String("STRING_VALUE"),
Search: &kendra.IndexDocumentMetadataConfigurationUpdateSearchArgs{
Displayable: pulumi.Bool(false),
Facetable: pulumi.Bool(false),
Searchable: pulumi.Bool(false),
Sortable: pulumi.Bool(true),
},
Relevance: &kendra.IndexDocumentMetadataConfigurationUpdateRelevanceArgs{
Importance: pulumi.Int(1),
ValuesImportanceMap: pulumi.IntMap{},
},
},
&kendra.IndexDocumentMetadataConfigurationUpdateArgs{
Name: pulumi.String("_language_code"),
Type: pulumi.String("STRING_VALUE"),
Search: &kendra.IndexDocumentMetadataConfigurationUpdateSearchArgs{
Displayable: pulumi.Bool(false),
Facetable: pulumi.Bool(false),
Searchable: pulumi.Bool(false),
Sortable: pulumi.Bool(true),
},
Relevance: &kendra.IndexDocumentMetadataConfigurationUpdateRelevanceArgs{
Importance: pulumi.Int(1),
ValuesImportanceMap: pulumi.IntMap{},
},
},
&kendra.IndexDocumentMetadataConfigurationUpdateArgs{
Name: pulumi.String("_last_updated_at"),
Type: pulumi.String("DATE_VALUE"),
Search: &kendra.IndexDocumentMetadataConfigurationUpdateSearchArgs{
Displayable: pulumi.Bool(false),
Facetable: pulumi.Bool(false),
Searchable: pulumi.Bool(false),
Sortable: pulumi.Bool(true),
},
Relevance: &kendra.IndexDocumentMetadataConfigurationUpdateRelevanceArgs{
Freshness: pulumi.Bool(false),
Importance: pulumi.Int(1),
Duration: pulumi.String("25920000s"),
RankOrder: pulumi.String("ASCENDING"),
},
},
&kendra.IndexDocumentMetadataConfigurationUpdateArgs{
Name: pulumi.String("_source_uri"),
Type: pulumi.String("STRING_VALUE"),
Search: &kendra.IndexDocumentMetadataConfigurationUpdateSearchArgs{
Displayable: pulumi.Bool(true),
Facetable: pulumi.Bool(false),
Searchable: pulumi.Bool(false),
Sortable: pulumi.Bool(false),
},
Relevance: &kendra.IndexDocumentMetadataConfigurationUpdateRelevanceArgs{
Importance: pulumi.Int(1),
ValuesImportanceMap: pulumi.IntMap{},
},
},
&kendra.IndexDocumentMetadataConfigurationUpdateArgs{
Name: pulumi.String("_tenant_id"),
Type: pulumi.String("STRING_VALUE"),
Search: &kendra.IndexDocumentMetadataConfigurationUpdateSearchArgs{
Displayable: pulumi.Bool(false),
Facetable: pulumi.Bool(false),
Searchable: pulumi.Bool(false),
Sortable: pulumi.Bool(true),
},
Relevance: &kendra.IndexDocumentMetadataConfigurationUpdateRelevanceArgs{
Importance: pulumi.Int(1),
ValuesImportanceMap: pulumi.IntMap{},
},
},
&kendra.IndexDocumentMetadataConfigurationUpdateArgs{
Name: pulumi.String("_version"),
Type: pulumi.String("STRING_VALUE"),
Search: &kendra.IndexDocumentMetadataConfigurationUpdateSearchArgs{
Displayable: pulumi.Bool(false),
Facetable: pulumi.Bool(false),
Searchable: pulumi.Bool(false),
Sortable: pulumi.Bool(true),
},
Relevance: &kendra.IndexDocumentMetadataConfigurationUpdateRelevanceArgs{
Importance: pulumi.Int(1),
ValuesImportanceMap: pulumi.IntMap{},
},
},
&kendra.IndexDocumentMetadataConfigurationUpdateArgs{
Name: pulumi.String("_view_count"),
Type: pulumi.String("LONG_VALUE"),
Search: &kendra.IndexDocumentMetadataConfigurationUpdateSearchArgs{
Displayable: pulumi.Bool(false),
Facetable: pulumi.Bool(false),
Searchable: pulumi.Bool(false),
Sortable: pulumi.Bool(true),
},
Relevance: &kendra.IndexDocumentMetadataConfigurationUpdateRelevanceArgs{
Importance: pulumi.Int(1),
RankOrder: pulumi.String("ASCENDING"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Kendra.Index("example", new()
{
Name = "example",
RoleArn = @this.Arn,
DocumentMetadataConfigurationUpdates = new[]
{
new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateArgs
{
Name = "_authors",
Type = "STRING_LIST_VALUE",
Search = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateSearchArgs
{
Displayable = false,
Facetable = false,
Searchable = false,
Sortable = false,
},
Relevance = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateRelevanceArgs
{
Importance = 1,
},
},
new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateArgs
{
Name = "_category",
Type = "STRING_VALUE",
Search = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateSearchArgs
{
Displayable = false,
Facetable = false,
Searchable = false,
Sortable = true,
},
Relevance = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateRelevanceArgs
{
Importance = 1,
ValuesImportanceMap = null,
},
},
new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateArgs
{
Name = "_created_at",
Type = "DATE_VALUE",
Search = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateSearchArgs
{
Displayable = false,
Facetable = false,
Searchable = false,
Sortable = true,
},
Relevance = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateRelevanceArgs
{
Freshness = false,
Importance = 1,
Duration = "25920000s",
RankOrder = "ASCENDING",
},
},
new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateArgs
{
Name = "_data_source_id",
Type = "STRING_VALUE",
Search = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateSearchArgs
{
Displayable = false,
Facetable = false,
Searchable = false,
Sortable = true,
},
Relevance = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateRelevanceArgs
{
Importance = 1,
ValuesImportanceMap = null,
},
},
new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateArgs
{
Name = "_document_title",
Type = "STRING_VALUE",
Search = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateSearchArgs
{
Displayable = true,
Facetable = false,
Searchable = true,
Sortable = true,
},
Relevance = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateRelevanceArgs
{
Importance = 2,
ValuesImportanceMap = null,
},
},
new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateArgs
{
Name = "_excerpt_page_number",
Type = "LONG_VALUE",
Search = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateSearchArgs
{
Displayable = false,
Facetable = false,
Searchable = false,
Sortable = false,
},
Relevance = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateRelevanceArgs
{
Importance = 2,
RankOrder = "ASCENDING",
},
},
new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateArgs
{
Name = "_faq_id",
Type = "STRING_VALUE",
Search = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateSearchArgs
{
Displayable = false,
Facetable = false,
Searchable = false,
Sortable = true,
},
Relevance = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateRelevanceArgs
{
Importance = 1,
ValuesImportanceMap = null,
},
},
new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateArgs
{
Name = "_file_type",
Type = "STRING_VALUE",
Search = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateSearchArgs
{
Displayable = false,
Facetable = false,
Searchable = false,
Sortable = true,
},
Relevance = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateRelevanceArgs
{
Importance = 1,
ValuesImportanceMap = null,
},
},
new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateArgs
{
Name = "_language_code",
Type = "STRING_VALUE",
Search = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateSearchArgs
{
Displayable = false,
Facetable = false,
Searchable = false,
Sortable = true,
},
Relevance = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateRelevanceArgs
{
Importance = 1,
ValuesImportanceMap = null,
},
},
new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateArgs
{
Name = "_last_updated_at",
Type = "DATE_VALUE",
Search = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateSearchArgs
{
Displayable = false,
Facetable = false,
Searchable = false,
Sortable = true,
},
Relevance = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateRelevanceArgs
{
Freshness = false,
Importance = 1,
Duration = "25920000s",
RankOrder = "ASCENDING",
},
},
new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateArgs
{
Name = "_source_uri",
Type = "STRING_VALUE",
Search = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateSearchArgs
{
Displayable = true,
Facetable = false,
Searchable = false,
Sortable = false,
},
Relevance = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateRelevanceArgs
{
Importance = 1,
ValuesImportanceMap = null,
},
},
new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateArgs
{
Name = "_tenant_id",
Type = "STRING_VALUE",
Search = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateSearchArgs
{
Displayable = false,
Facetable = false,
Searchable = false,
Sortable = true,
},
Relevance = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateRelevanceArgs
{
Importance = 1,
ValuesImportanceMap = null,
},
},
new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateArgs
{
Name = "_version",
Type = "STRING_VALUE",
Search = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateSearchArgs
{
Displayable = false,
Facetable = false,
Searchable = false,
Sortable = true,
},
Relevance = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateRelevanceArgs
{
Importance = 1,
ValuesImportanceMap = null,
},
},
new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateArgs
{
Name = "_view_count",
Type = "LONG_VALUE",
Search = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateSearchArgs
{
Displayable = false,
Facetable = false,
Searchable = false,
Sortable = true,
},
Relevance = new Aws.Kendra.Inputs.IndexDocumentMetadataConfigurationUpdateRelevanceArgs
{
Importance = 1,
RankOrder = "ASCENDING",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.kendra.Index;
import com.pulumi.aws.kendra.IndexArgs;
import com.pulumi.aws.kendra.inputs.IndexDocumentMetadataConfigurationUpdateArgs;
import com.pulumi.aws.kendra.inputs.IndexDocumentMetadataConfigurationUpdateSearchArgs;
import com.pulumi.aws.kendra.inputs.IndexDocumentMetadataConfigurationUpdateRelevanceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Index("example", IndexArgs.builder()
.name("example")
.roleArn(this_.arn())
.documentMetadataConfigurationUpdates(
IndexDocumentMetadataConfigurationUpdateArgs.builder()
.name("_authors")
.type("STRING_LIST_VALUE")
.search(IndexDocumentMetadataConfigurationUpdateSearchArgs.builder()
.displayable(false)
.facetable(false)
.searchable(false)
.sortable(false)
.build())
.relevance(IndexDocumentMetadataConfigurationUpdateRelevanceArgs.builder()
.importance(1)
.build())
.build(),
IndexDocumentMetadataConfigurationUpdateArgs.builder()
.name("_category")
.type("STRING_VALUE")
.search(IndexDocumentMetadataConfigurationUpdateSearchArgs.builder()
.displayable(false)
.facetable(false)
.searchable(false)
.sortable(true)
.build())
.relevance(IndexDocumentMetadataConfigurationUpdateRelevanceArgs.builder()
.importance(1)
.valuesImportanceMap(Map.ofEntries(
))
.build())
.build(),
IndexDocumentMetadataConfigurationUpdateArgs.builder()
.name("_created_at")
.type("DATE_VALUE")
.search(IndexDocumentMetadataConfigurationUpdateSearchArgs.builder()
.displayable(false)
.facetable(false)
.searchable(false)
.sortable(true)
.build())
.relevance(IndexDocumentMetadataConfigurationUpdateRelevanceArgs.builder()
.freshness(false)
.importance(1)
.duration("25920000s")
.rankOrder("ASCENDING")
.build())
.build(),
IndexDocumentMetadataConfigurationUpdateArgs.builder()
.name("_data_source_id")
.type("STRING_VALUE")
.search(IndexDocumentMetadataConfigurationUpdateSearchArgs.builder()
.displayable(false)
.facetable(false)
.searchable(false)
.sortable(true)
.build())
.relevance(IndexDocumentMetadataConfigurationUpdateRelevanceArgs.builder()
.importance(1)
.valuesImportanceMap(Map.ofEntries(
))
.build())
.build(),
IndexDocumentMetadataConfigurationUpdateArgs.builder()
.name("_document_title")
.type("STRING_VALUE")
.search(IndexDocumentMetadataConfigurationUpdateSearchArgs.builder()
.displayable(true)
.facetable(false)
.searchable(true)
.sortable(true)
.build())
.relevance(IndexDocumentMetadataConfigurationUpdateRelevanceArgs.builder()
.importance(2)
.valuesImportanceMap(Map.ofEntries(
))
.build())
.build(),
IndexDocumentMetadataConfigurationUpdateArgs.builder()
.name("_excerpt_page_number")
.type("LONG_VALUE")
.search(IndexDocumentMetadataConfigurationUpdateSearchArgs.builder()
.displayable(false)
.facetable(false)
.searchable(false)
.sortable(false)
.build())
.relevance(IndexDocumentMetadataConfigurationUpdateRelevanceArgs.builder()
.importance(2)
.rankOrder("ASCENDING")
.build())
.build(),
IndexDocumentMetadataConfigurationUpdateArgs.builder()
.name("_faq_id")
.type("STRING_VALUE")
.search(IndexDocumentMetadataConfigurationUpdateSearchArgs.builder()
.displayable(false)
.facetable(false)
.searchable(false)
.sortable(true)
.build())
.relevance(IndexDocumentMetadataConfigurationUpdateRelevanceArgs.builder()
.importance(1)
.valuesImportanceMap(Map.ofEntries(
))
.build())
.build(),
IndexDocumentMetadataConfigurationUpdateArgs.builder()
.name("_file_type")
.type("STRING_VALUE")
.search(IndexDocumentMetadataConfigurationUpdateSearchArgs.builder()
.displayable(false)
.facetable(false)
.searchable(false)
.sortable(true)
.build())
.relevance(IndexDocumentMetadataConfigurationUpdateRelevanceArgs.builder()
.importance(1)
.valuesImportanceMap(Map.ofEntries(
))
.build())
.build(),
IndexDocumentMetadataConfigurationUpdateArgs.builder()
.name("_language_code")
.type("STRING_VALUE")
.search(IndexDocumentMetadataConfigurationUpdateSearchArgs.builder()
.displayable(false)
.facetable(false)
.searchable(false)
.sortable(true)
.build())
.relevance(IndexDocumentMetadataConfigurationUpdateRelevanceArgs.builder()
.importance(1)
.valuesImportanceMap(Map.ofEntries(
))
.build())
.build(),
IndexDocumentMetadataConfigurationUpdateArgs.builder()
.name("_last_updated_at")
.type("DATE_VALUE")
.search(IndexDocumentMetadataConfigurationUpdateSearchArgs.builder()
.displayable(false)
.facetable(false)
.searchable(false)
.sortable(true)
.build())
.relevance(IndexDocumentMetadataConfigurationUpdateRelevanceArgs.builder()
.freshness(false)
.importance(1)
.duration("25920000s")
.rankOrder("ASCENDING")
.build())
.build(),
IndexDocumentMetadataConfigurationUpdateArgs.builder()
.name("_source_uri")
.type("STRING_VALUE")
.search(IndexDocumentMetadataConfigurationUpdateSearchArgs.builder()
.displayable(true)
.facetable(false)
.searchable(false)
.sortable(false)
.build())
.relevance(IndexDocumentMetadataConfigurationUpdateRelevanceArgs.builder()
.importance(1)
.valuesImportanceMap(Map.ofEntries(
))
.build())
.build(),
IndexDocumentMetadataConfigurationUpdateArgs.builder()
.name("_tenant_id")
.type("STRING_VALUE")
.search(IndexDocumentMetadataConfigurationUpdateSearchArgs.builder()
.displayable(false)
.facetable(false)
.searchable(false)
.sortable(true)
.build())
.relevance(IndexDocumentMetadataConfigurationUpdateRelevanceArgs.builder()
.importance(1)
.valuesImportanceMap(Map.ofEntries(
))
.build())
.build(),
IndexDocumentMetadataConfigurationUpdateArgs.builder()
.name("_version")
.type("STRING_VALUE")
.search(IndexDocumentMetadataConfigurationUpdateSearchArgs.builder()
.displayable(false)
.facetable(false)
.searchable(false)
.sortable(true)
.build())
.relevance(IndexDocumentMetadataConfigurationUpdateRelevanceArgs.builder()
.importance(1)
.valuesImportanceMap(Map.ofEntries(
))
.build())
.build(),
IndexDocumentMetadataConfigurationUpdateArgs.builder()
.name("_view_count")
.type("LONG_VALUE")
.search(IndexDocumentMetadataConfigurationUpdateSearchArgs.builder()
.displayable(false)
.facetable(false)
.searchable(false)
.sortable(true)
.build())
.relevance(IndexDocumentMetadataConfigurationUpdateRelevanceArgs.builder()
.importance(1)
.rankOrder("ASCENDING")
.build())
.build())
.build());
}
}
resources:
example:
type: aws:kendra:Index
properties:
name: example
roleArn: ${this.arn}
documentMetadataConfigurationUpdates:
- name: _authors
type: STRING_LIST_VALUE
search:
displayable: false
facetable: false
searchable: false
sortable: false
relevance:
importance: 1
- name: _category
type: STRING_VALUE
search:
displayable: false
facetable: false
searchable: false
sortable: true
relevance:
importance: 1
valuesImportanceMap: {}
- name: _created_at
type: DATE_VALUE
search:
displayable: false
facetable: false
searchable: false
sortable: true
relevance:
freshness: false
importance: 1
duration: 25920000s
rankOrder: ASCENDING
- name: _data_source_id
type: STRING_VALUE
search:
displayable: false
facetable: false
searchable: false
sortable: true
relevance:
importance: 1
valuesImportanceMap: {}
- name: _document_title
type: STRING_VALUE
search:
displayable: true
facetable: false
searchable: true
sortable: true
relevance:
importance: 2
valuesImportanceMap: {}
- name: _excerpt_page_number
type: LONG_VALUE
search:
displayable: false
facetable: false
searchable: false
sortable: false
relevance:
importance: 2
rankOrder: ASCENDING
- name: _faq_id
type: STRING_VALUE
search:
displayable: false
facetable: false
searchable: false
sortable: true
relevance:
importance: 1
valuesImportanceMap: {}
- name: _file_type
type: STRING_VALUE
search:
displayable: false
facetable: false
searchable: false
sortable: true
relevance:
importance: 1
valuesImportanceMap: {}
- name: _language_code
type: STRING_VALUE
search:
displayable: false
facetable: false
searchable: false
sortable: true
relevance:
importance: 1
valuesImportanceMap: {}
- name: _last_updated_at
type: DATE_VALUE
search:
displayable: false
facetable: false
searchable: false
sortable: true
relevance:
freshness: false
importance: 1
duration: 25920000s
rankOrder: ASCENDING
- name: _source_uri
type: STRING_VALUE
search:
displayable: true
facetable: false
searchable: false
sortable: false
relevance:
importance: 1
valuesImportanceMap: {}
- name: _tenant_id
type: STRING_VALUE
search:
displayable: false
facetable: false
searchable: false
sortable: true
relevance:
importance: 1
valuesImportanceMap: {}
- name: _version
type: STRING_VALUE
search:
displayable: false
facetable: false
searchable: false
sortable: true
relevance:
importance: 1
valuesImportanceMap: {}
- name: _view_count
type: LONG_VALUE
search:
displayable: false
facetable: false
searchable: false
sortable: true
relevance:
importance: 1
rankOrder: ASCENDING
The documentMetadataConfigurationUpdates array configures how each field affects search behavior. The search block controls whether fields are displayable in results, searchable in queries, facetable for filtering, or sortable. The relevance block sets importance weights and ranking behavior. Fields like _document_title have higher importance (2) than _category (1), affecting result ranking.
Configure JWT-based user authentication
Applications that authenticate users with JSON Web Tokens can pass user identity and group membership to Kendra.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.kendra.Index("example", {
name: "example",
roleArn: _this.arn,
userTokenConfigurations: {
jsonTokenTypeConfiguration: {
groupAttributeField: "groups",
userNameAttributeField: "username",
},
},
});
import pulumi
import pulumi_aws as aws
example = aws.kendra.Index("example",
name="example",
role_arn=this["arn"],
user_token_configurations={
"json_token_type_configuration": {
"group_attribute_field": "groups",
"user_name_attribute_field": "username",
},
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/kendra"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := kendra.NewIndex(ctx, "example", &kendra.IndexArgs{
Name: pulumi.String("example"),
RoleArn: pulumi.Any(this.Arn),
UserTokenConfigurations: &kendra.IndexUserTokenConfigurationsArgs{
JsonTokenTypeConfiguration: &kendra.IndexUserTokenConfigurationsJsonTokenTypeConfigurationArgs{
GroupAttributeField: pulumi.String("groups"),
UserNameAttributeField: pulumi.String("username"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Kendra.Index("example", new()
{
Name = "example",
RoleArn = @this.Arn,
UserTokenConfigurations = new Aws.Kendra.Inputs.IndexUserTokenConfigurationsArgs
{
JsonTokenTypeConfiguration = new Aws.Kendra.Inputs.IndexUserTokenConfigurationsJsonTokenTypeConfigurationArgs
{
GroupAttributeField = "groups",
UserNameAttributeField = "username",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.kendra.Index;
import com.pulumi.aws.kendra.IndexArgs;
import com.pulumi.aws.kendra.inputs.IndexUserTokenConfigurationsArgs;
import com.pulumi.aws.kendra.inputs.IndexUserTokenConfigurationsJsonTokenTypeConfigurationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Index("example", IndexArgs.builder()
.name("example")
.roleArn(this_.arn())
.userTokenConfigurations(IndexUserTokenConfigurationsArgs.builder()
.jsonTokenTypeConfiguration(IndexUserTokenConfigurationsJsonTokenTypeConfigurationArgs.builder()
.groupAttributeField("groups")
.userNameAttributeField("username")
.build())
.build())
.build());
}
}
resources:
example:
type: aws:kendra:Index
properties:
name: example
roleArn: ${this.arn}
userTokenConfigurations:
jsonTokenTypeConfiguration:
groupAttributeField: groups
userNameAttributeField: username
The jsonTokenTypeConfiguration block maps JWT claims to Kendra’s user model. The groupAttributeField and userNameAttributeField properties specify which JWT claims contain group membership and username. Your application must provide JWTs with these fields when querying the index.
Beyond these examples
These snippets focus on specific index-level features: index creation and capacity scaling, encryption and access control, and metadata field configuration. They’re intentionally minimal rather than full search applications.
The examples may reference pre-existing infrastructure such as IAM roles with Kendra, CloudWatch, and S3 permissions, KMS keys for encryption, and AWS SSO configuration for SSO integration. They focus on configuring the index rather than provisioning everything around it.
To keep things focused, common index patterns are omitted, including:
- Custom metadata fields beyond built-in fields (shown in Example 6)
- User context policy configuration (userContextPolicy)
- Data source connections and document ingestion
- Query and synonym configuration
These omissions are intentional: the goal is to illustrate how each index feature is wired, not provide drop-in search solutions. See the Kendra Index resource reference for all available configuration options.
Let's create AWS Kendra Search Indexes
Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.
Try Pulumi Cloud for FREEFrequently Asked Questions
Index Configuration & Editions
DEVELOPER_EDITION (for development, testing, or proof of concept), ENTERPRISE_EDITION (for production, the default), and GEN_AI_ENTERPRISE_EDITION (for generative AI applications). The edition cannot be changed after index creation.BatchPutDocument API to index documents from an Amazon S3 bucket.Document Metadata Configuration
_authors, _category, _created_at, _data_source_id, _document_title, _excerpt_page_number, _faq_id, _file_type, _language_code, _last_updated_at, _source_uri, _tenant_id, _version, and _view_count.documentMetadataConfigurationUpdates, you must define all elements, including the 14 predefined fields. Use the complete example as a starting point.documentMetadataConfigurationUpdates cannot be removed since index fields cannot be deleted. Plan your metadata schema carefully before adding fields.documentMetadataConfigurationUpdates alongside the 14 predefined fields. Four types are supported: STRING_VALUE, LONG_VALUE, STRING_LIST_VALUE, and DATE_VALUE.documentMetadataConfigurationUpdates.Security & Encryption
serverSideEncryptionConfiguration is immutable. Configure your KMS encryption settings correctly during initial index creation.User Authentication & Access Control
userContextPolicy (with values ATTRIBUTE_FILTER or USER_TOKEN, defaulting to ATTRIBUTE_FILTER), userGroupResolutionConfiguration for AWS SSO integration, or userTokenConfigurations for JSON token-based authentication.userGroupResolutionConfiguration with userGroupResolutionMode set to AWS_SSO to fetch access levels of groups and users from AWS SSO.Capacity & Performance
capacityUnits to set additional document storage and query capacity. Configure queryCapacityUnits and storageCapacityUnits as needed (the example shows both set to 2).Using a different cloud?
Explore analytics guides for other cloud providers: