UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

672 lines • 21.6 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Index = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an Amazon Kendra Index resource. * * ## Example Usage * * ### Basic * * ```typescript * 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", * }, * }); * ``` * * ### With capacity units * * ```typescript * 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, * }, * }); * ``` * * ### With server side encryption configuration * * ```typescript * 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, * }, * }); * ``` * * ### With user group resolution configuration * * ```typescript * 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", * }, * }); * ``` * * ### With Document Metadata Configuration Updates * * ### Specifying the predefined elements * * Refer to [Amazon Kendra documentation on built-in document fields](https://docs.aws.amazon.com/kendra/latest/dg/hiw-index.html#index-reserved-fields) for more information. * * ```typescript * 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", * }, * }, * ], * }); * ``` * * ### Appending additional elements * * The example below shows additional elements with names, `example-string-value`, `example-long-value`, `example-string-list-value`, `example-date-value` representing the 4 types of `STRING_VALUE`, `LONG_VALUE`, `STRING_LIST_VALUE`, `DATE_VALUE` respectively. * * ```typescript * 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", * }, * }, * { * name: "example-string-value", * type: "STRING_VALUE", * search: { * displayable: true, * facetable: true, * searchable: true, * sortable: true, * }, * relevance: { * importance: 1, * valuesImportanceMap: {}, * }, * }, * { * name: "example-long-value", * type: "LONG_VALUE", * search: { * displayable: true, * facetable: true, * searchable: false, * sortable: true, * }, * relevance: { * importance: 1, * rankOrder: "ASCENDING", * }, * }, * { * name: "example-string-list-value", * type: "STRING_LIST_VALUE", * search: { * displayable: true, * facetable: true, * searchable: true, * sortable: false, * }, * relevance: { * importance: 1, * }, * }, * { * name: "example-date-value", * type: "DATE_VALUE", * search: { * displayable: true, * facetable: true, * searchable: false, * sortable: false, * }, * relevance: { * freshness: false, * importance: 1, * duration: "25920000s", * rankOrder: "ASCENDING", * }, * }, * ], * }); * ``` * * ### With JSON token type configuration * * ```typescript * 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 * * Using `pulumi import`, import Amazon Kendra Indexes using its `id`. For example: * * ```sh * $ pulumi import aws:kendra/index:Index example 12345678-1234-5678-9123-123456789123 * ``` */ class Index extends pulumi.CustomResource { /** * Get an existing Index resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new Index(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Index. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Index.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["capacityUnits"] = state?.capacityUnits; resourceInputs["createdAt"] = state?.createdAt; resourceInputs["description"] = state?.description; resourceInputs["documentMetadataConfigurationUpdates"] = state?.documentMetadataConfigurationUpdates; resourceInputs["edition"] = state?.edition; resourceInputs["errorMessage"] = state?.errorMessage; resourceInputs["indexStatistics"] = state?.indexStatistics; resourceInputs["name"] = state?.name; resourceInputs["region"] = state?.region; resourceInputs["roleArn"] = state?.roleArn; resourceInputs["serverSideEncryptionConfiguration"] = state?.serverSideEncryptionConfiguration; resourceInputs["status"] = state?.status; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["updatedAt"] = state?.updatedAt; resourceInputs["userContextPolicy"] = state?.userContextPolicy; resourceInputs["userGroupResolutionConfiguration"] = state?.userGroupResolutionConfiguration; resourceInputs["userTokenConfigurations"] = state?.userTokenConfigurations; } else { const args = argsOrState; if (args?.roleArn === undefined && !opts.urn) { throw new Error("Missing required property 'roleArn'"); } resourceInputs["capacityUnits"] = args?.capacityUnits; resourceInputs["description"] = args?.description; resourceInputs["documentMetadataConfigurationUpdates"] = args?.documentMetadataConfigurationUpdates; resourceInputs["edition"] = args?.edition; resourceInputs["name"] = args?.name; resourceInputs["region"] = args?.region; resourceInputs["roleArn"] = args?.roleArn; resourceInputs["serverSideEncryptionConfiguration"] = args?.serverSideEncryptionConfiguration; resourceInputs["tags"] = args?.tags; resourceInputs["userContextPolicy"] = args?.userContextPolicy; resourceInputs["userGroupResolutionConfiguration"] = args?.userGroupResolutionConfiguration; resourceInputs["userTokenConfigurations"] = args?.userTokenConfigurations; resourceInputs["arn"] = undefined /*out*/; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["errorMessage"] = undefined /*out*/; resourceInputs["indexStatistics"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Index.__pulumiType, name, resourceInputs, opts); } } exports.Index = Index; /** @internal */ Index.__pulumiType = 'aws:kendra/index:Index'; //# sourceMappingURL=index_.js.map