<filename>sdk/dotnet/Tencentcloud/Dayu/DdosPolicyV2.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;
using Pulumi;

namespace TencentCloudIAC.PulumiPackage.Tencentcloud.Dayu
{
    /// <summary>
    /// Use this resource to create dayu DDoS policy v2
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var ddosV2 = new Tencentcloud.Dayu.DdosPolicyV2("ddosV2", new Tencentcloud.Dayu.DdosPolicyV2Args
    ///         {
    ///             Acls = 
    ///             {
    ///                 new Tencentcloud.Dayu.Inputs.DdosPolicyV2AclArgs
    ///                 {
    ///                     Action = "transmit",
    ///                     DPortEnd = 10,
    ///                     DPortStart = 1,
    ///                     ForwardProtocol = "all",
    ///                     Priority = 9,
    ///                     SPortEnd = 20,
    ///                     SPortStart = 10,
    ///                 },
    ///             },
    ///             BlackWhiteIps = 
    ///             {
    ///                 new Tencentcloud.Dayu.Inputs.DdosPolicyV2BlackWhiteIpArgs
    ///                 {
    ///                     Ip = "1.2.3.4",
    ///                     IpType = "black",
    ///                 },
    ///             },
    ///             Business = "bgpip",
    ///             DdosAi = "on",
    ///             DdosConnectLimit = new Tencentcloud.Dayu.Inputs.DdosPolicyV2DdosConnectLimitArgs
    ///             {
    ///                 BadConnThreshold = 30,
    ///                 ConnTimeout = 30,
    ///                 DstConnLimit = 21,
    ///                 DstNewLimit = 20,
    ///                 NullConnEnable = 1,
    ///                 SdConnLimit = 11,
    ///                 SdNewLimit = 10,
    ///                 SynLimit = 20,
    ///                 SynRate = 10,
    ///             },
    ///             DdosGeoIpBlockConfigs = 
    ///             {
    ///                 new Tencentcloud.Dayu.Inputs.DdosPolicyV2DdosGeoIpBlockConfigArgs
    ///                 {
    ///                     Action = "drop",
    ///                     AreaLists = 
    ///                     {
    ///                         100001,
    ///                     },
    ///                     RegionType = "customized",
    ///                 },
    ///             },
    ///             DdosLevel = "low",
    ///             DdosSpeedLimitConfigs = 
    ///             {
    ///                 new Tencentcloud.Dayu.Inputs.DdosPolicyV2DdosSpeedLimitConfigArgs
    ///                 {
    ///                     Bandwidth = 20,
    ///                     DstPortList = "10",
    ///                     Mode = 1,
    ///                     PacketRate = 10,
    ///                     ProtocolList = "TCP",
    ///                 },
    ///             },
    ///             DdosThreshold = 100,
    ///             PacketFilters = 
    ///             {
    ///                 new Tencentcloud.Dayu.Inputs.DdosPolicyV2PacketFilterArgs
    ///                 {
    ///                     Action = "drop",
    ///                     DPortEnd = 20,
    ///                     DPortStart = 20,
    ///                     Depth = 2,
    ///                     Depth2 = 3,
    ///                     IsNot = 0,
    ///                     IsNot2 = 0,
    ///                     MatchBegin = "begin_l3",
    ///                     MatchBegin2 = "begin_l3",
    ///                     MatchLogic = "and",
    ///                     MatchType = "pcre",
    ///                     MatchType2 = "pcre",
    ///                     Offset = 1,
    ///                     Offset2 = 2,
    ///                     PktlenMax = 30,
    ///                     PktlenMin = 30,
    ///                     Protocol = "all",
    ///                     SPortEnd = 10,
    ///                     SPortStart = 10,
    ///                     Str = "12",
    ///                     Str2 = "30",
    ///                 },
    ///             },
    ///             ProtocolBlockConfigs = 
    ///             {
    ///                 new Tencentcloud.Dayu.Inputs.DdosPolicyV2ProtocolBlockConfigArgs
    ///                 {
    ///                     DropIcmp = 1,
    ///                     DropOther = 0,
    ///                     DropTcp = 0,
    ///                     DropUdp = 0,
    ///                 },
    ///             },
    ///             ResourceId = "bgpip-000004xf",
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// </summary>
    [TencentcloudResourceType("tencentcloud:Dayu/ddosPolicyV2:DdosPolicyV2")]
    public partial class DdosPolicyV2 : Pulumi.CustomResource
    {
        /// <summary>
        /// Port ACL policy for DDoS protection.
        /// </summary>
        [Output("acls")]
        public Output<ImmutableArray<Outputs.DdosPolicyV2Acl>> Acls { get; private set; } = null!;

        /// <summary>
        /// DDoS-protected IP blacklist and whitelist.
        /// </summary>
        [Output("blackWhiteIps")]
        public Output<ImmutableArray<Outputs.DdosPolicyV2BlackWhiteIp>> BlackWhiteIps { get; private set; } = null!;

        /// <summary>
        /// Business of resource instance. bgpip indicates anti-anti-ip ip; bgp means exclusive package; bgp-multip means shared packet; net indicates anti-anti-ip pro version.
        /// </summary>
        [Output("business")]
        public Output<string?> Business { get; private set; } = null!;

        /// <summary>
        /// AI protection switch, take the value [`on`, `off`].
        /// </summary>
        [Output("ddosAi")]
        public Output<string?> DdosAi { get; private set; } = null!;

        /// <summary>
        /// DDoS connection suppression options.
        /// </summary>
        [Output("ddosConnectLimit")]
        public Output<Outputs.DdosPolicyV2DdosConnectLimit?> DdosConnectLimit { get; private set; } = null!;

        /// <summary>
        /// DDoS-protected area block configuration.
        /// </summary>
        [Output("ddosGeoIpBlockConfigs")]
        public Output<ImmutableArray<Outputs.DdosPolicyV2DdosGeoIpBlockConfig>> DdosGeoIpBlockConfigs { get; private set; } = null!;

        /// <summary>
        /// Protection class, value [`low`, `middle`, `high`].
        /// </summary>
        [Output("ddosLevel")]
        public Output<string?> DdosLevel { get; private set; } = null!;

        /// <summary>
        /// Access speed limit configuration for DDoS protection.
        /// </summary>
        [Output("ddosSpeedLimitConfigs")]
        public Output<ImmutableArray<Outputs.DdosPolicyV2DdosSpeedLimitConfig>> DdosSpeedLimitConfigs { get; private set; } = null!;

        /// <summary>
        /// DDoS cleaning threshold, value[0, 60, 80, 100, 150, 200, 250, 300, 400, 500, 700, 1000]; When the value is set to 0, it means that the default value is adopted.
        /// </summary>
        [Output("ddosThreshold")]
        public Output<int?> DdosThreshold { get; private set; } = null!;

        /// <summary>
        /// Feature filtering rules for DDoS protection.
        /// </summary>
        [Output("packetFilters")]
        public Output<ImmutableArray<Outputs.DdosPolicyV2PacketFilter>> PacketFilters { get; private set; } = null!;

        /// <summary>
        /// Protocol block configuration for DDoS protection.
        /// </summary>
        [Output("protocolBlockConfigs")]
        public Output<ImmutableArray<Outputs.DdosPolicyV2ProtocolBlockConfig>> ProtocolBlockConfigs { get; private set; } = null!;

        /// <summary>
        /// The ID of the resource instance.
        /// </summary>
        [Output("resourceId")]
        public Output<string> ResourceId { get; private set; } = null!;


        /// <summary>
        /// Create a DdosPolicyV2 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 DdosPolicyV2(string name, DdosPolicyV2Args args, CustomResourceOptions? options = null)
            : base("tencentcloud:Dayu/ddosPolicyV2:DdosPolicyV2", name, args ?? new DdosPolicyV2Args(), MakeResourceOptions(options, ""))
        {
        }

        private DdosPolicyV2(string name, Input<string> id, DdosPolicyV2State? state = null, CustomResourceOptions? options = null)
            : base("tencentcloud:Dayu/ddosPolicyV2:DdosPolicyV2", 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 DdosPolicyV2 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 DdosPolicyV2 Get(string name, Input<string> id, DdosPolicyV2State? state = null, CustomResourceOptions? options = null)
        {
            return new DdosPolicyV2(name, id, state, options);
        }
    }

    public sealed class DdosPolicyV2Args : Pulumi.ResourceArgs
    {
        [Input("acls")]
        private InputList<Inputs.DdosPolicyV2AclArgs>? _acls;

        /// <summary>
        /// Port ACL policy for DDoS protection.
        /// </summary>
        public InputList<Inputs.DdosPolicyV2AclArgs> Acls
        {
            get => _acls ?? (_acls = new InputList<Inputs.DdosPolicyV2AclArgs>());
            set => _acls = value;
        }

        [Input("blackWhiteIps")]
        private InputList<Inputs.DdosPolicyV2BlackWhiteIpArgs>? _blackWhiteIps;

        /// <summary>
        /// DDoS-protected IP blacklist and whitelist.
        /// </summary>
        public InputList<Inputs.DdosPolicyV2BlackWhiteIpArgs> BlackWhiteIps
        {
            get => _blackWhiteIps ?? (_blackWhiteIps = new InputList<Inputs.DdosPolicyV2BlackWhiteIpArgs>());
            set => _blackWhiteIps = value;
        }

        /// <summary>
        /// Business of resource instance. bgpip indicates anti-anti-ip ip; bgp means exclusive package; bgp-multip means shared packet; net indicates anti-anti-ip pro version.
        /// </summary>
        [Input("business")]
        public Input<string>? Business { get; set; }

        /// <summary>
        /// AI protection switch, take the value [`on`, `off`].
        /// </summary>
        [Input("ddosAi")]
        public Input<string>? DdosAi { get; set; }

        /// <summary>
        /// DDoS connection suppression options.
        /// </summary>
        [Input("ddosConnectLimit")]
        public Input<Inputs.DdosPolicyV2DdosConnectLimitArgs>? DdosConnectLimit { get; set; }

        [Input("ddosGeoIpBlockConfigs")]
        private InputList<Inputs.DdosPolicyV2DdosGeoIpBlockConfigArgs>? _ddosGeoIpBlockConfigs;

        /// <summary>
        /// DDoS-protected area block configuration.
        /// </summary>
        public InputList<Inputs.DdosPolicyV2DdosGeoIpBlockConfigArgs> DdosGeoIpBlockConfigs
        {
            get => _ddosGeoIpBlockConfigs ?? (_ddosGeoIpBlockConfigs = new InputList<Inputs.DdosPolicyV2DdosGeoIpBlockConfigArgs>());
            set => _ddosGeoIpBlockConfigs = value;
        }

        /// <summary>
        /// Protection class, value [`low`, `middle`, `high`].
        /// </summary>
        [Input("ddosLevel")]
        public Input<string>? DdosLevel { get; set; }

        [Input("ddosSpeedLimitConfigs")]
        private InputList<Inputs.DdosPolicyV2DdosSpeedLimitConfigArgs>? _ddosSpeedLimitConfigs;

        /// <summary>
        /// Access speed limit configuration for DDoS protection.
        /// </summary>
        public InputList<Inputs.DdosPolicyV2DdosSpeedLimitConfigArgs> DdosSpeedLimitConfigs
        {
            get => _ddosSpeedLimitConfigs ?? (_ddosSpeedLimitConfigs = new InputList<Inputs.DdosPolicyV2DdosSpeedLimitConfigArgs>());
            set => _ddosSpeedLimitConfigs = value;
        }

        /// <summary>
        /// DDoS cleaning threshold, value[0, 60, 80, 100, 150, 200, 250, 300, 400, 500, 700, 1000]; When the value is set to 0, it means that the default value is adopted.
        /// </summary>
        [Input("ddosThreshold")]
        public Input<int>? DdosThreshold { get; set; }

        [Input("packetFilters")]
        private InputList<Inputs.DdosPolicyV2PacketFilterArgs>? _packetFilters;

        /// <summary>
        /// Feature filtering rules for DDoS protection.
        /// </summary>
        public InputList<Inputs.DdosPolicyV2PacketFilterArgs> PacketFilters
        {
            get => _packetFilters ?? (_packetFilters = new InputList<Inputs.DdosPolicyV2PacketFilterArgs>());
            set => _packetFilters = value;
        }

        [Input("protocolBlockConfigs")]
        private InputList<Inputs.DdosPolicyV2ProtocolBlockConfigArgs>? _protocolBlockConfigs;

        /// <summary>
        /// Protocol block configuration for DDoS protection.
        /// </summary>
        public InputList<Inputs.DdosPolicyV2ProtocolBlockConfigArgs> ProtocolBlockConfigs
        {
            get => _protocolBlockConfigs ?? (_protocolBlockConfigs = new InputList<Inputs.DdosPolicyV2ProtocolBlockConfigArgs>());
            set => _protocolBlockConfigs = value;
        }

        /// <summary>
        /// The ID of the resource instance.
        /// </summary>
        [Input("resourceId", required: true)]
        public Input<string> ResourceId { get; set; } = null!;

        public DdosPolicyV2Args()
        {
        }
    }

    public sealed class DdosPolicyV2State : Pulumi.ResourceArgs
    {
        [Input("acls")]
        private InputList<Inputs.DdosPolicyV2AclGetArgs>? _acls;

        /// <summary>
        /// Port ACL policy for DDoS protection.
        /// </summary>
        public InputList<Inputs.DdosPolicyV2AclGetArgs> Acls
        {
            get => _acls ?? (_acls = new InputList<Inputs.DdosPolicyV2AclGetArgs>());
            set => _acls = value;
        }

        [Input("blackWhiteIps")]
        private InputList<Inputs.DdosPolicyV2BlackWhiteIpGetArgs>? _blackWhiteIps;

        /// <summary>
        /// DDoS-protected IP blacklist and whitelist.
        /// </summary>
        public InputList<Inputs.DdosPolicyV2BlackWhiteIpGetArgs> BlackWhiteIps
        {
            get => _blackWhiteIps ?? (_blackWhiteIps = new InputList<Inputs.DdosPolicyV2BlackWhiteIpGetArgs>());
            set => _blackWhiteIps = value;
        }

        /// <summary>
        /// Business of resource instance. bgpip indicates anti-anti-ip ip; bgp means exclusive package; bgp-multip means shared packet; net indicates anti-anti-ip pro version.
        /// </summary>
        [Input("business")]
        public Input<string>? Business { get; set; }

        /// <summary>
        /// AI protection switch, take the value [`on`, `off`].
        /// </summary>
        [Input("ddosAi")]
        public Input<string>? DdosAi { get; set; }

        /// <summary>
        /// DDoS connection suppression options.
        /// </summary>
        [Input("ddosConnectLimit")]
        public Input<Inputs.DdosPolicyV2DdosConnectLimitGetArgs>? DdosConnectLimit { get; set; }

        [Input("ddosGeoIpBlockConfigs")]
        private InputList<Inputs.DdosPolicyV2DdosGeoIpBlockConfigGetArgs>? _ddosGeoIpBlockConfigs;

        /// <summary>
        /// DDoS-protected area block configuration.
        /// </summary>
        public InputList<Inputs.DdosPolicyV2DdosGeoIpBlockConfigGetArgs> DdosGeoIpBlockConfigs
        {
            get => _ddosGeoIpBlockConfigs ?? (_ddosGeoIpBlockConfigs = new InputList<Inputs.DdosPolicyV2DdosGeoIpBlockConfigGetArgs>());
            set => _ddosGeoIpBlockConfigs = value;
        }

        /// <summary>
        /// Protection class, value [`low`, `middle`, `high`].
        /// </summary>
        [Input("ddosLevel")]
        public Input<string>? DdosLevel { get; set; }

        [Input("ddosSpeedLimitConfigs")]
        private InputList<Inputs.DdosPolicyV2DdosSpeedLimitConfigGetArgs>? _ddosSpeedLimitConfigs;

        /// <summary>
        /// Access speed limit configuration for DDoS protection.
        /// </summary>
        public InputList<Inputs.DdosPolicyV2DdosSpeedLimitConfigGetArgs> DdosSpeedLimitConfigs
        {
            get => _ddosSpeedLimitConfigs ?? (_ddosSpeedLimitConfigs = new InputList<Inputs.DdosPolicyV2DdosSpeedLimitConfigGetArgs>());
            set => _ddosSpeedLimitConfigs = value;
        }

        /// <summary>
        /// DDoS cleaning threshold, value[0, 60, 80, 100, 150, 200, 250, 300, 400, 500, 700, 1000]; When the value is set to 0, it means that the default value is adopted.
        /// </summary>
        [Input("ddosThreshold")]
        public Input<int>? DdosThreshold { get; set; }

        [Input("packetFilters")]
        private InputList<Inputs.DdosPolicyV2PacketFilterGetArgs>? _packetFilters;

        /// <summary>
        /// Feature filtering rules for DDoS protection.
        /// </summary>
        public InputList<Inputs.DdosPolicyV2PacketFilterGetArgs> PacketFilters
        {
            get => _packetFilters ?? (_packetFilters = new InputList<Inputs.DdosPolicyV2PacketFilterGetArgs>());
            set => _packetFilters = value;
        }

        [Input("protocolBlockConfigs")]
        private InputList<Inputs.DdosPolicyV2ProtocolBlockConfigGetArgs>? _protocolBlockConfigs;

        /// <summary>
        /// Protocol block configuration for DDoS protection.
        /// </summary>
        public InputList<Inputs.DdosPolicyV2ProtocolBlockConfigGetArgs> ProtocolBlockConfigs
        {
            get => _protocolBlockConfigs ?? (_protocolBlockConfigs = new InputList<Inputs.DdosPolicyV2ProtocolBlockConfigGetArgs>());
            set => _protocolBlockConfigs = value;
        }

        /// <summary>
        /// The ID of the resource instance.
        /// </summary>
        [Input("resourceId")]
        public Input<string>? ResourceId { get; set; }

        public DdosPolicyV2State()
        {
        }
    }
}
