# 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__ = [
    'GetListenerResult',
    'AwaitableGetListenerResult',
    'get_listener',
    'get_listener_output',
]

@pulumi.output_type
class GetListenerResult:
    """
    A collection of values returned by getListener.
    """
    def __init__(__self__, access_log_record_customized_headers_enabled=None, acl_ids=None, acl_status=None, acl_type=None, ca_certificate_id=None, ca_certificate_source=None, cert_center_certificate_id=None, certificate_id=None, certificate_source=None, created_time=None, customized_cfg_id=None, description=None, domain_extensions=None, enable_http2=None, enable_quic=None, enabled=None, id=None, listener_id=None, listener_name=None, load_balancer_id=None, pca_leaf_certificate_id=None, pca_root_ca_certificate_id=None, pca_sub_ca_certificate_id=None, port=None, project_name=None, protocol=None, server_group_id=None, server_groups=None, status=None, tags=None, updated_time=None):
        if access_log_record_customized_headers_enabled and not isinstance(access_log_record_customized_headers_enabled, str):
            raise TypeError("Expected argument 'access_log_record_customized_headers_enabled' to be a str")
        pulumi.set(__self__, "access_log_record_customized_headers_enabled", access_log_record_customized_headers_enabled)
        if acl_ids and not isinstance(acl_ids, list):
            raise TypeError("Expected argument 'acl_ids' to be a list")
        pulumi.set(__self__, "acl_ids", acl_ids)
        if acl_status and not isinstance(acl_status, str):
            raise TypeError("Expected argument 'acl_status' to be a str")
        pulumi.set(__self__, "acl_status", acl_status)
        if acl_type and not isinstance(acl_type, str):
            raise TypeError("Expected argument 'acl_type' to be a str")
        pulumi.set(__self__, "acl_type", acl_type)
        if ca_certificate_id and not isinstance(ca_certificate_id, str):
            raise TypeError("Expected argument 'ca_certificate_id' to be a str")
        pulumi.set(__self__, "ca_certificate_id", ca_certificate_id)
        if ca_certificate_source and not isinstance(ca_certificate_source, str):
            raise TypeError("Expected argument 'ca_certificate_source' to be a str")
        pulumi.set(__self__, "ca_certificate_source", ca_certificate_source)
        if cert_center_certificate_id and not isinstance(cert_center_certificate_id, str):
            raise TypeError("Expected argument 'cert_center_certificate_id' to be a str")
        pulumi.set(__self__, "cert_center_certificate_id", cert_center_certificate_id)
        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 certificate_source and not isinstance(certificate_source, str):
            raise TypeError("Expected argument 'certificate_source' to be a str")
        pulumi.set(__self__, "certificate_source", certificate_source)
        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 customized_cfg_id and not isinstance(customized_cfg_id, str):
            raise TypeError("Expected argument 'customized_cfg_id' to be a str")
        pulumi.set(__self__, "customized_cfg_id", customized_cfg_id)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if domain_extensions and not isinstance(domain_extensions, list):
            raise TypeError("Expected argument 'domain_extensions' to be a list")
        pulumi.set(__self__, "domain_extensions", domain_extensions)
        if enable_http2 and not isinstance(enable_http2, str):
            raise TypeError("Expected argument 'enable_http2' to be a str")
        pulumi.set(__self__, "enable_http2", enable_http2)
        if enable_quic and not isinstance(enable_quic, str):
            raise TypeError("Expected argument 'enable_quic' to be a str")
        pulumi.set(__self__, "enable_quic", enable_quic)
        if enabled and not isinstance(enabled, str):
            raise TypeError("Expected argument 'enabled' to be a str")
        pulumi.set(__self__, "enabled", enabled)
        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 pca_leaf_certificate_id and not isinstance(pca_leaf_certificate_id, str):
            raise TypeError("Expected argument 'pca_leaf_certificate_id' to be a str")
        pulumi.set(__self__, "pca_leaf_certificate_id", pca_leaf_certificate_id)
        if pca_root_ca_certificate_id and not isinstance(pca_root_ca_certificate_id, str):
            raise TypeError("Expected argument 'pca_root_ca_certificate_id' to be a str")
        pulumi.set(__self__, "pca_root_ca_certificate_id", pca_root_ca_certificate_id)
        if pca_sub_ca_certificate_id and not isinstance(pca_sub_ca_certificate_id, str):
            raise TypeError("Expected argument 'pca_sub_ca_certificate_id' to be a str")
        pulumi.set(__self__, "pca_sub_ca_certificate_id", pca_sub_ca_certificate_id)
        if port and not isinstance(port, int):
            raise TypeError("Expected argument 'port' to be a int")
        pulumi.set(__self__, "port", port)
        if project_name and not isinstance(project_name, str):
            raise TypeError("Expected argument 'project_name' to be a str")
        pulumi.set(__self__, "project_name", project_name)
        if protocol and not isinstance(protocol, str):
            raise TypeError("Expected argument 'protocol' to be a str")
        pulumi.set(__self__, "protocol", protocol)
        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 server_groups and not isinstance(server_groups, list):
            raise TypeError("Expected argument 'server_groups' to be a list")
        pulumi.set(__self__, "server_groups", server_groups)
        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="accessLogRecordCustomizedHeadersEnabled")
    def access_log_record_customized_headers_enabled(self) -> builtins.str:
        """
        监听器是否已开启“在访问日志中记录自定义header”的功能：on：表示该功能已开启。off：表示该功能未开启。
        """
        return pulumi.get(self, "access_log_record_customized_headers_enabled")

    @property
    @pulumi.getter(name="aclIds")
    def acl_ids(self) -> Sequence[builtins.str]:
        """
        监听器绑定的访问控制策略组 ID。当AclStatus参数配置为 on 时，AclIds为必填参数。
        """
        return pulumi.get(self, "acl_ids")

    @property
    @pulumi.getter(name="aclStatus")
    def acl_status(self) -> builtins.str:
        """
        是否开启访问控制功能。取值如下：on：开启。off ：不开启（默认）。
        """
        return pulumi.get(self, "acl_status")

    @property
    @pulumi.getter(name="aclType")
    def acl_type(self) -> builtins.str:
        """
        访问控制的方式，取值如下：white：白名单方式。表示监听器仅转发来自所选访问控制策略组中设置的IP地址或地址段的请求。 如果所选策略组中没有添加任何IP，则监听器不会转发任何请求。black：黑名单方式。表示仅拒绝来自所选访问控制策略组中设置的IP地址或地址段的请求。 如果所选策略组中没有添加任何IP，则监听器会转发全部请求。当AclStatus参数配置为 on 时，AclType为必填参数。
        """
        return pulumi.get(self, "acl_type")

    @property
    @pulumi.getter(name="caCertificateId")
    def ca_certificate_id(self) -> builtins.str:
        """
        HTTPS 监听器关联的 CA 证书 ID。该参数用于 HTTPS 监听器的双向认证。当证书来源是 alb 时，必须指定 CACertificateId 参数。
        """
        return pulumi.get(self, "ca_certificate_id")

    @property
    @pulumi.getter(name="caCertificateSource")
    def ca_certificate_source(self) -> builtins.str:
        """
        HTTPS 监听器关联的 CA 证书的来源，用于双向认证。alb（默认）：表示通过 ALB 上传的证书。标准版 ALB 实例不支持此来源的证书。pca*root：表示通过火山引擎证书中心购买或上传的私有根 CA 证书。pca*sub：表示通过火山引擎证书中心购买或上传的私有子 CA 证书。
        """
        return pulumi.get(self, "ca_certificate_source")

    @property
    @pulumi.getter(name="certCenterCertificateId")
    def cert_center_certificate_id(self) -> builtins.str:
        """
        HTTPS监听器关联的证书 ID。创建 HTTPS 监听器且证书来源为 cert_center 时必传。
        """
        return pulumi.get(self, "cert_center_certificate_id")

    @property
    @pulumi.getter(name="certificateId")
    def certificate_id(self) -> builtins.str:
        """
        HTTPS监听器关联的证书 ID。创建 HTTPS 监听器且证书来源为 alb 时必传。
        """
        return pulumi.get(self, "certificate_id")

    @property
    @pulumi.getter(name="certificateSource")
    def certificate_source(self) -> builtins.str:
        """
        HTTPS监听器关联的默认证书的来源，取值：alb：表示通过 ALB 上传的证书。cert*center：表示通过火山引擎证书中心购买或上传的 SSL 证书。pca*leaf：表示通过火山引擎证书中心购买或上传的私有叶子证书。
        """
        return pulumi.get(self, "certificate_source")

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

    @property
    @pulumi.getter(name="customizedCfgId")
    def customized_cfg_id(self) -> builtins.str:
        """
        个性化配置ID，未绑定时值为空字符串。
        """
        return pulumi.get(self, "customized_cfg_id")

    @property
    @pulumi.getter
    def description(self) -> builtins.str:
        """
        监听器的描述。不能以http://或https://开头。必须以字母或中文开头，可包含数字、英文逗号（,）、点号（.）、下划线（_）、空格（ ）、等号（=）、短横线（-）、中文逗号（，）、中文句号（。） 。长度限制为1 ～ 255个字符。不填默认为空字符串。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="domainExtensions")
    def domain_extensions(self) -> Sequence['outputs.GetListenerDomainExtensionResult']:
        """
        HTTPS监听器关联的扩展域名列表。一个HTTPS监听器能关联的扩展域名上限为20个。
        """
        return pulumi.get(self, "domain_extensions")

    @property
    @pulumi.getter(name="enableHttp2")
    def enable_http2(self) -> builtins.str:
        """
        HTTP2.0 特性开关，该参数仅对 HTTPS 监听器有效。取值如下：on：开启。off：关闭（默认）。
        """
        return pulumi.get(self, "enable_http2")

    @property
    @pulumi.getter(name="enableQuic")
    def enable_quic(self) -> builtins.str:
        """
        QUIC 特性开关，该参数仅对 HTTPS 监听器有效，取值如下：on：开启。off：关闭（默认）。只有标准版 ALB 实例支持 QUIC。
        """
        return pulumi.get(self, "enable_quic")

    @property
    @pulumi.getter
    def enabled(self) -> builtins.str:
        """
        监听器开启/关闭，取值如下：on：开启（默认）。off：关闭。
        """
        return pulumi.get(self, "enabled")

    @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:
        """
        监听器 ID。
        """
        return pulumi.get(self, "listener_id")

    @property
    @pulumi.getter(name="listenerName")
    def listener_name(self) -> builtins.str:
        """
        监听器的名字。不填写时以“协议-端口”格式命名。不能以http://或https://开头。必须以字母或中文开头，可包含数字、点（.）、下划线（_）和短横线（-）。长度限制在1-128字符之间。
        """
        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(name="pcaLeafCertificateId")
    def pca_leaf_certificate_id(self) -> builtins.str:
        """
        HTTPS监听器关联的私有叶子证书 ID。创建 HTTPS 监听器且证书来源为 pca_leaf 时必传。
        """
        return pulumi.get(self, "pca_leaf_certificate_id")

    @property
    @pulumi.getter(name="pcaRootCaCertificateId")
    def pca_root_ca_certificate_id(self) -> builtins.str:
        """
        HTTPS 监听器关联的 CA 证书 ID。该参数用于 HTTPS 监听器的双向认证。当证书来源是 pca_root 时，必须指定 PcaRootCACertificateId 参数。
        """
        return pulumi.get(self, "pca_root_ca_certificate_id")

    @property
    @pulumi.getter(name="pcaSubCaCertificateId")
    def pca_sub_ca_certificate_id(self) -> builtins.str:
        """
        HTTPS 监听器关联的 CA 证书 ID。该参数用于 HTTPS 监听器的双向认证。当证书来源是 pca_sub 时，必须指定 PcaSubCACertificateId 参数。
        """
        return pulumi.get(self, "pca_sub_ca_certificate_id")

    @property
    @pulumi.getter
    def port(self) -> builtins.int:
        """
        监听器的监听端口，取值：1   - 65535 。
        """
        return pulumi.get(self, "port")

    @property
    @pulumi.getter(name="projectName")
    def project_name(self) -> builtins.str:
        """
        监听器所属项目名称。
        """
        return pulumi.get(self, "project_name")

    @property
    @pulumi.getter
    def protocol(self) -> builtins.str:
        """
        监听器的协议，支持 HTTP 协议和 HTTPS 协议。
        """
        return pulumi.get(self, "protocol")

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

    @property
    @pulumi.getter(name="serverGroups")
    def server_groups(self) -> Sequence['outputs.GetListenerServerGroupResult']:
        """
        关联监听器的所有服务器组。
        """
        return pulumi.get(self, "server_groups")

    @property
    @pulumi.getter
    def status(self) -> builtins.str:
        """
        监听器的状态。取值如下：Creating：创建中。Active： 运行中。Pending： 变配中。Disabled：已停止。Deleting：删除中。
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter
    def tags(self) -> Sequence['outputs.GetListenerTagResult']:
        """
        监听器所属标签。
        """
        return pulumi.get(self, "tags")

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


class AwaitableGetListenerResult(GetListenerResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetListenerResult(
            access_log_record_customized_headers_enabled=self.access_log_record_customized_headers_enabled,
            acl_ids=self.acl_ids,
            acl_status=self.acl_status,
            acl_type=self.acl_type,
            ca_certificate_id=self.ca_certificate_id,
            ca_certificate_source=self.ca_certificate_source,
            cert_center_certificate_id=self.cert_center_certificate_id,
            certificate_id=self.certificate_id,
            certificate_source=self.certificate_source,
            created_time=self.created_time,
            customized_cfg_id=self.customized_cfg_id,
            description=self.description,
            domain_extensions=self.domain_extensions,
            enable_http2=self.enable_http2,
            enable_quic=self.enable_quic,
            enabled=self.enabled,
            id=self.id,
            listener_id=self.listener_id,
            listener_name=self.listener_name,
            load_balancer_id=self.load_balancer_id,
            pca_leaf_certificate_id=self.pca_leaf_certificate_id,
            pca_root_ca_certificate_id=self.pca_root_ca_certificate_id,
            pca_sub_ca_certificate_id=self.pca_sub_ca_certificate_id,
            port=self.port,
            project_name=self.project_name,
            protocol=self.protocol,
            server_group_id=self.server_group_id,
            server_groups=self.server_groups,
            status=self.status,
            tags=self.tags,
            updated_time=self.updated_time)


def get_listener(id: Optional[builtins.str] = None,
                 opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetListenerResult:
    """
    Data Source schema for Byteplus::ALB::Listener


    :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:alb/getListener:getListener', __args__, opts=opts, typ=GetListenerResult).value

    return AwaitableGetListenerResult(
        access_log_record_customized_headers_enabled=pulumi.get(__ret__, 'access_log_record_customized_headers_enabled'),
        acl_ids=pulumi.get(__ret__, 'acl_ids'),
        acl_status=pulumi.get(__ret__, 'acl_status'),
        acl_type=pulumi.get(__ret__, 'acl_type'),
        ca_certificate_id=pulumi.get(__ret__, 'ca_certificate_id'),
        ca_certificate_source=pulumi.get(__ret__, 'ca_certificate_source'),
        cert_center_certificate_id=pulumi.get(__ret__, 'cert_center_certificate_id'),
        certificate_id=pulumi.get(__ret__, 'certificate_id'),
        certificate_source=pulumi.get(__ret__, 'certificate_source'),
        created_time=pulumi.get(__ret__, 'created_time'),
        customized_cfg_id=pulumi.get(__ret__, 'customized_cfg_id'),
        description=pulumi.get(__ret__, 'description'),
        domain_extensions=pulumi.get(__ret__, 'domain_extensions'),
        enable_http2=pulumi.get(__ret__, 'enable_http2'),
        enable_quic=pulumi.get(__ret__, 'enable_quic'),
        enabled=pulumi.get(__ret__, 'enabled'),
        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'),
        pca_leaf_certificate_id=pulumi.get(__ret__, 'pca_leaf_certificate_id'),
        pca_root_ca_certificate_id=pulumi.get(__ret__, 'pca_root_ca_certificate_id'),
        pca_sub_ca_certificate_id=pulumi.get(__ret__, 'pca_sub_ca_certificate_id'),
        port=pulumi.get(__ret__, 'port'),
        project_name=pulumi.get(__ret__, 'project_name'),
        protocol=pulumi.get(__ret__, 'protocol'),
        server_group_id=pulumi.get(__ret__, 'server_group_id'),
        server_groups=pulumi.get(__ret__, 'server_groups'),
        status=pulumi.get(__ret__, 'status'),
        tags=pulumi.get(__ret__, 'tags'),
        updated_time=pulumi.get(__ret__, 'updated_time'))
def get_listener_output(id: Optional[pulumi.Input[builtins.str]] = None,
                        opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetListenerResult]:
    """
    Data Source schema for Byteplus::ALB::Listener


    :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:alb/getListener:getListener', __args__, opts=opts, typ=GetListenerResult)
    return __ret__.apply(lambda __response__: GetListenerResult(
        access_log_record_customized_headers_enabled=pulumi.get(__response__, 'access_log_record_customized_headers_enabled'),
        acl_ids=pulumi.get(__response__, 'acl_ids'),
        acl_status=pulumi.get(__response__, 'acl_status'),
        acl_type=pulumi.get(__response__, 'acl_type'),
        ca_certificate_id=pulumi.get(__response__, 'ca_certificate_id'),
        ca_certificate_source=pulumi.get(__response__, 'ca_certificate_source'),
        cert_center_certificate_id=pulumi.get(__response__, 'cert_center_certificate_id'),
        certificate_id=pulumi.get(__response__, 'certificate_id'),
        certificate_source=pulumi.get(__response__, 'certificate_source'),
        created_time=pulumi.get(__response__, 'created_time'),
        customized_cfg_id=pulumi.get(__response__, 'customized_cfg_id'),
        description=pulumi.get(__response__, 'description'),
        domain_extensions=pulumi.get(__response__, 'domain_extensions'),
        enable_http2=pulumi.get(__response__, 'enable_http2'),
        enable_quic=pulumi.get(__response__, 'enable_quic'),
        enabled=pulumi.get(__response__, 'enabled'),
        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'),
        pca_leaf_certificate_id=pulumi.get(__response__, 'pca_leaf_certificate_id'),
        pca_root_ca_certificate_id=pulumi.get(__response__, 'pca_root_ca_certificate_id'),
        pca_sub_ca_certificate_id=pulumi.get(__response__, 'pca_sub_ca_certificate_id'),
        port=pulumi.get(__response__, 'port'),
        project_name=pulumi.get(__response__, 'project_name'),
        protocol=pulumi.get(__response__, 'protocol'),
        server_group_id=pulumi.get(__response__, 'server_group_id'),
        server_groups=pulumi.get(__response__, 'server_groups'),
        status=pulumi.get(__response__, 'status'),
        tags=pulumi.get(__response__, 'tags'),
        updated_time=pulumi.get(__response__, 'updated_time')))
