// *** 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;
using Pulumi;

namespace TencentCloudIAC.PulumiPackage.Tencentcloud.Cls
{
    /// <summary>
    /// Provides a resource to create a cls config
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var config = new Tencentcloud.Cls.Config("config", new Tencentcloud.Cls.ConfigArgs
    ///         {
    ///             ExcludePaths = 
    ///             {
    ///                 new Tencentcloud.Cls.Inputs.ConfigExcludePathArgs
    ///                 {
    ///                     Type = "Path",
    ///                     Value = "/data",
    ///                 },
    ///                 new Tencentcloud.Cls.Inputs.ConfigExcludePathArgs
    ///                 {
    ///                     Type = "File",
    ///                     Value = "/file",
    ///                 },
    ///             },
    ///             ExtractRule = new Tencentcloud.Cls.Inputs.ConfigExtractRuleArgs
    ///             {
    ///                 Backtracking = -1,
    ///                 FilterKeyRegexes = 
    ///                 {
    ///                     new Tencentcloud.Cls.Inputs.ConfigExtractRuleFilterKeyRegexArgs
    ///                     {
    ///                         Key = "key1",
    ///                         Regex = "value1",
    ///                     },
    ///                     new Tencentcloud.Cls.Inputs.ConfigExtractRuleFilterKeyRegexArgs
    ///                     {
    ///                         Key = "key2",
    ///                         Regex = "value2",
    ///                     },
    ///                 },
    ///                 UnMatchLogKey = "config",
    ///                 UnMatchUpLoadSwitch = true,
    ///             },
    ///             LogType = "json_log",
    ///             Output = "4d07fba0-b93e-4e0b-9a7f-d58542560bbb",
    ///             Path = "/var/log/kubernetes",
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// </summary>
    [TencentcloudResourceType("tencentcloud:Cls/config:Config")]
    public partial class Config : Pulumi.CustomResource
    {
        /// <summary>
        /// Collection path blocklist.
        /// </summary>
        [Output("excludePaths")]
        public Output<ImmutableArray<Outputs.ConfigExcludePath>> ExcludePaths { get; private set; } = null!;

        /// <summary>
        /// Extraction rule. If ExtractRule is set, LogType must be set.
        /// </summary>
        [Output("extractRule")]
        public Output<Outputs.ConfigExtractRule> ExtractRule { get; private set; } = null!;

        /// <summary>
        /// Type of the log to be collected. Valid values: json_log: log in JSON format; delimiter_log: log in delimited format; minimalist_log: minimalist log; multiline_log: log in multi-line format; fullregex_log: log in full regex format. Default value: minimalist_log.
        /// </summary>
        [Output("logType")]
        public Output<string?> LogType { get; private set; } = null!;

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

        /// <summary>
        /// Log topic ID (TopicId) of collection configuration.
        /// </summary>
        [Output("output")]
        public Output<string?> Output { get; private set; } = null!;

        /// <summary>
        /// Log collection path containing the filename.
        /// </summary>
        [Output("path")]
        public Output<string?> Path { get; private set; } = null!;

        /// <summary>
        /// Custom collection rule, which is a serialized JSON string.
        /// </summary>
        [Output("userDefineRule")]
        public Output<string?> UserDefineRule { get; private set; } = null!;


        /// <summary>
        /// Create a Config 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 Config(string name, ConfigArgs args, CustomResourceOptions? options = null)
            : base("tencentcloud:Cls/config:Config", name, args ?? new ConfigArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Config(string name, Input<string> id, ConfigState? state = null, CustomResourceOptions? options = null)
            : base("tencentcloud:Cls/config:Config", 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/tencentcloudstack",
            };
            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 Config 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 Config Get(string name, Input<string> id, ConfigState? state = null, CustomResourceOptions? options = null)
        {
            return new Config(name, id, state, options);
        }
    }

    public sealed class ConfigArgs : Pulumi.ResourceArgs
    {
        [Input("excludePaths")]
        private InputList<Inputs.ConfigExcludePathArgs>? _excludePaths;

        /// <summary>
        /// Collection path blocklist.
        /// </summary>
        public InputList<Inputs.ConfigExcludePathArgs> ExcludePaths
        {
            get => _excludePaths ?? (_excludePaths = new InputList<Inputs.ConfigExcludePathArgs>());
            set => _excludePaths = value;
        }

        /// <summary>
        /// Extraction rule. If ExtractRule is set, LogType must be set.
        /// </summary>
        [Input("extractRule", required: true)]
        public Input<Inputs.ConfigExtractRuleArgs> ExtractRule { get; set; } = null!;

        /// <summary>
        /// Type of the log to be collected. Valid values: json_log: log in JSON format; delimiter_log: log in delimited format; minimalist_log: minimalist log; multiline_log: log in multi-line format; fullregex_log: log in full regex format. Default value: minimalist_log.
        /// </summary>
        [Input("logType")]
        public Input<string>? LogType { get; set; }

        /// <summary>
        /// Collection configuration name.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// Log topic ID (TopicId) of collection configuration.
        /// </summary>
        [Input("output")]
        public Input<string>? Output { get; set; }

        /// <summary>
        /// Log collection path containing the filename.
        /// </summary>
        [Input("path")]
        public Input<string>? Path { get; set; }

        /// <summary>
        /// Custom collection rule, which is a serialized JSON string.
        /// </summary>
        [Input("userDefineRule")]
        public Input<string>? UserDefineRule { get; set; }

        public ConfigArgs()
        {
        }
    }

    public sealed class ConfigState : Pulumi.ResourceArgs
    {
        [Input("excludePaths")]
        private InputList<Inputs.ConfigExcludePathGetArgs>? _excludePaths;

        /// <summary>
        /// Collection path blocklist.
        /// </summary>
        public InputList<Inputs.ConfigExcludePathGetArgs> ExcludePaths
        {
            get => _excludePaths ?? (_excludePaths = new InputList<Inputs.ConfigExcludePathGetArgs>());
            set => _excludePaths = value;
        }

        /// <summary>
        /// Extraction rule. If ExtractRule is set, LogType must be set.
        /// </summary>
        [Input("extractRule")]
        public Input<Inputs.ConfigExtractRuleGetArgs>? ExtractRule { get; set; }

        /// <summary>
        /// Type of the log to be collected. Valid values: json_log: log in JSON format; delimiter_log: log in delimited format; minimalist_log: minimalist log; multiline_log: log in multi-line format; fullregex_log: log in full regex format. Default value: minimalist_log.
        /// </summary>
        [Input("logType")]
        public Input<string>? LogType { get; set; }

        /// <summary>
        /// Collection configuration name.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// Log topic ID (TopicId) of collection configuration.
        /// </summary>
        [Input("output")]
        public Input<string>? Output { get; set; }

        /// <summary>
        /// Log collection path containing the filename.
        /// </summary>
        [Input("path")]
        public Input<string>? Path { get; set; }

        /// <summary>
        /// Custom collection rule, which is a serialized JSON string.
        /// </summary>
        [Input("userDefineRule")]
        public Input<string>? UserDefineRule { get; set; }

        public ConfigState()
        {
        }
    }
}
