Skip to content

Index

Source: src/AWS/Kendra/SearchIndex.ts

An Amazon Kendra index — a machine-learning powered enterprise search index that data sources (S3, SharePoint, databases, …) sync documents into and that applications query with natural language.

import * as AWS from "alchemy/AWS";
const role = yield* AWS.IAM.Role("KendraRole", {
assumeRolePolicy: {
Version: "2012-10-17",
Statement: [{
Effect: "Allow",
Principal: { Service: "kendra.amazonaws.com" },
Action: "sts:AssumeRole",
}],
},
policies: [{
policyName: "logs",
policyDocument: {
Version: "2012-10-17",
Statement: [{
Effect: "Allow",
Action: ["logs:*", "cloudwatch:PutMetricData"],
Resource: "*",
}],
},
}],
});
const index = yield* AWS.Kendra.Index("Search", {
edition: "DEVELOPER_EDITION",
roleArn: role.roleArn,
});