// *** 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.AliCloud.Waf
{
    /// <summary>
    /// Provides a Web Application Firewall(WAF) Protection Module resource.
    /// 
    /// For information about Web Application Firewall(WAF) Protection Module and how to use it, see [What is Protection Module](https://www.alibabacloud.com/help/en/doc-detail/160775.htm).
    /// 
    /// &gt; **NOTE:** Available in v1.141.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var defaultInstances = AliCloud.Waf.GetInstances.Invoke();
    /// 
    ///     var defaultDomain = new AliCloud.Waf.Domain("defaultDomain", new()
    ///     {
    ///         DomainName = "you domain",
    ///         InstanceId = defaultInstances.Apply(getInstancesResult =&gt; getInstancesResult.Ids[0]),
    ///         IsAccessProduct = "On",
    ///         SourceIps = new[]
    ///         {
    ///             "1.1.1.1",
    ///         },
    ///         ClusterType = "PhysicalCluster",
    ///         Http2Ports = new[]
    ///         {
    ///             "443",
    ///         },
    ///         HttpPorts = new[]
    ///         {
    ///             "80",
    ///         },
    ///         HttpsPorts = new[]
    ///         {
    ///             "443",
    ///         },
    ///         HttpToUserIp = "Off",
    ///         HttpsRedirect = "Off",
    ///         LoadBalancing = "IpHash",
    ///         LogHeaders = new[]
    ///         {
    ///             new AliCloud.Waf.Inputs.DomainLogHeaderArgs
    ///             {
    ///                 Key = "foo",
    ///                 Value = "http",
    ///             },
    ///         },
    ///     });
    /// 
    ///     var defaultProtectionModule = new AliCloud.Waf.ProtectionModule("defaultProtectionModule", new()
    ///     {
    ///         InstanceId = defaultInstances.Apply(getInstancesResult =&gt; getInstancesResult.Ids[0]),
    ///         Domain = defaultDomain.DomainName,
    ///         DefenseType = "ac_cc",
    ///         Mode = 0,
    ///         Status = 0,
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Web Application Firewall(WAF) Protection Module can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:waf/protectionModule:ProtectionModule example &lt;instance_id&gt;:&lt;domain&gt;:&lt;defense_type&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:waf/protectionModule:ProtectionModule")]
    public partial class ProtectionModule : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The Protection Module. Valid values: `ac_cc`, `antifraud`, `dld`, `normalized`, `waf`.
        /// * `waf`: RegEx Protection Engine.
        /// * `dld`: Big Data Deep Learning Engine.
        /// * `ac_cc`: HTTP Flood Protection.
        /// * `antifraud`: Data Risk Control.
        /// * `normalized`: Positive Security Model.
        /// </summary>
        [Output("defenseType")]
        public Output<string> DefenseType { get; private set; } = null!;

        /// <summary>
        /// The domain name that is added to WAF.
        /// </summary>
        [Output("domain")]
        public Output<string> Domain { get; private set; } = null!;

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

        /// <summary>
        /// The protection mode of the specified protection module. **NOTE:** The value of the Mode parameter varies based on the value of the `defense_type` parameter.
        /// * The `defense_type` is `waf`. `0`: block mode. `1`: warn mode.
        /// * The `defense_type` is `dld`. `0`: warn mode. `1`: block mode.
        /// * The `defense_type` is `ac_cc`. `0`: prevention mode. `1`: protection-emergency mode.
        /// * The `defense_type` is `antifraud`. `0`: warn mode. `1`: block mode. `2`: strict interception mode.
        /// * The `defense_type` is `normalized`. `0`: warn mode. `1`: block mode.
        /// </summary>
        [Output("mode")]
        public Output<int> Mode { get; private set; } = null!;

        /// <summary>
        /// The status of the resource. Valid values: `0`, `1`.
        /// * `0`: disables the protection module.
        /// * `1`: enables the protection module.
        /// </summary>
        [Output("status")]
        public Output<int?> Status { get; private set; } = null!;


        /// <summary>
        /// Create a ProtectionModule 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 ProtectionModule(string name, ProtectionModuleArgs args, CustomResourceOptions? options = null)
            : base("alicloud:waf/protectionModule:ProtectionModule", name, args ?? new ProtectionModuleArgs(), MakeResourceOptions(options, ""))
        {
        }

        private ProtectionModule(string name, Input<string> id, ProtectionModuleState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:waf/protectionModule:ProtectionModule", 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/rhysmdnz/pulumi-alicloud",
            };
            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 ProtectionModule 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 ProtectionModule Get(string name, Input<string> id, ProtectionModuleState? state = null, CustomResourceOptions? options = null)
        {
            return new ProtectionModule(name, id, state, options);
        }
    }

    public sealed class ProtectionModuleArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The Protection Module. Valid values: `ac_cc`, `antifraud`, `dld`, `normalized`, `waf`.
        /// * `waf`: RegEx Protection Engine.
        /// * `dld`: Big Data Deep Learning Engine.
        /// * `ac_cc`: HTTP Flood Protection.
        /// * `antifraud`: Data Risk Control.
        /// * `normalized`: Positive Security Model.
        /// </summary>
        [Input("defenseType", required: true)]
        public Input<string> DefenseType { get; set; } = null!;

        /// <summary>
        /// The domain name that is added to WAF.
        /// </summary>
        [Input("domain", required: true)]
        public Input<string> Domain { get; set; } = null!;

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

        /// <summary>
        /// The protection mode of the specified protection module. **NOTE:** The value of the Mode parameter varies based on the value of the `defense_type` parameter.
        /// * The `defense_type` is `waf`. `0`: block mode. `1`: warn mode.
        /// * The `defense_type` is `dld`. `0`: warn mode. `1`: block mode.
        /// * The `defense_type` is `ac_cc`. `0`: prevention mode. `1`: protection-emergency mode.
        /// * The `defense_type` is `antifraud`. `0`: warn mode. `1`: block mode. `2`: strict interception mode.
        /// * The `defense_type` is `normalized`. `0`: warn mode. `1`: block mode.
        /// </summary>
        [Input("mode", required: true)]
        public Input<int> Mode { get; set; } = null!;

        /// <summary>
        /// The status of the resource. Valid values: `0`, `1`.
        /// * `0`: disables the protection module.
        /// * `1`: enables the protection module.
        /// </summary>
        [Input("status")]
        public Input<int>? Status { get; set; }

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

    public sealed class ProtectionModuleState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The Protection Module. Valid values: `ac_cc`, `antifraud`, `dld`, `normalized`, `waf`.
        /// * `waf`: RegEx Protection Engine.
        /// * `dld`: Big Data Deep Learning Engine.
        /// * `ac_cc`: HTTP Flood Protection.
        /// * `antifraud`: Data Risk Control.
        /// * `normalized`: Positive Security Model.
        /// </summary>
        [Input("defenseType")]
        public Input<string>? DefenseType { get; set; }

        /// <summary>
        /// The domain name that is added to WAF.
        /// </summary>
        [Input("domain")]
        public Input<string>? Domain { get; set; }

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

        /// <summary>
        /// The protection mode of the specified protection module. **NOTE:** The value of the Mode parameter varies based on the value of the `defense_type` parameter.
        /// * The `defense_type` is `waf`. `0`: block mode. `1`: warn mode.
        /// * The `defense_type` is `dld`. `0`: warn mode. `1`: block mode.
        /// * The `defense_type` is `ac_cc`. `0`: prevention mode. `1`: protection-emergency mode.
        /// * The `defense_type` is `antifraud`. `0`: warn mode. `1`: block mode. `2`: strict interception mode.
        /// * The `defense_type` is `normalized`. `0`: warn mode. `1`: block mode.
        /// </summary>
        [Input("mode")]
        public Input<int>? Mode { get; set; }

        /// <summary>
        /// The status of the resource. Valid values: `0`, `1`.
        /// * `0`: disables the protection module.
        /// * `1`: enables the protection module.
        /// </summary>
        [Input("status")]
        public Input<int>? Status { get; set; }

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