The aws:kendra/faq:Faq resource, part of the Pulumi AWS provider, connects a Kendra index to an S3-stored FAQ document for direct answer retrieval. This guide focuses on three capabilities: S3 path configuration, file format specification, and language code settings.
FAQ resources depend on an existing Kendra index, an S3 bucket containing the FAQ document, and an IAM role with S3 read permissions. The examples are intentionally small. Combine them with your own index, S3 storage, and IAM configuration.
Load FAQ content from S3 into a Kendra index
Kendra indexes ingest FAQ documents from S3 to provide direct answers to common questions.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.kendra.Faq("example", {
indexId: exampleAwsKendraIndex.id,
name: "Example",
roleArn: exampleAwsIamRole.arn,
s3Path: {
bucket: exampleAwsS3Bucket.id,
key: exampleAwsS3Object.key,
},
tags: {
Name: "Example Kendra Faq",
},
});
import pulumi
import pulumi_aws as aws
example = aws.kendra.Faq("example",
index_id=example_aws_kendra_index["id"],
name="Example",
role_arn=example_aws_iam_role["arn"],
s3_path={
"bucket": example_aws_s3_bucket["id"],
"key": example_aws_s3_object["key"],
},
tags={
"Name": "Example Kendra Faq",
})
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.NewFaq(ctx, "example", &kendra.FaqArgs{
IndexId: pulumi.Any(exampleAwsKendraIndex.Id),
Name: pulumi.String("Example"),
RoleArn: pulumi.Any(exampleAwsIamRole.Arn),
S3Path: &kendra.FaqS3PathArgs{
Bucket: pulumi.Any(exampleAwsS3Bucket.Id),
Key: pulumi.Any(exampleAwsS3Object.Key),
},
Tags: pulumi.StringMap{
"Name": pulumi.String("Example Kendra Faq"),
},
})
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.Faq("example", new()
{
IndexId = exampleAwsKendraIndex.Id,
Name = "Example",
RoleArn = exampleAwsIamRole.Arn,
S3Path = new Aws.Kendra.Inputs.FaqS3PathArgs
{
Bucket = exampleAwsS3Bucket.Id,
Key = exampleAwsS3Object.Key,
},
Tags =
{
{ "Name", "Example Kendra Faq" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.kendra.Faq;
import com.pulumi.aws.kendra.FaqArgs;
import com.pulumi.aws.kendra.inputs.FaqS3PathArgs;
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 Faq("example", FaqArgs.builder()
.indexId(exampleAwsKendraIndex.id())
.name("Example")
.roleArn(exampleAwsIamRole.arn())
.s3Path(FaqS3PathArgs.builder()
.bucket(exampleAwsS3Bucket.id())
.key(exampleAwsS3Object.key())
.build())
.tags(Map.of("Name", "Example Kendra Faq"))
.build());
}
}
resources:
example:
type: aws:kendra:Faq
properties:
indexId: ${exampleAwsKendraIndex.id}
name: Example
roleArn: ${exampleAwsIamRole.arn}
s3Path:
bucket: ${exampleAwsS3Bucket.id}
key: ${exampleAwsS3Object.key}
tags:
Name: Example Kendra Faq
When you create the FAQ resource, Kendra reads the S3 object and indexes the question-answer pairs. The s3Path property specifies the bucket and key where your FAQ document lives. The roleArn grants Kendra permission to read from S3. The indexId connects the FAQ to your Kendra index.
Specify CSV format for FAQ data
FAQ documents can be provided in different formats; setting fileFormat ensures correct parsing.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.kendra.Faq("example", {
indexId: exampleAwsKendraIndex.id,
name: "Example",
fileFormat: "CSV",
roleArn: exampleAwsIamRole.arn,
s3Path: {
bucket: exampleAwsS3Bucket.id,
key: exampleAwsS3Object.key,
},
});
import pulumi
import pulumi_aws as aws
example = aws.kendra.Faq("example",
index_id=example_aws_kendra_index["id"],
name="Example",
file_format="CSV",
role_arn=example_aws_iam_role["arn"],
s3_path={
"bucket": example_aws_s3_bucket["id"],
"key": example_aws_s3_object["key"],
})
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.NewFaq(ctx, "example", &kendra.FaqArgs{
IndexId: pulumi.Any(exampleAwsKendraIndex.Id),
Name: pulumi.String("Example"),
FileFormat: pulumi.String("CSV"),
RoleArn: pulumi.Any(exampleAwsIamRole.Arn),
S3Path: &kendra.FaqS3PathArgs{
Bucket: pulumi.Any(exampleAwsS3Bucket.Id),
Key: pulumi.Any(exampleAwsS3Object.Key),
},
})
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.Faq("example", new()
{
IndexId = exampleAwsKendraIndex.Id,
Name = "Example",
FileFormat = "CSV",
RoleArn = exampleAwsIamRole.Arn,
S3Path = new Aws.Kendra.Inputs.FaqS3PathArgs
{
Bucket = exampleAwsS3Bucket.Id,
Key = exampleAwsS3Object.Key,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.kendra.Faq;
import com.pulumi.aws.kendra.FaqArgs;
import com.pulumi.aws.kendra.inputs.FaqS3PathArgs;
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 Faq("example", FaqArgs.builder()
.indexId(exampleAwsKendraIndex.id())
.name("Example")
.fileFormat("CSV")
.roleArn(exampleAwsIamRole.arn())
.s3Path(FaqS3PathArgs.builder()
.bucket(exampleAwsS3Bucket.id())
.key(exampleAwsS3Object.key())
.build())
.build());
}
}
resources:
example:
type: aws:kendra:Faq
properties:
indexId: ${exampleAwsKendraIndex.id}
name: Example
fileFormat: CSV
roleArn: ${exampleAwsIamRole.arn}
s3Path:
bucket: ${exampleAwsS3Bucket.id}
key: ${exampleAwsS3Object.key}
The fileFormat property tells Kendra how to interpret the S3 object structure. CSV format expects a specific column layout for questions and answers. Without this property, Kendra infers the format from the file extension.
Set language for FAQ content processing
Kendra applies language-specific natural language processing to FAQ content.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.kendra.Faq("example", {
indexId: exampleAwsKendraIndex.id,
name: "Example",
languageCode: "en",
roleArn: exampleAwsIamRole.arn,
s3Path: {
bucket: exampleAwsS3Bucket.id,
key: exampleAwsS3Object.key,
},
});
import pulumi
import pulumi_aws as aws
example = aws.kendra.Faq("example",
index_id=example_aws_kendra_index["id"],
name="Example",
language_code="en",
role_arn=example_aws_iam_role["arn"],
s3_path={
"bucket": example_aws_s3_bucket["id"],
"key": example_aws_s3_object["key"],
})
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.NewFaq(ctx, "example", &kendra.FaqArgs{
IndexId: pulumi.Any(exampleAwsKendraIndex.Id),
Name: pulumi.String("Example"),
LanguageCode: pulumi.String("en"),
RoleArn: pulumi.Any(exampleAwsIamRole.Arn),
S3Path: &kendra.FaqS3PathArgs{
Bucket: pulumi.Any(exampleAwsS3Bucket.Id),
Key: pulumi.Any(exampleAwsS3Object.Key),
},
})
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.Faq("example", new()
{
IndexId = exampleAwsKendraIndex.Id,
Name = "Example",
LanguageCode = "en",
RoleArn = exampleAwsIamRole.Arn,
S3Path = new Aws.Kendra.Inputs.FaqS3PathArgs
{
Bucket = exampleAwsS3Bucket.Id,
Key = exampleAwsS3Object.Key,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.kendra.Faq;
import com.pulumi.aws.kendra.FaqArgs;
import com.pulumi.aws.kendra.inputs.FaqS3PathArgs;
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 Faq("example", FaqArgs.builder()
.indexId(exampleAwsKendraIndex.id())
.name("Example")
.languageCode("en")
.roleArn(exampleAwsIamRole.arn())
.s3Path(FaqS3PathArgs.builder()
.bucket(exampleAwsS3Bucket.id())
.key(exampleAwsS3Object.key())
.build())
.build());
}
}
resources:
example:
type: aws:kendra:Faq
properties:
indexId: ${exampleAwsKendraIndex.id}
name: Example
languageCode: en
roleArn: ${exampleAwsIamRole.arn}
s3Path:
bucket: ${exampleAwsS3Bucket.id}
key: ${exampleAwsS3Object.key}
The languageCode property optimizes NLP processing for the FAQ’s language. Kendra uses this to improve answer relevance and query matching. The default language depends on your index configuration.
Beyond these examples
These snippets focus on specific FAQ resource features: S3-based FAQ ingestion, file format specification, and language code configuration. They’re intentionally minimal rather than complete FAQ management solutions.
The examples reference pre-existing infrastructure such as Kendra indexes, S3 buckets with FAQ documents, and IAM roles with S3 read permissions. They focus on configuring the FAQ resource rather than provisioning the surrounding infrastructure.
To keep things focused, common FAQ patterns are omitted, including:
- Description metadata (description property)
- FAQ update and versioning workflows
- Error handling for failed ingestion (errorMessage output)
- Status monitoring (status output property)
These omissions are intentional: the goal is to illustrate how the FAQ resource is wired, not provide drop-in FAQ management modules. See the Kendra FAQ resource reference for all available configuration options.
Let's configure AWS Kendra FAQs
Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.
Try Pulumi Cloud for FREEFrequently Asked Questions
Configuration & Setup
indexId (the Kendra index identifier), roleArn (IAM role for S3 access), s3Path (S3 location with bucket and key), languageCode, and name.roleArn must have permission to access the S3 bucket that contains the FAQ data.fileFormat property. The examples show CSV format.languageCode property with a language code like en for English.Immutability & Updates
indexId, name, roleArn, s3Path, fileFormat, languageCode, and description.Status & Troubleshooting
status output property. The FAQ is ready to use when the status is ACTIVE.status is FAILED, the errorMessage output property contains an explanation of why the creation failed.Using a different cloud?
Explore analytics guides for other cloud providers: