# coding=utf-8
# *** 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! ***

import builtins
import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities
from . import outputs

__all__ = [
    'GetNlbListenerResult',
    'AwaitableGetNlbListenerResult',
    'get_nlb_listener',
    'get_nlb_listener_output',
]

@pulumi.output_type
class GetNlbListenerResult:
    """
    A collection of values returned by getNlbListener.
    """
    def __init__(__self__, certificate_id=None, connection_timeout=None, created_time=None, description=None, enabled=None, end_port=None, healths=None, id=None, listener_id=None, listener_name=None, load_balancer_id=None, port=None, protocol=None, security_policy_id=None, server_group_id=None, start_port=None, status=None, tags=None, updated_time=None):
        if certificate_id and not isinstance(certificate_id, str):
            raise TypeError("Expected argument 'certificate_id' to be a str")
        pulumi.set(__self__, "certificate_id", certificate_id)
        if connection_timeout and not isinstance(connection_timeout, int):
            raise TypeError("Expected argument 'connection_timeout' to be a int")
        pulumi.set(__self__, "connection_timeout", connection_timeout)
        if created_time and not isinstance(created_time, str):
            raise TypeError("Expected argument 'created_time' to be a str")
        pulumi.set(__self__, "created_time", created_time)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if enabled and not isinstance(enabled, bool):
            raise TypeError("Expected argument 'enabled' to be a bool")
        pulumi.set(__self__, "enabled", enabled)
        if end_port and not isinstance(end_port, int):
            raise TypeError("Expected argument 'end_port' to be a int")
        pulumi.set(__self__, "end_port", end_port)
        if healths and not isinstance(healths, list):
            raise TypeError("Expected argument 'healths' to be a list")
        pulumi.set(__self__, "healths", healths)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if listener_id and not isinstance(listener_id, str):
            raise TypeError("Expected argument 'listener_id' to be a str")
        pulumi.set(__self__, "listener_id", listener_id)
        if listener_name and not isinstance(listener_name, str):
            raise TypeError("Expected argument 'listener_name' to be a str")
        pulumi.set(__self__, "listener_name", listener_name)
        if load_balancer_id and not isinstance(load_balancer_id, str):
            raise TypeError("Expected argument 'load_balancer_id' to be a str")
        pulumi.set(__self__, "load_balancer_id", load_balancer_id)
        if port and not isinstance(port, int):
            raise TypeError("Expected argument 'port' to be a int")
        pulumi.set(__self__, "port", port)
        if protocol and not isinstance(protocol, str):
            raise TypeError("Expected argument 'protocol' to be a str")
        pulumi.set(__self__, "protocol", protocol)
        if security_policy_id and not isinstance(security_policy_id, str):
            raise TypeError("Expected argument 'security_policy_id' to be a str")
        pulumi.set(__self__, "security_policy_id", security_policy_id)
        if server_group_id and not isinstance(server_group_id, str):
            raise TypeError("Expected argument 'server_group_id' to be a str")
        pulumi.set(__self__, "server_group_id", server_group_id)
        if start_port and not isinstance(start_port, int):
            raise TypeError("Expected argument 'start_port' to be a int")
        pulumi.set(__self__, "start_port", start_port)
        if status and not isinstance(status, str):
            raise TypeError("Expected argument 'status' to be a str")
        pulumi.set(__self__, "status", status)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        if updated_time and not isinstance(updated_time, str):
            raise TypeError("Expected argument 'updated_time' to be a str")
        pulumi.set(__self__, "updated_time", updated_time)

    @property
    @pulumi.getter(name="certificateId")
    def certificate_id(self) -> builtins.str:
        """
        TLS监听器服务器证书的ID，仅支持传入证书中心 SSL 证书。。
        """
        return pulumi.get(self, "certificate_id")

    @property
    @pulumi.getter(name="connectionTimeout")
    def connection_timeout(self) -> builtins.int:
        """
        监听器的连接超时时间（秒）。
        """
        return pulumi.get(self, "connection_timeout")

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> builtins.str:
        """
        监听器的创建时间。
        """
        return pulumi.get(self, "created_time")

    @property
    @pulumi.getter
    def description(self) -> builtins.str:
        """
        监听器描述信息。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter
    def enabled(self) -> builtins.bool:
        """
        是否启用监听器。true：开启；false：关闭。
        """
        return pulumi.get(self, "enabled")

    @property
    @pulumi.getter(name="endPort")
    def end_port(self) -> builtins.int:
        """
        全端口监听的结束端口，仅当Port为0时有效。
        """
        return pulumi.get(self, "end_port")

    @property
    @pulumi.getter
    def healths(self) -> Sequence['outputs.GetNlbListenerHealthResult']:
        """
        后端实例健康检查响应信息。
        """
        return pulumi.get(self, "healths")

    @property
    @pulumi.getter
    def id(self) -> builtins.str:
        """
        Uniquely identifies the resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="listenerId")
    def listener_id(self) -> builtins.str:
        """
        监听器唯一标识。
        """
        return pulumi.get(self, "listener_id")

    @property
    @pulumi.getter(name="listenerName")
    def listener_name(self) -> builtins.str:
        """
        监听器名称。
        """
        return pulumi.get(self, "listener_name")

    @property
    @pulumi.getter(name="loadBalancerId")
    def load_balancer_id(self) -> builtins.str:
        """
        负载均衡实例ID。
        """
        return pulumi.get(self, "load_balancer_id")

    @property
    @pulumi.getter
    def port(self) -> builtins.int:
        """
        监听器接收请求的端口，0表示启用全端口监听。
        """
        return pulumi.get(self, "port")

    @property
    @pulumi.getter
    def protocol(self) -> builtins.str:
        """
        监听协议类型。TCP,UDP,TLS
        """
        return pulumi.get(self, "protocol")

    @property
    @pulumi.getter(name="securityPolicyId")
    def security_policy_id(self) -> builtins.str:
        """
        TLS 安全策略ID，支持系统安全策略和自定义安全策略。系统安全策略取值：.tls*cipher*policy*1*0.tls*cipher*policy*1*1.tls*cipher*policy*1*2.tls*cipher*policy*1*2*strict.tls*cipher*policy*1*2*strict*with*1_3.自定义安全策略：输入自定义安全策略 ID。当Protocol为TLS 时，该参数为必填。。
        """
        return pulumi.get(self, "security_policy_id")

    @property
    @pulumi.getter(name="serverGroupId")
    def server_group_id(self) -> builtins.str:
        """
        监听器关联的服务器组ID。
        """
        return pulumi.get(self, "server_group_id")

    @property
    @pulumi.getter(name="startPort")
    def start_port(self) -> builtins.int:
        """
        全端口监听的起始端口，仅当Port为0时有效。
        """
        return pulumi.get(self, "start_port")

    @property
    @pulumi.getter
    def status(self) -> builtins.str:
        """
        监听器的状态。
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter
    def tags(self) -> Sequence['outputs.GetNlbListenerTagResult']:
        """
        资源标签。
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> builtins.str:
        """
        监听器最近操作时间。
        """
        return pulumi.get(self, "updated_time")


class AwaitableGetNlbListenerResult(GetNlbListenerResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetNlbListenerResult(
            certificate_id=self.certificate_id,
            connection_timeout=self.connection_timeout,
            created_time=self.created_time,
            description=self.description,
            enabled=self.enabled,
            end_port=self.end_port,
            healths=self.healths,
            id=self.id,
            listener_id=self.listener_id,
            listener_name=self.listener_name,
            load_balancer_id=self.load_balancer_id,
            port=self.port,
            protocol=self.protocol,
            security_policy_id=self.security_policy_id,
            server_group_id=self.server_group_id,
            start_port=self.start_port,
            status=self.status,
            tags=self.tags,
            updated_time=self.updated_time)


def get_nlb_listener(id: Optional[builtins.str] = None,
                     opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetNlbListenerResult:
    """
    Data Source schema for Byteplus::CLB::NLBListener


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('bytepluscc:clb/getNlbListener:getNlbListener', __args__, opts=opts, typ=GetNlbListenerResult).value

    return AwaitableGetNlbListenerResult(
        certificate_id=pulumi.get(__ret__, 'certificate_id'),
        connection_timeout=pulumi.get(__ret__, 'connection_timeout'),
        created_time=pulumi.get(__ret__, 'created_time'),
        description=pulumi.get(__ret__, 'description'),
        enabled=pulumi.get(__ret__, 'enabled'),
        end_port=pulumi.get(__ret__, 'end_port'),
        healths=pulumi.get(__ret__, 'healths'),
        id=pulumi.get(__ret__, 'id'),
        listener_id=pulumi.get(__ret__, 'listener_id'),
        listener_name=pulumi.get(__ret__, 'listener_name'),
        load_balancer_id=pulumi.get(__ret__, 'load_balancer_id'),
        port=pulumi.get(__ret__, 'port'),
        protocol=pulumi.get(__ret__, 'protocol'),
        security_policy_id=pulumi.get(__ret__, 'security_policy_id'),
        server_group_id=pulumi.get(__ret__, 'server_group_id'),
        start_port=pulumi.get(__ret__, 'start_port'),
        status=pulumi.get(__ret__, 'status'),
        tags=pulumi.get(__ret__, 'tags'),
        updated_time=pulumi.get(__ret__, 'updated_time'))
def get_nlb_listener_output(id: Optional[pulumi.Input[builtins.str]] = None,
                            opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetNlbListenerResult]:
    """
    Data Source schema for Byteplus::CLB::NLBListener


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('bytepluscc:clb/getNlbListener:getNlbListener', __args__, opts=opts, typ=GetNlbListenerResult)
    return __ret__.apply(lambda __response__: GetNlbListenerResult(
        certificate_id=pulumi.get(__response__, 'certificate_id'),
        connection_timeout=pulumi.get(__response__, 'connection_timeout'),
        created_time=pulumi.get(__response__, 'created_time'),
        description=pulumi.get(__response__, 'description'),
        enabled=pulumi.get(__response__, 'enabled'),
        end_port=pulumi.get(__response__, 'end_port'),
        healths=pulumi.get(__response__, 'healths'),
        id=pulumi.get(__response__, 'id'),
        listener_id=pulumi.get(__response__, 'listener_id'),
        listener_name=pulumi.get(__response__, 'listener_name'),
        load_balancer_id=pulumi.get(__response__, 'load_balancer_id'),
        port=pulumi.get(__response__, 'port'),
        protocol=pulumi.get(__response__, 'protocol'),
        security_policy_id=pulumi.get(__response__, 'security_policy_id'),
        server_group_id=pulumi.get(__response__, 'server_group_id'),
        start_port=pulumi.get(__response__, 'start_port'),
        status=pulumi.get(__response__, 'status'),
        tags=pulumi.get(__response__, 'tags'),
        updated_time=pulumi.get(__response__, 'updated_time')))
