<gh_stars>0// *** 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 centrally managed logstash pipelines. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-apis.html
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Elasticstack = Pulumi.Elasticstack;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var example = new Elasticstack.LogstashPipeline("example", new()
    ///     {
    ///         PipelineId = "test_pipeline",
    ///         Description = "This is an example pipeline",
    ///         Pipeline = @"input{}
    /// filter{}
    /// output{}
    /// ",
    ///         PipelineMetadata = 
    ///         {
    ///             { "type", "logstash_pipeline" },
    ///             { "version", "1" },
    ///         },
    ///         PipelineBatchDelay = 50,
    ///         PipelineBatchSize = 125,
    ///         PipelineEcsCompatibility = "disabled",
    ///         PipelineOrdered = "auto",
    ///         PipelinePluginClassloaders = false,
    ///         PipelineUnsafeShutdown = false,
    ///         PipelineWorkers = 1,
    ///         QueueCheckpointAcks = 1024,
    ///         QueueCheckpointRetry = true,
    ///         QueueCheckpointWrites = 1024,
    ///         QueueDrain = false,
    ///         QueueMaxBytesNumber = 1,
    ///         QueueMaxBytesUnits = "gb",
    ///         QueueMaxEvents = 0,
    ///         QueuePageCapacity = "64mb",
    ///         QueueType = "persisted",
    ///     });
    /// 
    ///     return new Dictionary&lt;string, object?&gt;
    ///     {
    ///         ["pipeline"] = example.PipelineId,
    ///     };
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// ```sh
    ///  $ pulumi import elasticstack:index/logstashPipeline:LogstashPipeline my_pipeline &lt;cluster_uuid&gt;/&lt;pipeline ID&gt;
    /// ```
    /// </summary>
    [ElasticstackResourceType("elasticstack:index/logstashPipeline:LogstashPipeline")]
    public partial class LogstashPipeline : global::Pulumi.CustomResource
    {
        /// <summary>
        /// Description of the pipeline.
        /// </summary>
        [Output("description")]
        public Output<string?> Description { get; private set; } = null!;

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

        /// <summary>
        /// Date the pipeline was last updated.
        /// </summary>
        [Output("lastModified")]
        public Output<string> LastModified { get; private set; } = null!;

        /// <summary>
        /// Configuration for the pipeline.
        /// </summary>
        [Output("pipeline")]
        public Output<string> Pipeline { get; private set; } = null!;

        /// <summary>
        /// Time in milliseconds to wait for each event before sending an undersized batch to pipeline workers.
        /// </summary>
        [Output("pipelineBatchDelay")]
        public Output<int?> PipelineBatchDelay { get; private set; } = null!;

        /// <summary>
        /// The maximum number of events an individual worker thread collects before executing filters and outputs.
        /// </summary>
        [Output("pipelineBatchSize")]
        public Output<int?> PipelineBatchSize { get; private set; } = null!;

        /// <summary>
        /// Sets the pipeline default value for ecs_compatibility, a setting that is available to plugins that implement an ECS compatibility mode for use with the Elastic Common Schema.
        /// </summary>
        [Output("pipelineEcsCompatibility")]
        public Output<string?> PipelineEcsCompatibility { get; private set; } = null!;

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

        /// <summary>
        /// Optional metadata about the pipeline.
        /// </summary>
        [Output("pipelineMetadata")]
        public Output<ImmutableDictionary<string, string>?> PipelineMetadata { get; private set; } = null!;

        /// <summary>
        /// Set the pipeline event ordering.
        /// </summary>
        [Output("pipelineOrdered")]
        public Output<string?> PipelineOrdered { get; private set; } = null!;

        /// <summary>
        /// (Beta) Load Java plugins in independent classloaders to isolate their dependencies.
        /// </summary>
        [Output("pipelinePluginClassloaders")]
        public Output<bool?> PipelinePluginClassloaders { get; private set; } = null!;

        /// <summary>
        /// Forces Logstash to exit during shutdown even if there are still inflight events in memory.
        /// </summary>
        [Output("pipelineUnsafeShutdown")]
        public Output<bool?> PipelineUnsafeShutdown { get; private set; } = null!;

        /// <summary>
        /// The number of parallel workers used to run the filter and output stages of the pipeline.
        /// </summary>
        [Output("pipelineWorkers")]
        public Output<int?> PipelineWorkers { get; private set; } = null!;

        /// <summary>
        /// The maximum number of ACKed events before forcing a checkpoint when persistent queues are enabled.
        /// </summary>
        [Output("queueCheckpointAcks")]
        public Output<int?> QueueCheckpointAcks { get; private set; } = null!;

        /// <summary>
        /// When enabled, Logstash will retry four times per attempted checkpoint write for any checkpoint writes that fail. Any subsequent errors are not retried.
        /// </summary>
        [Output("queueCheckpointRetry")]
        public Output<bool?> QueueCheckpointRetry { get; private set; } = null!;

        /// <summary>
        /// The maximum number of written events before forcing a checkpoint when persistent queues are enabled.
        /// </summary>
        [Output("queueCheckpointWrites")]
        public Output<int?> QueueCheckpointWrites { get; private set; } = null!;

        /// <summary>
        /// When enabled, Logstash waits until the persistent queue is drained before shutting down.
        /// </summary>
        [Output("queueDrain")]
        public Output<bool?> QueueDrain { get; private set; } = null!;

        /// <summary>
        /// The total capacity of the queue when persistent queues are enabled.
        /// </summary>
        [Output("queueMaxBytesNumber")]
        public Output<int?> QueueMaxBytesNumber { get; private set; } = null!;

        /// <summary>
        /// Units for the total capacity of the queue when persistent queues are enabled.
        /// </summary>
        [Output("queueMaxBytesUnits")]
        public Output<string?> QueueMaxBytesUnits { get; private set; } = null!;

        /// <summary>
        /// The maximum number of unread events in the queue when persistent queues are enabled.
        /// </summary>
        [Output("queueMaxEvents")]
        public Output<int?> QueueMaxEvents { get; private set; } = null!;

        /// <summary>
        /// The size of the page data files used when persistent queues are enabled. The queue data consists of append-only data files separated into pages.
        /// </summary>
        [Output("queuePageCapacity")]
        public Output<string?> QueuePageCapacity { get; private set; } = null!;

        /// <summary>
        /// The internal queueing model for event buffering. Options are memory for in-memory queueing, or persisted for disk-based acknowledged queueing.
        /// </summary>
        [Output("queueType")]
        public Output<string?> QueueType { get; private set; } = null!;

        /// <summary>
        /// User who last updated the pipeline.
        /// </summary>
        [Output("username")]
        public Output<string?> Username { get; private set; } = null!;


        /// <summary>
        /// Create a LogstashPipeline 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 LogstashPipeline(string name, LogstashPipelineArgs args, CustomResourceOptions? options = null)
            : base("elasticstack:index/logstashPipeline:LogstashPipeline", name, args ?? new LogstashPipelineArgs(), MakeResourceOptions(options, ""))
        {
        }

        private LogstashPipeline(string name, Input<string> id, LogstashPipelineState? state = null, CustomResourceOptions? options = null)
            : base("elasticstack:index/logstashPipeline:LogstashPipeline", 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 LogstashPipeline 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 LogstashPipeline Get(string name, Input<string> id, LogstashPipelineState? state = null, CustomResourceOptions? options = null)
        {
            return new LogstashPipeline(name, id, state, options);
        }
    }

    public sealed class LogstashPipelineArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Description of the pipeline.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

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

        /// <summary>
        /// Configuration for the pipeline.
        /// </summary>
        [Input("pipeline", required: true)]
        public Input<string> Pipeline { get; set; } = null!;

        /// <summary>
        /// Time in milliseconds to wait for each event before sending an undersized batch to pipeline workers.
        /// </summary>
        [Input("pipelineBatchDelay")]
        public Input<int>? PipelineBatchDelay { get; set; }

        /// <summary>
        /// The maximum number of events an individual worker thread collects before executing filters and outputs.
        /// </summary>
        [Input("pipelineBatchSize")]
        public Input<int>? PipelineBatchSize { get; set; }

        /// <summary>
        /// Sets the pipeline default value for ecs_compatibility, a setting that is available to plugins that implement an ECS compatibility mode for use with the Elastic Common Schema.
        /// </summary>
        [Input("pipelineEcsCompatibility")]
        public Input<string>? PipelineEcsCompatibility { get; set; }

        /// <summary>
        /// Identifier for the pipeline.
        /// </summary>
        [Input("pipelineId", required: true)]
        public Input<string> PipelineId { get; set; } = null!;

        [Input("pipelineMetadata")]
        private InputMap<string>? _pipelineMetadata;

        /// <summary>
        /// Optional metadata about the pipeline.
        /// </summary>
        public InputMap<string> PipelineMetadata
        {
            get => _pipelineMetadata ?? (_pipelineMetadata = new InputMap<string>());
            set => _pipelineMetadata = value;
        }

        /// <summary>
        /// Set the pipeline event ordering.
        /// </summary>
        [Input("pipelineOrdered")]
        public Input<string>? PipelineOrdered { get; set; }

        /// <summary>
        /// (Beta) Load Java plugins in independent classloaders to isolate their dependencies.
        /// </summary>
        [Input("pipelinePluginClassloaders")]
        public Input<bool>? PipelinePluginClassloaders { get; set; }

        /// <summary>
        /// Forces Logstash to exit during shutdown even if there are still inflight events in memory.
        /// </summary>
        [Input("pipelineUnsafeShutdown")]
        public Input<bool>? PipelineUnsafeShutdown { get; set; }

        /// <summary>
        /// The number of parallel workers used to run the filter and output stages of the pipeline.
        /// </summary>
        [Input("pipelineWorkers")]
        public Input<int>? PipelineWorkers { get; set; }

        /// <summary>
        /// The maximum number of ACKed events before forcing a checkpoint when persistent queues are enabled.
        /// </summary>
        [Input("queueCheckpointAcks")]
        public Input<int>? QueueCheckpointAcks { get; set; }

        /// <summary>
        /// When enabled, Logstash will retry four times per attempted checkpoint write for any checkpoint writes that fail. Any subsequent errors are not retried.
        /// </summary>
        [Input("queueCheckpointRetry")]
        public Input<bool>? QueueCheckpointRetry { get; set; }

        /// <summary>
        /// The maximum number of written events before forcing a checkpoint when persistent queues are enabled.
        /// </summary>
        [Input("queueCheckpointWrites")]
        public Input<int>? QueueCheckpointWrites { get; set; }

        /// <summary>
        /// When enabled, Logstash waits until the persistent queue is drained before shutting down.
        /// </summary>
        [Input("queueDrain")]
        public Input<bool>? QueueDrain { get; set; }

        /// <summary>
        /// The total capacity of the queue when persistent queues are enabled.
        /// </summary>
        [Input("queueMaxBytesNumber")]
        public Input<int>? QueueMaxBytesNumber { get; set; }

        /// <summary>
        /// Units for the total capacity of the queue when persistent queues are enabled.
        /// </summary>
        [Input("queueMaxBytesUnits")]
        public Input<string>? QueueMaxBytesUnits { get; set; }

        /// <summary>
        /// The maximum number of unread events in the queue when persistent queues are enabled.
        /// </summary>
        [Input("queueMaxEvents")]
        public Input<int>? QueueMaxEvents { get; set; }

        /// <summary>
        /// The size of the page data files used when persistent queues are enabled. The queue data consists of append-only data files separated into pages.
        /// </summary>
        [Input("queuePageCapacity")]
        public Input<string>? QueuePageCapacity { get; set; }

        /// <summary>
        /// The internal queueing model for event buffering. Options are memory for in-memory queueing, or persisted for disk-based acknowledged queueing.
        /// </summary>
        [Input("queueType")]
        public Input<string>? QueueType { get; set; }

        /// <summary>
        /// User who last updated the pipeline.
        /// </summary>
        [Input("username")]
        public Input<string>? Username { get; set; }

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

    public sealed class LogstashPipelineState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Description of the pipeline.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

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

        /// <summary>
        /// Date the pipeline was last updated.
        /// </summary>
        [Input("lastModified")]
        public Input<string>? LastModified { get; set; }

        /// <summary>
        /// Configuration for the pipeline.
        /// </summary>
        [Input("pipeline")]
        public Input<string>? Pipeline { get; set; }

        /// <summary>
        /// Time in milliseconds to wait for each event before sending an undersized batch to pipeline workers.
        /// </summary>
        [Input("pipelineBatchDelay")]
        public Input<int>? PipelineBatchDelay { get; set; }

        /// <summary>
        /// The maximum number of events an individual worker thread collects before executing filters and outputs.
        /// </summary>
        [Input("pipelineBatchSize")]
        public Input<int>? PipelineBatchSize { get; set; }

        /// <summary>
        /// Sets the pipeline default value for ecs_compatibility, a setting that is available to plugins that implement an ECS compatibility mode for use with the Elastic Common Schema.
        /// </summary>
        [Input("pipelineEcsCompatibility")]
        public Input<string>? PipelineEcsCompatibility { get; set; }

        /// <summary>
        /// Identifier for the pipeline.
        /// </summary>
        [Input("pipelineId")]
        public Input<string>? PipelineId { get; set; }

        [Input("pipelineMetadata")]
        private InputMap<string>? _pipelineMetadata;

        /// <summary>
        /// Optional metadata about the pipeline.
        /// </summary>
        public InputMap<string> PipelineMetadata
        {
            get => _pipelineMetadata ?? (_pipelineMetadata = new InputMap<string>());
            set => _pipelineMetadata = value;
        }

        /// <summary>
        /// Set the pipeline event ordering.
        /// </summary>
        [Input("pipelineOrdered")]
        public Input<string>? PipelineOrdered { get; set; }

        /// <summary>
        /// (Beta) Load Java plugins in independent classloaders to isolate their dependencies.
        /// </summary>
        [Input("pipelinePluginClassloaders")]
        public Input<bool>? PipelinePluginClassloaders { get; set; }

        /// <summary>
        /// Forces Logstash to exit during shutdown even if there are still inflight events in memory.
        /// </summary>
        [Input("pipelineUnsafeShutdown")]
        public Input<bool>? PipelineUnsafeShutdown { get; set; }

        /// <summary>
        /// The number of parallel workers used to run the filter and output stages of the pipeline.
        /// </summary>
        [Input("pipelineWorkers")]
        public Input<int>? PipelineWorkers { get; set; }

        /// <summary>
        /// The maximum number of ACKed events before forcing a checkpoint when persistent queues are enabled.
        /// </summary>
        [Input("queueCheckpointAcks")]
        public Input<int>? QueueCheckpointAcks { get; set; }

        /// <summary>
        /// When enabled, Logstash will retry four times per attempted checkpoint write for any checkpoint writes that fail. Any subsequent errors are not retried.
        /// </summary>
        [Input("queueCheckpointRetry")]
        public Input<bool>? QueueCheckpointRetry { get; set; }

        /// <summary>
        /// The maximum number of written events before forcing a checkpoint when persistent queues are enabled.
        /// </summary>
        [Input("queueCheckpointWrites")]
        public Input<int>? QueueCheckpointWrites { get; set; }

        /// <summary>
        /// When enabled, Logstash waits until the persistent queue is drained before shutting down.
        /// </summary>
        [Input("queueDrain")]
        public Input<bool>? QueueDrain { get; set; }

        /// <summary>
        /// The total capacity of the queue when persistent queues are enabled.
        /// </summary>
        [Input("queueMaxBytesNumber")]
        public Input<int>? QueueMaxBytesNumber { get; set; }

        /// <summary>
        /// Units for the total capacity of the queue when persistent queues are enabled.
        /// </summary>
        [Input("queueMaxBytesUnits")]
        public Input<string>? QueueMaxBytesUnits { get; set; }

        /// <summary>
        /// The maximum number of unread events in the queue when persistent queues are enabled.
        /// </summary>
        [Input("queueMaxEvents")]
        public Input<int>? QueueMaxEvents { get; set; }

        /// <summary>
        /// The size of the page data files used when persistent queues are enabled. The queue data consists of append-only data files separated into pages.
        /// </summary>
        [Input("queuePageCapacity")]
        public Input<string>? QueuePageCapacity { get; set; }

        /// <summary>
        /// The internal queueing model for event buffering. Options are memory for in-memory queueing, or persisted for disk-based acknowledged queueing.
        /// </summary>
        [Input("queueType")]
        public Input<string>? QueueType { get; set; }

        /// <summary>
        /// User who last updated the pipeline.
        /// </summary>
        [Input("username")]
        public Input<string>? Username { get; set; }

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