import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "./types"; /** * Creates or updates an index. This resource can define settings, mappings and aliases. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as elasticstack from "@pulumi/elasticstack"; * * const myIndex = new elasticstack.ElasticsearchIndex("myIndex", { * aliases: [ * { * name: "my_alias_1", * }, * { * name: "my_alias_2", * filter: JSON.stringify({ * term: { * "user.id": "developer", * }, * }), * }, * ], * mappings: JSON.stringify({ * properties: { * field1: { * type: "keyword", * }, * field2: { * type: "text", * }, * field3: { * properties: { * inner_field1: { * type: "text", * index: false, * }, * inner_field2: { * type: "integer", * index: false, * }, * }, * }, * }, * }), * settings: { * settings: [ * { * name: "index.number_of_shards", * value: "1", * }, * { * name: "index.number_of_replicas", * value: "2", * }, * { * name: "index.search.idle.after", * value: "20s", * }, * ], * }, * }); * ``` * * ## Import * * You can later adjust the index configuration to account for those imported settings. Some of the default settings, which could be imported are`index.number_of_replicas`, `index.number_of_shards` and `index.routing.allocation.include._tier_preference`. # NOTEwhile importing index resource, keep in mind, that some of the default index settings will be imported into the TF state too # You can later adjust the index configuration to account for those imported settings * * ```sh * $ pulumi import elasticstack:index/elasticsearchIndex:ElasticsearchIndex my_index / * ``` */ export declare class ElasticsearchIndex extends pulumi.CustomResource { /** * Get an existing ElasticsearchIndex 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: string, id: pulumi.Input, state?: ElasticsearchIndexState, opts?: pulumi.CustomResourceOptions): ElasticsearchIndex; /** * Returns true if the given object is an instance of ElasticsearchIndex. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is ElasticsearchIndex; /** * Aliases for the index. */ readonly aliases: pulumi.Output; /** * Used to establish connection to Elasticsearch server. Overrides environment variables if present. */ readonly elasticsearchConnection: pulumi.Output; /** * Internal identifier of the resource */ readonly id: pulumi.Output; /** * Mapping for fields in the index. * If specified, this mapping can include: field names, field data types (https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html), mapping parameters (https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-params.html). * **NOTE:** changing datatypes in the existing *mappings* will force index to be re-created. */ readonly mappings: pulumi.Output; /** * Name of the index you wish to create. */ readonly name: pulumi.Output; /** * Configuration options for the index. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-modules-settings. * **NOTE:** Static index settings (see: https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#*static*index_settings) can be only set on the index creation and later cannot be removed or updated - *apply* will return error */ readonly settings: pulumi.Output; /** * All raw settings fetched from the cluster. */ readonly settingsRaw: pulumi.Output; /** * Create a ElasticsearchIndex resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: ElasticsearchIndexArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ElasticsearchIndex resources. */ export interface ElasticsearchIndexState { /** * Aliases for the index. */ aliases?: pulumi.Input[]>; /** * Used to establish connection to Elasticsearch server. Overrides environment variables if present. */ elasticsearchConnection?: pulumi.Input; /** * Internal identifier of the resource */ id?: pulumi.Input; /** * Mapping for fields in the index. * If specified, this mapping can include: field names, field data types (https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html), mapping parameters (https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-params.html). * **NOTE:** changing datatypes in the existing *mappings* will force index to be re-created. */ mappings?: pulumi.Input; /** * Name of the index you wish to create. */ name?: pulumi.Input; /** * Configuration options for the index. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-modules-settings. * **NOTE:** Static index settings (see: https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#*static*index_settings) can be only set on the index creation and later cannot be removed or updated - *apply* will return error */ settings?: pulumi.Input; /** * All raw settings fetched from the cluster. */ settingsRaw?: pulumi.Input; } /** * The set of arguments for constructing a ElasticsearchIndex resource. */ export interface ElasticsearchIndexArgs { /** * Aliases for the index. */ aliases?: pulumi.Input[]>; /** * Used to establish connection to Elasticsearch server. Overrides environment variables if present. */ elasticsearchConnection?: pulumi.Input; /** * Mapping for fields in the index. * If specified, this mapping can include: field names, field data types (https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html), mapping parameters (https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-params.html). * **NOTE:** changing datatypes in the existing *mappings* will force index to be re-created. */ mappings?: pulumi.Input; /** * Name of the index you wish to create. */ name?: pulumi.Input; /** * Configuration options for the index. See, https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-modules-settings. * **NOTE:** Static index settings (see: https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#*static*index_settings) can be only set on the index creation and later cannot be removed or updated - *apply* will return error */ settings?: pulumi.Input; }