// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "./types"; import * as utilities from "./utilities"; /** * Creates or updates lifecycle policy. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html and https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-index-lifecycle.html * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as elasticstack from "@pulumi/elasticstack"; * * const myIlm = new elasticstack.ElasticsearchIndexLifecycle("myIlm", { * hot: { * minAge: "1h", * setPriority: { * priority: 10, * }, * rollover: { * maxAge: "1d", * }, * readonly: {}, * }, * warm: { * minAge: "0ms", * setPriority: { * priority: 60, * }, * readonly: {}, * allocate: { * exclude: JSON.stringify({ * box_type: "hot", * }), * numberOfReplicas: 0, * }, * }, * "delete": { * minAge: "2d", * "delete": {}, * }, * }); * ``` * * ## Import * * ```sh * $ pulumi import elasticstack:index/elasticsearchIndexLifecycle:ElasticsearchIndexLifecycle my_ilm / * ``` */ export class ElasticsearchIndexLifecycle extends pulumi.CustomResource { /** * Get an existing ElasticsearchIndexLifecycle 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. */ public static get(name: string, id: pulumi.Input, state?: ElasticsearchIndexLifecycleState, opts?: pulumi.CustomResourceOptions): ElasticsearchIndexLifecycle { return new ElasticsearchIndexLifecycle(name, state, { ...opts, id: id }); } /** @internal */ public static readonly __pulumiType = 'elasticstack:index/elasticsearchIndexLifecycle:ElasticsearchIndexLifecycle'; /** * Returns true if the given object is an instance of ElasticsearchIndexLifecycle. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ public static isInstance(obj: any): obj is ElasticsearchIndexLifecycle { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === ElasticsearchIndexLifecycle.__pulumiType; } /** * The index is no longer being updated and is queried infrequently. The information still needs to be searchable, but it’s okay if those queries are slower. */ public readonly cold!: pulumi.Output; /** * The index is no longer needed and can safely be removed. */ public readonly delete!: pulumi.Output; /** * Used to establish connection to Elasticsearch server. Overrides environment variables if present. */ public readonly elasticsearchConnection!: pulumi.Output; /** * The index is no longer being updated and is queried rarely. The information still needs to be searchable, but it’s okay if those queries are extremely slow. */ public readonly frozen!: pulumi.Output; /** * The index is actively being updated and queried. */ public readonly hot!: pulumi.Output; /** * Internal identifier of the resource */ public /*out*/ readonly id!: pulumi.Output; /** * Optional user metadata about the ilm policy. Must be valid JSON document. */ public readonly metadata!: pulumi.Output; /** * The DateTime of the last modification. */ public /*out*/ readonly modifiedDate!: pulumi.Output; /** * Identifier for the policy. */ public readonly name!: pulumi.Output; /** * The index is no longer being updated but is still being queried. */ public readonly warm!: pulumi.Output; /** * Create a ElasticsearchIndexLifecycle 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?: ElasticsearchIndexLifecycleArgs, opts?: pulumi.CustomResourceOptions) constructor(name: string, argsOrState?: ElasticsearchIndexLifecycleArgs | ElasticsearchIndexLifecycleState, opts?: pulumi.CustomResourceOptions) { let resourceInputs: pulumi.Inputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState as ElasticsearchIndexLifecycleState | undefined; resourceInputs["cold"] = state ? state.cold : undefined; resourceInputs["delete"] = state ? state.delete : undefined; resourceInputs["elasticsearchConnection"] = state ? state.elasticsearchConnection : undefined; resourceInputs["frozen"] = state ? state.frozen : undefined; resourceInputs["hot"] = state ? state.hot : undefined; resourceInputs["id"] = state ? state.id : undefined; resourceInputs["metadata"] = state ? state.metadata : undefined; resourceInputs["modifiedDate"] = state ? state.modifiedDate : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["warm"] = state ? state.warm : undefined; } else { const args = argsOrState as ElasticsearchIndexLifecycleArgs | undefined; resourceInputs["cold"] = args ? args.cold : undefined; resourceInputs["delete"] = args ? args.delete : undefined; resourceInputs["elasticsearchConnection"] = args ? args.elasticsearchConnection : undefined; resourceInputs["frozen"] = args ? args.frozen : undefined; resourceInputs["hot"] = args ? args.hot : undefined; resourceInputs["metadata"] = args ? args.metadata : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["warm"] = args ? args.warm : undefined; resourceInputs["id"] = undefined /*out*/; resourceInputs["modifiedDate"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ElasticsearchIndexLifecycle.__pulumiType, name, resourceInputs, opts); } } /** * Input properties used for looking up and filtering ElasticsearchIndexLifecycle resources. */ export interface ElasticsearchIndexLifecycleState { /** * The index is no longer being updated and is queried infrequently. The information still needs to be searchable, but it’s okay if those queries are slower. */ cold?: pulumi.Input; /** * The index is no longer needed and can safely be removed. */ delete?: pulumi.Input; /** * Used to establish connection to Elasticsearch server. Overrides environment variables if present. */ elasticsearchConnection?: pulumi.Input; /** * The index is no longer being updated and is queried rarely. The information still needs to be searchable, but it’s okay if those queries are extremely slow. */ frozen?: pulumi.Input; /** * The index is actively being updated and queried. */ hot?: pulumi.Input; /** * Internal identifier of the resource */ id?: pulumi.Input; /** * Optional user metadata about the ilm policy. Must be valid JSON document. */ metadata?: pulumi.Input; /** * The DateTime of the last modification. */ modifiedDate?: pulumi.Input; /** * Identifier for the policy. */ name?: pulumi.Input; /** * The index is no longer being updated but is still being queried. */ warm?: pulumi.Input; } /** * The set of arguments for constructing a ElasticsearchIndexLifecycle resource. */ export interface ElasticsearchIndexLifecycleArgs { /** * The index is no longer being updated and is queried infrequently. The information still needs to be searchable, but it’s okay if those queries are slower. */ cold?: pulumi.Input; /** * The index is no longer needed and can safely be removed. */ delete?: pulumi.Input; /** * Used to establish connection to Elasticsearch server. Overrides environment variables if present. */ elasticsearchConnection?: pulumi.Input; /** * The index is no longer being updated and is queried rarely. The information still needs to be searchable, but it’s okay if those queries are extremely slow. */ frozen?: pulumi.Input; /** * The index is actively being updated and queried. */ hot?: pulumi.Input; /** * Optional user metadata about the ilm policy. Must be valid JSON document. */ metadata?: pulumi.Input; /** * Identifier for the policy. */ name?: pulumi.Input; /** * The index is no longer being updated but is still being queried. */ warm?: pulumi.Input; }