<filename>sdk/dotnet/Slb/Listener.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.AliCloud.Slb
{
    /// <summary>
    /// Provides an Application Load Balancer Listener resource.
    /// 
    /// For information about slb and how to use it, see [What is Server Load Balancer](https://www.alibabacloud.com/help/doc-detail/27539.htm).
    /// 
    /// For information about listener and how to use it, to see the following:
    /// 
    /// * [Configure a HTTP Listener](https://www.alibabacloud.com/help/doc-detail/27592.htm).
    /// * [Configure a HTTPS Listener](https://www.alibabacloud.com/help/doc-detail/27593.htm).
    /// * [Configure a TCP Listener](https://www.alibabacloud.com/help/doc-detail/27594.htm).
    /// * [Configure a UDP Listener](https://www.alibabacloud.com/help/doc-detail/27595.htm).
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var config = new Config();
    ///     var slbListenerName = config.Get("slbListenerName") ?? "forSlbListener";
    ///     var listenerApplicationLoadBalancer = new AliCloud.Slb.ApplicationLoadBalancer("listenerApplicationLoadBalancer", new()
    ///     {
    ///         LoadBalancerName = "tf-testAccSlbListenerHttp",
    ///         InternetChargeType = "PayByTraffic",
    ///         AddressType = "internet",
    ///         InstanceChargeType = "PayByCLCU",
    ///     });
    /// 
    ///     var listenerAcl = new AliCloud.Slb.Acl("listenerAcl", new()
    ///     {
    ///         IpVersion = "ipv4",
    ///     });
    /// 
    ///     var listenerListener = new AliCloud.Slb.Listener("listenerListener", new()
    ///     {
    ///         LoadBalancerId = listenerApplicationLoadBalancer.Id,
    ///         BackendPort = 80,
    ///         FrontendPort = 80,
    ///         Protocol = "http",
    ///         Bandwidth = 10,
    ///         StickySession = "on",
    ///         StickySessionType = "insert",
    ///         CookieTimeout = 86400,
    ///         Cookie = "testslblistenercookie",
    ///         HealthCheck = "on",
    ///         HealthCheckDomain = "ali.com",
    ///         HealthCheckUri = "/cons",
    ///         HealthCheckConnectPort = 20,
    ///         HealthyThreshold = 8,
    ///         UnhealthyThreshold = 8,
    ///         HealthCheckTimeout = 8,
    ///         HealthCheckInterval = 5,
    ///         HealthCheckHttpCode = "http_2xx,http_3xx",
    ///         XForwardedFor = new AliCloud.Slb.Inputs.ListenerXForwardedForArgs
    ///         {
    ///             RetriveSlbIp = true,
    ///             RetriveSlbId = true,
    ///         },
    ///         AclStatus = "on",
    ///         AclType = "white",
    ///         AclId = listenerAcl.Id,
    ///         RequestTimeout = 80,
    ///         IdleTimeout = 30,
    ///     });
    /// 
    ///     var first = new AliCloud.Slb.AclEntryAttachment("first", new()
    ///     {
    ///         AclId = listenerAcl.Id,
    ///         Entry = "10.10.10.0/24",
    ///         Comment = "first",
    ///     });
    /// 
    ///     var second = new AliCloud.Slb.AclEntryAttachment("second", new()
    ///     {
    ///         AclId = listenerAcl.Id,
    ///         Entry = "168.10.10.0/24",
    ///         Comment = "second",
    ///     });
    /// 
    /// });
    /// ```
    /// ## Listener fields and protocol mapping
    /// 
    /// load balance support 4 protocol to listen on, they are `http`,`https`,`tcp`,`udp`, the every listener support which portocal following:
    /// 
    /// listener parameter | support protocol | value range |
    /// ------------- | ------------- | ------------- |
    /// backend_port | http &amp; https &amp; tcp &amp; udp | 1-65535 |
    /// frontend_port | http &amp; https &amp; tcp &amp; udp | 1-65535 |
    /// protocol | http &amp; https &amp; tcp &amp; udp |
    /// bandwidth | http &amp; https &amp; tcp &amp; udp | -1 / 1-1000 |
    /// scheduler | http &amp; https &amp; tcp &amp; udp | wrr, rr, wlc, tch, qch |
    /// sticky_session | http &amp; https | on or off |
    /// sticky_session_type | http &amp; https | insert or server |
    /// cookie_timeout | http &amp; https | 1-86400  |
    /// cookie | http &amp; https |   |
    /// persistence_timeout | tcp &amp; udp | 0-3600 |
    /// health_check | http &amp; https | on or off |
    /// health_check_type | tcp | tcp or http |
    /// health_check_domain | http &amp; https &amp; tcp |
    /// health_check_method | http &amp; https &amp; tcp |
    /// health_check_uri | http &amp; https &amp; tcp |  |
    /// health_check_connect_port | http &amp; https &amp; tcp &amp; udp | 1-65535 or -520 |
    /// healthy_threshold | http &amp; https &amp; tcp &amp; udp | 1-10 |
    /// unhealthy_threshold | http &amp; https &amp; tcp &amp; udp | 1-10 |
    /// health_check_timeout | http &amp; https &amp; tcp &amp; udp | 1-300 |
    /// health_check_interval | http &amp; https &amp; tcp &amp; udp | 1-50 |
    /// health_check_http_code | http &amp; https &amp; tcp | http_2xx,http_3xx,http_4xx,http_5xx |
    /// server_certificate_id | https |  |
    /// gzip | http &amp; https | true or false  |
    /// x_forwarded_for | http &amp; https |  |
    /// acl_status | http &amp; https &amp; tcp &amp; udp | on or off |
    /// acl_type   | http &amp; https &amp; tcp &amp; udp | white or black |
    /// acl_id     | http &amp; https &amp; tcp &amp; udp | the id of resource alicloud_slb_acl|
    /// established_timeout | tcp       | 10-900|
    /// idle_timeout |http &amp; https      | 1-60  |
    /// request_timeout |http &amp; https   | 1-180 |
    /// enable_http2    |https          | on or off |
    /// tls_cipher_policy |https        |  tls_cipher_policy_1_0, tls_cipher_policy_1_1, tls_cipher_policy_1_2, tls_cipher_policy_1_2_strict |
    /// server_group_id    | http &amp; https &amp; tcp &amp; udp | the id of resource alicloud.slb.ServerGroup |
    /// 
    /// The listener mapping supports the following:
    /// 
    /// ## Import
    /// 
    /// Load balancer listener can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:slb/listener:Listener example "lb-abc123456:tcp:22"
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:slb/listener:Listener")]
    public partial class Listener : global::Pulumi.CustomResource
    {
        /// <summary>
        /// the id of access control list to be apply on the listener, is the id of resource alicloud_slb_acl. If `acl_status` is "on", it is mandatory. Otherwise, it will be ignored.
        /// </summary>
        [Output("aclId")]
        public Output<string?> AclId { get; private set; } = null!;

        /// <summary>
        /// Whether to enable "acl(access control list)", the acl is specified by `acl_id`. Valid values are `on` and `off`. Default to `off`.
        /// </summary>
        [Output("aclStatus")]
        public Output<string?> AclStatus { get; private set; } = null!;

        /// <summary>
        /// Mode for handling the acl specified by acl_id. If `acl_status` is "on", it is mandatory. Otherwise, it will be ignored. Valid values are `white` and `black`. `white` means the Listener can only be accessed by client ip belongs to the acl; `black` means the Listener can not be accessed by client ip belongs to the acl.
        /// </summary>
        [Output("aclType")]
        public Output<string?> AclType { get; private set; } = null!;

        /// <summary>
        /// Port used by the Server Load Balancer instance backend. Valid value range: [1-65535].
        /// </summary>
        [Output("backendPort")]
        public Output<int?> BackendPort { get; private set; } = null!;

        /// <summary>
        /// Bandwidth peak of Listener. For the public network instance charged per traffic consumed, the Bandwidth on Listener can be set to -1, indicating the bandwidth peak is unlimited. Valid values are [-1, 1-1000] in Mbps.
        /// </summary>
        [Output("bandwidth")]
        public Output<int> Bandwidth { get; private set; } = null!;

        /// <summary>
        /// SLB CA certificate ID. Only when `protocol` is `https` can be specified.
        /// </summary>
        [Output("caCertificateId")]
        public Output<string?> CaCertificateId { get; private set; } = null!;

        /// <summary>
        /// The cookie configured on the server. It is mandatory when `sticky_session` is "on" and `sticky_session_type` is "server". Otherwise, it will be ignored. Valid value：String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.
        /// </summary>
        [Output("cookie")]
        public Output<string?> Cookie { get; private set; } = null!;

        /// <summary>
        /// Cookie timeout. It is mandatory when `sticky_session` is "on" and `sticky_session_type` is "insert". Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.
        /// </summary>
        [Output("cookieTimeout")]
        public Output<int?> CookieTimeout { get; private set; } = null!;

        /// <summary>
        /// Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
        /// </summary>
        [Output("deleteProtectionValidation")]
        public Output<bool?> DeleteProtectionValidation { get; private set; } = null!;

        /// <summary>
        /// The description of slb listener. This description can have a string of 1 to 80 characters. Default value: null.
        /// </summary>
        [Output("description")]
        public Output<string?> Description { get; private set; } = null!;

        /// <summary>
        /// Whether to enable https listener support http2 or not. Valid values are `on` and `off`. Default to `on`.
        /// </summary>
        [Output("enableHttp2")]
        public Output<string?> EnableHttp2 { get; private set; } = null!;

        /// <summary>
        /// Timeout of tcp listener established connection idle timeout. Valid value range: [10-900] in seconds. Default to 900.
        /// </summary>
        [Output("establishedTimeout")]
        public Output<int?> EstablishedTimeout { get; private set; } = null!;

        /// <summary>
        /// The port that http redirect to https.
        /// </summary>
        [Output("forwardPort")]
        public Output<int?> ForwardPort { get; private set; } = null!;

        /// <summary>
        /// Port used by the Server Load Balancer instance frontend. Valid value range: [1-65535].
        /// </summary>
        [Output("frontendPort")]
        public Output<int> FrontendPort { get; private set; } = null!;

        /// <summary>
        /// Whether to enable "Gzip Compression". If enabled, files of specific file types will be compressed, otherwise, no files will be compressed. Default to true. Available in v1.13.0+.
        /// </summary>
        [Output("gzip")]
        public Output<bool?> Gzip { get; private set; } = null!;

        /// <summary>
        /// Whether to enable health check. Valid values are`on` and `off`. TCP and UDP listener's HealthCheck is always on, so it will be ignore when launching TCP or UDP listener.
        /// </summary>
        [Output("healthCheck")]
        public Output<string?> HealthCheck { get; private set; } = null!;

        /// <summary>
        /// The port that is used for health checks. Valid value range: [0-65535]. Default to `0` means that the port on a backend server is used for health checks.
        /// </summary>
        [Output("healthCheckConnectPort")]
        public Output<int> HealthCheckConnectPort { get; private set; } = null!;

        /// <summary>
        /// Domain name used for health check. When it used to launch TCP listener, `health_check_type` must be "http". Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty,  Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.
        /// </summary>
        [Output("healthCheckDomain")]
        public Output<string?> HealthCheckDomain { get; private set; } = null!;

        /// <summary>
        /// Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when `health_check` is on. Default to `http_2xx`.  Valid values are: `http_2xx`,  `http_3xx`, `http_4xx` and `http_5xx`.
        /// </summary>
        [Output("healthCheckHttpCode")]
        public Output<string> HealthCheckHttpCode { get; private set; } = null!;

        /// <summary>
        /// Time interval of health checks. It is required when `health_check` is on. Valid value range: [1-50] in seconds. Default to 2.
        /// </summary>
        [Output("healthCheckInterval")]
        public Output<int?> HealthCheckInterval { get; private set; } = null!;

        /// <summary>
        /// HealthCheckMethod used for health check.Valid values: ["head", "get"] `http` and `https` support regions ap-northeast-1, ap-southeast-1, ap-southeast-2, ap-southeast-3, us-east-1, us-west-1, eu-central-1, ap-south-1, me-east-1, cn-huhehaote, cn-zhangjiakou, ap-southeast-5, cn-shenzhen, cn-hongkong, cn-qingdao, cn-chengdu, eu-west-1, cn-hangzhou", cn-beijing, cn-shanghai.This function does not support the TCP protocol .
        /// </summary>
        [Output("healthCheckMethod")]
        public Output<string> HealthCheckMethod { get; private set; } = null!;

        /// <summary>
        /// Maximum timeout of each health check response. It is required when `health_check` is on. Valid value range: [1-300] in seconds. Default to 5. Note: If `health_check_timeout` &lt; `health_check_interval`, its will be replaced by `health_check_interval`.
        /// </summary>
        [Output("healthCheckTimeout")]
        public Output<int?> HealthCheckTimeout { get; private set; } = null!;

        /// <summary>
        /// Type of health check. Valid values are: `tcp` and `http`. Default to `tcp` . TCP supports TCP and HTTP health check mode, you can select the particular mode depending on your application.
        /// </summary>
        [Output("healthCheckType")]
        public Output<string?> HealthCheckType { get; private set; } = null!;

        /// <summary>
        /// URI used for health check. When it used to launch TCP listener, `health_check_type` must be "http". Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&amp;’ are allowed.
        /// </summary>
        [Output("healthCheckUri")]
        public Output<string?> HealthCheckUri { get; private set; } = null!;

        /// <summary>
        /// The number of health checks that an unhealthy backend server must consecutively pass before it can be declared healthy. In this case, the health check state is changed from fail to success. It is required when `health_check` is on. Valid value range: [2-10] in seconds. Default to 3. **NOTE:** This parameter takes effect only if the `health_check` parameter is set to `on`.
        /// </summary>
        [Output("healthyThreshold")]
        public Output<int?> HealthyThreshold { get; private set; } = null!;

        /// <summary>
        /// Timeout of http or https listener established connection idle timeout. Valid value range: [1-60] in seconds. Default to 15.
        /// </summary>
        [Output("idleTimeout")]
        public Output<int?> IdleTimeout { get; private set; } = null!;

        [Output("instancePort")]
        public Output<int?> InstancePort { get; private set; } = null!;

        [Output("lbPort")]
        public Output<int?> LbPort { get; private set; } = null!;

        [Output("lbProtocol")]
        public Output<string?> LbProtocol { get; private set; } = null!;

        /// <summary>
        /// Whether to enable http redirect to https, Valid values are `on` and `off`. Default to `off`.
        /// </summary>
        [Output("listenerForward")]
        public Output<string> ListenerForward { get; private set; } = null!;

        /// <summary>
        /// The Load Balancer ID which is used to launch a new listener.
        /// </summary>
        [Output("loadBalancerId")]
        public Output<string> LoadBalancerId { get; private set; } = null!;

        /// <summary>
        /// The ID of the master slave server group.
        /// </summary>
        [Output("masterSlaveServerGroupId")]
        public Output<string?> MasterSlaveServerGroupId { get; private set; } = null!;

        /// <summary>
        /// Timeout of connection persistence. Valid value range: [0-3600] in seconds. Default to 0 and means closing it.
        /// </summary>
        [Output("persistenceTimeout")]
        public Output<int?> PersistenceTimeout { get; private set; } = null!;

        /// <summary>
        /// The protocol to listen on. Valid values are [`http`, `https`, `tcp`, `udp`].
        /// </summary>
        [Output("protocol")]
        public Output<string> Protocol { get; private set; } = null!;

        /// <summary>
        /// Whether to support carrying the client source address to the backend server through the Proxy Protocol. Valid values are `true` and `false`. Default to `false`.
        /// </summary>
        [Output("proxyProtocolV2Enabled")]
        public Output<bool> ProxyProtocolV2Enabled { get; private set; } = null!;

        /// <summary>
        /// Timeout of http or https listener request (which does not get response from backend) timeout. Valid value range: [1-180] in seconds. Default to 60.
        /// </summary>
        [Output("requestTimeout")]
        public Output<int?> RequestTimeout { get; private set; } = null!;

        /// <summary>
        /// Scheduling algorithm,  Valid values: `wrr`, `rr`, `wlc`, `sch`, `tcp`, `qch`. Default to `wrr`. 
        /// Only when `protocol` is `tcp` or `udp`, `scheduler` can be set to `sch`. Only when instance is guaranteed-performance instance and `protocol` is `tcp` or `udp`, `scheduler` can be set to `tch`. Only when instance is guaranteed-performance instance and `protocol` is `udp`, `scheduler` can be set to `qch`.
        /// </summary>
        [Output("scheduler")]
        public Output<string?> Scheduler { get; private set; } = null!;

        /// <summary>
        /// SLB Server certificate ID. It is required when `protocol` is `https`. The `server_certificate_id` is also required when the value of the `ssl_certificate_id`  is Empty.
        /// </summary>
        [Output("serverCertificateId")]
        public Output<string> ServerCertificateId { get; private set; } = null!;

        /// <summary>
        /// the id of server group to be apply on the listener, is the id of resource `alicloud.slb.ServerGroup`.
        /// </summary>
        [Output("serverGroupId")]
        public Output<string?> ServerGroupId { get; private set; } = null!;

        /// <summary>
        /// SLB Server certificate ID. It has been deprecated from 1.59.0 and using `server_certificate_id` instead.
        /// </summary>
        [Output("sslCertificateId")]
        public Output<string> SslCertificateId { get; private set; } = null!;

        /// <summary>
        /// Whether to enable session persistence, Valid values are `on` and `off`. Default to `off`.
        /// </summary>
        [Output("stickySession")]
        public Output<string?> StickySession { get; private set; } = null!;

        /// <summary>
        /// Mode for handling the cookie. If `sticky_session` is "on", it is mandatory. Otherwise, it will be ignored. Valid values are `insert` and `server`. `insert` means it is inserted from Server Load Balancer; `server` means the Server Load Balancer learns from the backend server.
        /// </summary>
        [Output("stickySessionType")]
        public Output<string?> StickySessionType { get; private set; } = null!;

        /// <summary>
        /// Https listener TLS cipher policy. Valid values are `tls_cipher_policy_1_0`, `tls_cipher_policy_1_1`, `tls_cipher_policy_1_2`, `tls_cipher_policy_1_2_strict`. Default to `tls_cipher_policy_1_0`. Currently the `tls_cipher_policy` can not be updated when load balancer instance is "Shared-Performance".
        /// </summary>
        [Output("tlsCipherPolicy")]
        public Output<string?> TlsCipherPolicy { get; private set; } = null!;

        /// <summary>
        /// The number of health checks that a healthy backend server must consecutively fail before it can be declared unhealthy. In this case, the health check state is changed from success to fail. It is required when `health_check` is on. Valid value range: [2-10] in seconds. Default to 3. **NOTE:** This parameter takes effect only if the `health_check` parameter is set to `on`.
        /// </summary>
        [Output("unhealthyThreshold")]
        public Output<int?> UnhealthyThreshold { get; private set; } = null!;

        /// <summary>
        /// Whether to set additional HTTP Header field "X-Forwarded-For" (documented below). Available in v1.13.0+. The details see Block `x_forwarded_for`.
        /// </summary>
        [Output("xForwardedFor")]
        public Output<Outputs.ListenerXForwardedFor> XForwardedFor { get; private set; } = null!;


        /// <summary>
        /// Create a Listener 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 Listener(string name, ListenerArgs args, CustomResourceOptions? options = null)
            : base("alicloud:slb/listener:Listener", name, args ?? new ListenerArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Listener(string name, Input<string> id, ListenerState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:slb/listener:Listener", 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 Listener 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 Listener Get(string name, Input<string> id, ListenerState? state = null, CustomResourceOptions? options = null)
        {
            return new Listener(name, id, state, options);
        }
    }

    public sealed class ListenerArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// the id of access control list to be apply on the listener, is the id of resource alicloud_slb_acl. If `acl_status` is "on", it is mandatory. Otherwise, it will be ignored.
        /// </summary>
        [Input("aclId")]
        public Input<string>? AclId { get; set; }

        /// <summary>
        /// Whether to enable "acl(access control list)", the acl is specified by `acl_id`. Valid values are `on` and `off`. Default to `off`.
        /// </summary>
        [Input("aclStatus")]
        public Input<string>? AclStatus { get; set; }

        /// <summary>
        /// Mode for handling the acl specified by acl_id. If `acl_status` is "on", it is mandatory. Otherwise, it will be ignored. Valid values are `white` and `black`. `white` means the Listener can only be accessed by client ip belongs to the acl; `black` means the Listener can not be accessed by client ip belongs to the acl.
        /// </summary>
        [Input("aclType")]
        public Input<string>? AclType { get; set; }

        /// <summary>
        /// Port used by the Server Load Balancer instance backend. Valid value range: [1-65535].
        /// </summary>
        [Input("backendPort")]
        public Input<int>? BackendPort { get; set; }

        /// <summary>
        /// Bandwidth peak of Listener. For the public network instance charged per traffic consumed, the Bandwidth on Listener can be set to -1, indicating the bandwidth peak is unlimited. Valid values are [-1, 1-1000] in Mbps.
        /// </summary>
        [Input("bandwidth")]
        public Input<int>? Bandwidth { get; set; }

        /// <summary>
        /// SLB CA certificate ID. Only when `protocol` is `https` can be specified.
        /// </summary>
        [Input("caCertificateId")]
        public Input<string>? CaCertificateId { get; set; }

        /// <summary>
        /// The cookie configured on the server. It is mandatory when `sticky_session` is "on" and `sticky_session_type` is "server". Otherwise, it will be ignored. Valid value：String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.
        /// </summary>
        [Input("cookie")]
        public Input<string>? Cookie { get; set; }

        /// <summary>
        /// Cookie timeout. It is mandatory when `sticky_session` is "on" and `sticky_session_type` is "insert". Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.
        /// </summary>
        [Input("cookieTimeout")]
        public Input<int>? CookieTimeout { get; set; }

        /// <summary>
        /// Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
        /// </summary>
        [Input("deleteProtectionValidation")]
        public Input<bool>? DeleteProtectionValidation { get; set; }

        /// <summary>
        /// The description of slb listener. This description can have a string of 1 to 80 characters. Default value: null.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// Whether to enable https listener support http2 or not. Valid values are `on` and `off`. Default to `on`.
        /// </summary>
        [Input("enableHttp2")]
        public Input<string>? EnableHttp2 { get; set; }

        /// <summary>
        /// Timeout of tcp listener established connection idle timeout. Valid value range: [10-900] in seconds. Default to 900.
        /// </summary>
        [Input("establishedTimeout")]
        public Input<int>? EstablishedTimeout { get; set; }

        /// <summary>
        /// The port that http redirect to https.
        /// </summary>
        [Input("forwardPort")]
        public Input<int>? ForwardPort { get; set; }

        /// <summary>
        /// Port used by the Server Load Balancer instance frontend. Valid value range: [1-65535].
        /// </summary>
        [Input("frontendPort", required: true)]
        public Input<int> FrontendPort { get; set; } = null!;

        /// <summary>
        /// Whether to enable "Gzip Compression". If enabled, files of specific file types will be compressed, otherwise, no files will be compressed. Default to true. Available in v1.13.0+.
        /// </summary>
        [Input("gzip")]
        public Input<bool>? Gzip { get; set; }

        /// <summary>
        /// Whether to enable health check. Valid values are`on` and `off`. TCP and UDP listener's HealthCheck is always on, so it will be ignore when launching TCP or UDP listener.
        /// </summary>
        [Input("healthCheck")]
        public Input<string>? HealthCheck { get; set; }

        /// <summary>
        /// The port that is used for health checks. Valid value range: [0-65535]. Default to `0` means that the port on a backend server is used for health checks.
        /// </summary>
        [Input("healthCheckConnectPort")]
        public Input<int>? HealthCheckConnectPort { get; set; }

        /// <summary>
        /// Domain name used for health check. When it used to launch TCP listener, `health_check_type` must be "http". Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty,  Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.
        /// </summary>
        [Input("healthCheckDomain")]
        public Input<string>? HealthCheckDomain { get; set; }

        /// <summary>
        /// Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when `health_check` is on. Default to `http_2xx`.  Valid values are: `http_2xx`,  `http_3xx`, `http_4xx` and `http_5xx`.
        /// </summary>
        [Input("healthCheckHttpCode")]
        public Input<string>? HealthCheckHttpCode { get; set; }

        /// <summary>
        /// Time interval of health checks. It is required when `health_check` is on. Valid value range: [1-50] in seconds. Default to 2.
        /// </summary>
        [Input("healthCheckInterval")]
        public Input<int>? HealthCheckInterval { get; set; }

        /// <summary>
        /// HealthCheckMethod used for health check.Valid values: ["head", "get"] `http` and `https` support regions ap-northeast-1, ap-southeast-1, ap-southeast-2, ap-southeast-3, us-east-1, us-west-1, eu-central-1, ap-south-1, me-east-1, cn-huhehaote, cn-zhangjiakou, ap-southeast-5, cn-shenzhen, cn-hongkong, cn-qingdao, cn-chengdu, eu-west-1, cn-hangzhou", cn-beijing, cn-shanghai.This function does not support the TCP protocol .
        /// </summary>
        [Input("healthCheckMethod")]
        public Input<string>? HealthCheckMethod { get; set; }

        /// <summary>
        /// Maximum timeout of each health check response. It is required when `health_check` is on. Valid value range: [1-300] in seconds. Default to 5. Note: If `health_check_timeout` &lt; `health_check_interval`, its will be replaced by `health_check_interval`.
        /// </summary>
        [Input("healthCheckTimeout")]
        public Input<int>? HealthCheckTimeout { get; set; }

        /// <summary>
        /// Type of health check. Valid values are: `tcp` and `http`. Default to `tcp` . TCP supports TCP and HTTP health check mode, you can select the particular mode depending on your application.
        /// </summary>
        [Input("healthCheckType")]
        public Input<string>? HealthCheckType { get; set; }

        /// <summary>
        /// URI used for health check. When it used to launch TCP listener, `health_check_type` must be "http". Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&amp;’ are allowed.
        /// </summary>
        [Input("healthCheckUri")]
        public Input<string>? HealthCheckUri { get; set; }

        /// <summary>
        /// The number of health checks that an unhealthy backend server must consecutively pass before it can be declared healthy. In this case, the health check state is changed from fail to success. It is required when `health_check` is on. Valid value range: [2-10] in seconds. Default to 3. **NOTE:** This parameter takes effect only if the `health_check` parameter is set to `on`.
        /// </summary>
        [Input("healthyThreshold")]
        public Input<int>? HealthyThreshold { get; set; }

        /// <summary>
        /// Timeout of http or https listener established connection idle timeout. Valid value range: [1-60] in seconds. Default to 15.
        /// </summary>
        [Input("idleTimeout")]
        public Input<int>? IdleTimeout { get; set; }

        [Input("instancePort")]
        public Input<int>? InstancePort { get; set; }

        [Input("lbPort")]
        public Input<int>? LbPort { get; set; }

        [Input("lbProtocol")]
        public Input<string>? LbProtocol { get; set; }

        /// <summary>
        /// Whether to enable http redirect to https, Valid values are `on` and `off`. Default to `off`.
        /// </summary>
        [Input("listenerForward")]
        public Input<string>? ListenerForward { get; set; }

        /// <summary>
        /// The Load Balancer ID which is used to launch a new listener.
        /// </summary>
        [Input("loadBalancerId", required: true)]
        public Input<string> LoadBalancerId { get; set; } = null!;

        /// <summary>
        /// The ID of the master slave server group.
        /// </summary>
        [Input("masterSlaveServerGroupId")]
        public Input<string>? MasterSlaveServerGroupId { get; set; }

        /// <summary>
        /// Timeout of connection persistence. Valid value range: [0-3600] in seconds. Default to 0 and means closing it.
        /// </summary>
        [Input("persistenceTimeout")]
        public Input<int>? PersistenceTimeout { get; set; }

        /// <summary>
        /// The protocol to listen on. Valid values are [`http`, `https`, `tcp`, `udp`].
        /// </summary>
        [Input("protocol", required: true)]
        public Input<string> Protocol { get; set; } = null!;

        /// <summary>
        /// Whether to support carrying the client source address to the backend server through the Proxy Protocol. Valid values are `true` and `false`. Default to `false`.
        /// </summary>
        [Input("proxyProtocolV2Enabled")]
        public Input<bool>? ProxyProtocolV2Enabled { get; set; }

        /// <summary>
        /// Timeout of http or https listener request (which does not get response from backend) timeout. Valid value range: [1-180] in seconds. Default to 60.
        /// </summary>
        [Input("requestTimeout")]
        public Input<int>? RequestTimeout { get; set; }

        /// <summary>
        /// Scheduling algorithm,  Valid values: `wrr`, `rr`, `wlc`, `sch`, `tcp`, `qch`. Default to `wrr`. 
        /// Only when `protocol` is `tcp` or `udp`, `scheduler` can be set to `sch`. Only when instance is guaranteed-performance instance and `protocol` is `tcp` or `udp`, `scheduler` can be set to `tch`. Only when instance is guaranteed-performance instance and `protocol` is `udp`, `scheduler` can be set to `qch`.
        /// </summary>
        [Input("scheduler")]
        public Input<string>? Scheduler { get; set; }

        /// <summary>
        /// SLB Server certificate ID. It is required when `protocol` is `https`. The `server_certificate_id` is also required when the value of the `ssl_certificate_id`  is Empty.
        /// </summary>
        [Input("serverCertificateId")]
        public Input<string>? ServerCertificateId { get; set; }

        /// <summary>
        /// the id of server group to be apply on the listener, is the id of resource `alicloud.slb.ServerGroup`.
        /// </summary>
        [Input("serverGroupId")]
        public Input<string>? ServerGroupId { get; set; }

        /// <summary>
        /// SLB Server certificate ID. It has been deprecated from 1.59.0 and using `server_certificate_id` instead.
        /// </summary>
        [Input("sslCertificateId")]
        public Input<string>? SslCertificateId { get; set; }

        /// <summary>
        /// Whether to enable session persistence, Valid values are `on` and `off`. Default to `off`.
        /// </summary>
        [Input("stickySession")]
        public Input<string>? StickySession { get; set; }

        /// <summary>
        /// Mode for handling the cookie. If `sticky_session` is "on", it is mandatory. Otherwise, it will be ignored. Valid values are `insert` and `server`. `insert` means it is inserted from Server Load Balancer; `server` means the Server Load Balancer learns from the backend server.
        /// </summary>
        [Input("stickySessionType")]
        public Input<string>? StickySessionType { get; set; }

        /// <summary>
        /// Https listener TLS cipher policy. Valid values are `tls_cipher_policy_1_0`, `tls_cipher_policy_1_1`, `tls_cipher_policy_1_2`, `tls_cipher_policy_1_2_strict`. Default to `tls_cipher_policy_1_0`. Currently the `tls_cipher_policy` can not be updated when load balancer instance is "Shared-Performance".
        /// </summary>
        [Input("tlsCipherPolicy")]
        public Input<string>? TlsCipherPolicy { get; set; }

        /// <summary>
        /// The number of health checks that a healthy backend server must consecutively fail before it can be declared unhealthy. In this case, the health check state is changed from success to fail. It is required when `health_check` is on. Valid value range: [2-10] in seconds. Default to 3. **NOTE:** This parameter takes effect only if the `health_check` parameter is set to `on`.
        /// </summary>
        [Input("unhealthyThreshold")]
        public Input<int>? UnhealthyThreshold { get; set; }

        /// <summary>
        /// Whether to set additional HTTP Header field "X-Forwarded-For" (documented below). Available in v1.13.0+. The details see Block `x_forwarded_for`.
        /// </summary>
        [Input("xForwardedFor")]
        public Input<Inputs.ListenerXForwardedForArgs>? XForwardedFor { get; set; }

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

    public sealed class ListenerState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// the id of access control list to be apply on the listener, is the id of resource alicloud_slb_acl. If `acl_status` is "on", it is mandatory. Otherwise, it will be ignored.
        /// </summary>
        [Input("aclId")]
        public Input<string>? AclId { get; set; }

        /// <summary>
        /// Whether to enable "acl(access control list)", the acl is specified by `acl_id`. Valid values are `on` and `off`. Default to `off`.
        /// </summary>
        [Input("aclStatus")]
        public Input<string>? AclStatus { get; set; }

        /// <summary>
        /// Mode for handling the acl specified by acl_id. If `acl_status` is "on", it is mandatory. Otherwise, it will be ignored. Valid values are `white` and `black`. `white` means the Listener can only be accessed by client ip belongs to the acl; `black` means the Listener can not be accessed by client ip belongs to the acl.
        /// </summary>
        [Input("aclType")]
        public Input<string>? AclType { get; set; }

        /// <summary>
        /// Port used by the Server Load Balancer instance backend. Valid value range: [1-65535].
        /// </summary>
        [Input("backendPort")]
        public Input<int>? BackendPort { get; set; }

        /// <summary>
        /// Bandwidth peak of Listener. For the public network instance charged per traffic consumed, the Bandwidth on Listener can be set to -1, indicating the bandwidth peak is unlimited. Valid values are [-1, 1-1000] in Mbps.
        /// </summary>
        [Input("bandwidth")]
        public Input<int>? Bandwidth { get; set; }

        /// <summary>
        /// SLB CA certificate ID. Only when `protocol` is `https` can be specified.
        /// </summary>
        [Input("caCertificateId")]
        public Input<string>? CaCertificateId { get; set; }

        /// <summary>
        /// The cookie configured on the server. It is mandatory when `sticky_session` is "on" and `sticky_session_type` is "server". Otherwise, it will be ignored. Valid value：String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.
        /// </summary>
        [Input("cookie")]
        public Input<string>? Cookie { get; set; }

        /// <summary>
        /// Cookie timeout. It is mandatory when `sticky_session` is "on" and `sticky_session_type` is "insert". Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.
        /// </summary>
        [Input("cookieTimeout")]
        public Input<int>? CookieTimeout { get; set; }

        /// <summary>
        /// Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
        /// </summary>
        [Input("deleteProtectionValidation")]
        public Input<bool>? DeleteProtectionValidation { get; set; }

        /// <summary>
        /// The description of slb listener. This description can have a string of 1 to 80 characters. Default value: null.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// Whether to enable https listener support http2 or not. Valid values are `on` and `off`. Default to `on`.
        /// </summary>
        [Input("enableHttp2")]
        public Input<string>? EnableHttp2 { get; set; }

        /// <summary>
        /// Timeout of tcp listener established connection idle timeout. Valid value range: [10-900] in seconds. Default to 900.
        /// </summary>
        [Input("establishedTimeout")]
        public Input<int>? EstablishedTimeout { get; set; }

        /// <summary>
        /// The port that http redirect to https.
        /// </summary>
        [Input("forwardPort")]
        public Input<int>? ForwardPort { get; set; }

        /// <summary>
        /// Port used by the Server Load Balancer instance frontend. Valid value range: [1-65535].
        /// </summary>
        [Input("frontendPort")]
        public Input<int>? FrontendPort { get; set; }

        /// <summary>
        /// Whether to enable "Gzip Compression". If enabled, files of specific file types will be compressed, otherwise, no files will be compressed. Default to true. Available in v1.13.0+.
        /// </summary>
        [Input("gzip")]
        public Input<bool>? Gzip { get; set; }

        /// <summary>
        /// Whether to enable health check. Valid values are`on` and `off`. TCP and UDP listener's HealthCheck is always on, so it will be ignore when launching TCP or UDP listener.
        /// </summary>
        [Input("healthCheck")]
        public Input<string>? HealthCheck { get; set; }

        /// <summary>
        /// The port that is used for health checks. Valid value range: [0-65535]. Default to `0` means that the port on a backend server is used for health checks.
        /// </summary>
        [Input("healthCheckConnectPort")]
        public Input<int>? HealthCheckConnectPort { get; set; }

        /// <summary>
        /// Domain name used for health check. When it used to launch TCP listener, `health_check_type` must be "http". Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty,  Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.
        /// </summary>
        [Input("healthCheckDomain")]
        public Input<string>? HealthCheckDomain { get; set; }

        /// <summary>
        /// Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when `health_check` is on. Default to `http_2xx`.  Valid values are: `http_2xx`,  `http_3xx`, `http_4xx` and `http_5xx`.
        /// </summary>
        [Input("healthCheckHttpCode")]
        public Input<string>? HealthCheckHttpCode { get; set; }

        /// <summary>
        /// Time interval of health checks. It is required when `health_check` is on. Valid value range: [1-50] in seconds. Default to 2.
        /// </summary>
        [Input("healthCheckInterval")]
        public Input<int>? HealthCheckInterval { get; set; }

        /// <summary>
        /// HealthCheckMethod used for health check.Valid values: ["head", "get"] `http` and `https` support regions ap-northeast-1, ap-southeast-1, ap-southeast-2, ap-southeast-3, us-east-1, us-west-1, eu-central-1, ap-south-1, me-east-1, cn-huhehaote, cn-zhangjiakou, ap-southeast-5, cn-shenzhen, cn-hongkong, cn-qingdao, cn-chengdu, eu-west-1, cn-hangzhou", cn-beijing, cn-shanghai.This function does not support the TCP protocol .
        /// </summary>
        [Input("healthCheckMethod")]
        public Input<string>? HealthCheckMethod { get; set; }

        /// <summary>
        /// Maximum timeout of each health check response. It is required when `health_check` is on. Valid value range: [1-300] in seconds. Default to 5. Note: If `health_check_timeout` &lt; `health_check_interval`, its will be replaced by `health_check_interval`.
        /// </summary>
        [Input("healthCheckTimeout")]
        public Input<int>? HealthCheckTimeout { get; set; }

        /// <summary>
        /// Type of health check. Valid values are: `tcp` and `http`. Default to `tcp` . TCP supports TCP and HTTP health check mode, you can select the particular mode depending on your application.
        /// </summary>
        [Input("healthCheckType")]
        public Input<string>? HealthCheckType { get; set; }

        /// <summary>
        /// URI used for health check. When it used to launch TCP listener, `health_check_type` must be "http". Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&amp;’ are allowed.
        /// </summary>
        [Input("healthCheckUri")]
        public Input<string>? HealthCheckUri { get; set; }

        /// <summary>
        /// The number of health checks that an unhealthy backend server must consecutively pass before it can be declared healthy. In this case, the health check state is changed from fail to success. It is required when `health_check` is on. Valid value range: [2-10] in seconds. Default to 3. **NOTE:** This parameter takes effect only if the `health_check` parameter is set to `on`.
        /// </summary>
        [Input("healthyThreshold")]
        public Input<int>? HealthyThreshold { get; set; }

        /// <summary>
        /// Timeout of http or https listener established connection idle timeout. Valid value range: [1-60] in seconds. Default to 15.
        /// </summary>
        [Input("idleTimeout")]
        public Input<int>? IdleTimeout { get; set; }

        [Input("instancePort")]
        public Input<int>? InstancePort { get; set; }

        [Input("lbPort")]
        public Input<int>? LbPort { get; set; }

        [Input("lbProtocol")]
        public Input<string>? LbProtocol { get; set; }

        /// <summary>
        /// Whether to enable http redirect to https, Valid values are `on` and `off`. Default to `off`.
        /// </summary>
        [Input("listenerForward")]
        public Input<string>? ListenerForward { get; set; }

        /// <summary>
        /// The Load Balancer ID which is used to launch a new listener.
        /// </summary>
        [Input("loadBalancerId")]
        public Input<string>? LoadBalancerId { get; set; }

        /// <summary>
        /// The ID of the master slave server group.
        /// </summary>
        [Input("masterSlaveServerGroupId")]
        public Input<string>? MasterSlaveServerGroupId { get; set; }

        /// <summary>
        /// Timeout of connection persistence. Valid value range: [0-3600] in seconds. Default to 0 and means closing it.
        /// </summary>
        [Input("persistenceTimeout")]
        public Input<int>? PersistenceTimeout { get; set; }

        /// <summary>
        /// The protocol to listen on. Valid values are [`http`, `https`, `tcp`, `udp`].
        /// </summary>
        [Input("protocol")]
        public Input<string>? Protocol { get; set; }

        /// <summary>
        /// Whether to support carrying the client source address to the backend server through the Proxy Protocol. Valid values are `true` and `false`. Default to `false`.
        /// </summary>
        [Input("proxyProtocolV2Enabled")]
        public Input<bool>? ProxyProtocolV2Enabled { get; set; }

        /// <summary>
        /// Timeout of http or https listener request (which does not get response from backend) timeout. Valid value range: [1-180] in seconds. Default to 60.
        /// </summary>
        [Input("requestTimeout")]
        public Input<int>? RequestTimeout { get; set; }

        /// <summary>
        /// Scheduling algorithm,  Valid values: `wrr`, `rr`, `wlc`, `sch`, `tcp`, `qch`. Default to `wrr`. 
        /// Only when `protocol` is `tcp` or `udp`, `scheduler` can be set to `sch`. Only when instance is guaranteed-performance instance and `protocol` is `tcp` or `udp`, `scheduler` can be set to `tch`. Only when instance is guaranteed-performance instance and `protocol` is `udp`, `scheduler` can be set to `qch`.
        /// </summary>
        [Input("scheduler")]
        public Input<string>? Scheduler { get; set; }

        /// <summary>
        /// SLB Server certificate ID. It is required when `protocol` is `https`. The `server_certificate_id` is also required when the value of the `ssl_certificate_id`  is Empty.
        /// </summary>
        [Input("serverCertificateId")]
        public Input<string>? ServerCertificateId { get; set; }

        /// <summary>
        /// the id of server group to be apply on the listener, is the id of resource `alicloud.slb.ServerGroup`.
        /// </summary>
        [Input("serverGroupId")]
        public Input<string>? ServerGroupId { get; set; }

        /// <summary>
        /// SLB Server certificate ID. It has been deprecated from 1.59.0 and using `server_certificate_id` instead.
        /// </summary>
        [Input("sslCertificateId")]
        public Input<string>? SslCertificateId { get; set; }

        /// <summary>
        /// Whether to enable session persistence, Valid values are `on` and `off`. Default to `off`.
        /// </summary>
        [Input("stickySession")]
        public Input<string>? StickySession { get; set; }

        /// <summary>
        /// Mode for handling the cookie. If `sticky_session` is "on", it is mandatory. Otherwise, it will be ignored. Valid values are `insert` and `server`. `insert` means it is inserted from Server Load Balancer; `server` means the Server Load Balancer learns from the backend server.
        /// </summary>
        [Input("stickySessionType")]
        public Input<string>? StickySessionType { get; set; }

        /// <summary>
        /// Https listener TLS cipher policy. Valid values are `tls_cipher_policy_1_0`, `tls_cipher_policy_1_1`, `tls_cipher_policy_1_2`, `tls_cipher_policy_1_2_strict`. Default to `tls_cipher_policy_1_0`. Currently the `tls_cipher_policy` can not be updated when load balancer instance is "Shared-Performance".
        /// </summary>
        [Input("tlsCipherPolicy")]
        public Input<string>? TlsCipherPolicy { get; set; }

        /// <summary>
        /// The number of health checks that a healthy backend server must consecutively fail before it can be declared unhealthy. In this case, the health check state is changed from success to fail. It is required when `health_check` is on. Valid value range: [2-10] in seconds. Default to 3. **NOTE:** This parameter takes effect only if the `health_check` parameter is set to `on`.
        /// </summary>
        [Input("unhealthyThreshold")]
        public Input<int>? UnhealthyThreshold { get; set; }

        /// <summary>
        /// Whether to set additional HTTP Header field "X-Forwarded-For" (documented below). Available in v1.13.0+. The details see Block `x_forwarded_for`.
        /// </summary>
        [Input("xForwardedFor")]
        public Input<Inputs.ListenerXForwardedForGetArgs>? XForwardedFor { get; set; }

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