<filename>sdk/dotnet/IndexLifecycle.cs// *** 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! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.Elasticstack
{
    /// <summary>
    /// 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
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using System.Text.Json;
    /// using Pulumi;
    /// using Elasticstack = Pulumi.Elasticstack;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var myIlm = new Elasticstack.IndexLifecycle("myIlm", new()
    ///     {
    ///         Hot = new Elasticstack.Inputs.IndexLifecycleHotArgs
    ///         {
    ///             MinAge = "1h",
    ///             SetPriority = new Elasticstack.Inputs.IndexLifecycleHotSetPriorityArgs
    ///             {
    ///                 Priority = 0,
    ///             },
    ///             Rollover = new Elasticstack.Inputs.IndexLifecycleHotRolloverArgs
    ///             {
    ///                 MaxAge = "1d",
    ///             },
    ///             Readonly = null,
    ///         },
    ///         Warm = new Elasticstack.Inputs.IndexLifecycleWarmArgs
    ///         {
    ///             MinAge = "0ms",
    ///             SetPriority = new Elasticstack.Inputs.IndexLifecycleWarmSetPriorityArgs
    ///             {
    ///                 Priority = 10,
    ///             },
    ///             Readonly = null,
    ///             Allocate = new Elasticstack.Inputs.IndexLifecycleWarmAllocateArgs
    ///             {
    ///                 Exclude = JsonSerializer.Serialize(new Dictionary&lt;string, object?&gt;
    ///                 {
    ///                     ["box_type"] = "hot",
    ///                 }),
    ///                 NumberOfReplicas = 1,
    ///                 TotalShardsPerNode = 200,
    ///             },
    ///         },
    ///         Delete = new Elasticstack.Inputs.IndexLifecycleDeleteArgs
    ///         {
    ///             MinAge = "2d",
    ///             Delete = null,
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// ```sh
    ///  $ pulumi import elasticstack:index/indexLifecycle:IndexLifecycle my_ilm &lt;cluster_uuid&gt;/&lt;ilm_name&gt;
    /// ```
    /// </summary>
    [ElasticstackResourceType("elasticstack:index/indexLifecycle:IndexLifecycle")]
    public partial class IndexLifecycle : global::Pulumi.CustomResource
    {
        /// <summary>
        /// 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.
        /// </summary>
        [Output("cold")]
        public Output<Outputs.IndexLifecycleCold?> Cold { get; private set; } = null!;

        /// <summary>
        /// The index is no longer needed and can safely be removed.
        /// </summary>
        [Output("delete")]
        public Output<Outputs.IndexLifecycleDelete?> Delete { get; private set; } = null!;

        /// <summary>
        /// Elasticsearch connection configuration block.
        /// </summary>
        [Output("elasticsearchConnection")]
        public Output<Outputs.IndexLifecycleElasticsearchConnection?> ElasticsearchConnection { get; private set; } = null!;

        /// <summary>
        /// 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.
        /// </summary>
        [Output("frozen")]
        public Output<Outputs.IndexLifecycleFrozen?> Frozen { get; private set; } = null!;

        /// <summary>
        /// The index is actively being updated and queried.
        /// </summary>
        [Output("hot")]
        public Output<Outputs.IndexLifecycleHot?> Hot { get; private set; } = null!;

        /// <summary>
        /// Optional user metadata about the ilm policy. Must be valid JSON document.
        /// </summary>
        [Output("metadata")]
        public Output<string?> Metadata { get; private set; } = null!;

        /// <summary>
        /// The DateTime of the last modification.
        /// </summary>
        [Output("modifiedDate")]
        public Output<string> ModifiedDate { get; private set; } = null!;

        /// <summary>
        /// Identifier for the policy.
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// The index is no longer being updated but is still being queried.
        /// </summary>
        [Output("warm")]
        public Output<Outputs.IndexLifecycleWarm?> Warm { get; private set; } = null!;


        /// <summary>
        /// Create a IndexLifecycle resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public IndexLifecycle(string name, IndexLifecycleArgs? args = null, CustomResourceOptions? options = null)
            : base("elasticstack:index/indexLifecycle:IndexLifecycle", name, args ?? new IndexLifecycleArgs(), MakeResourceOptions(options, ""))
        {
        }

        private IndexLifecycle(string name, Input<string> id, IndexLifecycleState? state = null, CustomResourceOptions? options = null)
            : base("elasticstack:index/indexLifecycle:IndexLifecycle", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/zlepper",
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing IndexLifecycle resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static IndexLifecycle Get(string name, Input<string> id, IndexLifecycleState? state = null, CustomResourceOptions? options = null)
        {
            return new IndexLifecycle(name, id, state, options);
        }
    }

    public sealed class IndexLifecycleArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// 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.
        /// </summary>
        [Input("cold")]
        public Input<Inputs.IndexLifecycleColdArgs>? Cold { get; set; }

        /// <summary>
        /// The index is no longer needed and can safely be removed.
        /// </summary>
        [Input("delete")]
        public Input<Inputs.IndexLifecycleDeleteArgs>? Delete { get; set; }

        /// <summary>
        /// Elasticsearch connection configuration block.
        /// </summary>
        [Input("elasticsearchConnection")]
        public Input<Inputs.IndexLifecycleElasticsearchConnectionArgs>? ElasticsearchConnection { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("frozen")]
        public Input<Inputs.IndexLifecycleFrozenArgs>? Frozen { get; set; }

        /// <summary>
        /// The index is actively being updated and queried.
        /// </summary>
        [Input("hot")]
        public Input<Inputs.IndexLifecycleHotArgs>? Hot { get; set; }

        /// <summary>
        /// Optional user metadata about the ilm policy. Must be valid JSON document.
        /// </summary>
        [Input("metadata")]
        public Input<string>? Metadata { get; set; }

        /// <summary>
        /// Identifier for the policy.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// The index is no longer being updated but is still being queried.
        /// </summary>
        [Input("warm")]
        public Input<Inputs.IndexLifecycleWarmArgs>? Warm { get; set; }

        public IndexLifecycleArgs()
        {
        }
        public static new IndexLifecycleArgs Empty => new IndexLifecycleArgs();
    }

    public sealed class IndexLifecycleState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// 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.
        /// </summary>
        [Input("cold")]
        public Input<Inputs.IndexLifecycleColdGetArgs>? Cold { get; set; }

        /// <summary>
        /// The index is no longer needed and can safely be removed.
        /// </summary>
        [Input("delete")]
        public Input<Inputs.IndexLifecycleDeleteGetArgs>? Delete { get; set; }

        /// <summary>
        /// Elasticsearch connection configuration block.
        /// </summary>
        [Input("elasticsearchConnection")]
        public Input<Inputs.IndexLifecycleElasticsearchConnectionGetArgs>? ElasticsearchConnection { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("frozen")]
        public Input<Inputs.IndexLifecycleFrozenGetArgs>? Frozen { get; set; }

        /// <summary>
        /// The index is actively being updated and queried.
        /// </summary>
        [Input("hot")]
        public Input<Inputs.IndexLifecycleHotGetArgs>? Hot { get; set; }

        /// <summary>
        /// Optional user metadata about the ilm policy. Must be valid JSON document.
        /// </summary>
        [Input("metadata")]
        public Input<string>? Metadata { get; set; }

        /// <summary>
        /// The DateTime of the last modification.
        /// </summary>
        [Input("modifiedDate")]
        public Input<string>? ModifiedDate { get; set; }

        /// <summary>
        /// Identifier for the policy.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// The index is no longer being updated but is still being queried.
        /// </summary>
        [Input("warm")]
        public Input<Inputs.IndexLifecycleWarmGetArgs>? Warm { get; set; }

        public IndexLifecycleState()
        {
        }
        public static new IndexLifecycleState Empty => new IndexLifecycleState();
    }
}
