# 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__ = [
    'GetNlbServerGroupResult',
    'AwaitableGetNlbServerGroupResult',
    'get_nlb_server_group',
    'get_nlb_server_group_output',
]

@pulumi.output_type
class GetNlbServerGroupResult:
    """
    A collection of values returned by getNlbServerGroup.
    """
    def __init__(__self__, account_id=None, any_port_enabled=None, bypass_security_group_enabled=None, connection_drain_enabled=None, connection_drain_timeout=None, created_time=None, description=None, health_check=None, id=None, ip_address_version=None, preserve_client_ip_enabled=None, project_name=None, protocol=None, proxy_protocol_type=None, related_load_balancer_ids=None, scheduler=None, server_count=None, server_group_id=None, server_group_name=None, servers=None, session_persistence_enabled=None, session_persistence_timeout=None, status=None, tags=None, timestamp_remove_enabled=None, type=None, updated_time=None, vpc_id=None):
        if account_id and not isinstance(account_id, str):
            raise TypeError("Expected argument 'account_id' to be a str")
        pulumi.set(__self__, "account_id", account_id)
        if any_port_enabled and not isinstance(any_port_enabled, bool):
            raise TypeError("Expected argument 'any_port_enabled' to be a bool")
        pulumi.set(__self__, "any_port_enabled", any_port_enabled)
        if bypass_security_group_enabled and not isinstance(bypass_security_group_enabled, bool):
            raise TypeError("Expected argument 'bypass_security_group_enabled' to be a bool")
        pulumi.set(__self__, "bypass_security_group_enabled", bypass_security_group_enabled)
        if connection_drain_enabled and not isinstance(connection_drain_enabled, bool):
            raise TypeError("Expected argument 'connection_drain_enabled' to be a bool")
        pulumi.set(__self__, "connection_drain_enabled", connection_drain_enabled)
        if connection_drain_timeout and not isinstance(connection_drain_timeout, int):
            raise TypeError("Expected argument 'connection_drain_timeout' to be a int")
        pulumi.set(__self__, "connection_drain_timeout", connection_drain_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 health_check and not isinstance(health_check, dict):
            raise TypeError("Expected argument 'health_check' to be a dict")
        pulumi.set(__self__, "health_check", health_check)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if ip_address_version and not isinstance(ip_address_version, str):
            raise TypeError("Expected argument 'ip_address_version' to be a str")
        pulumi.set(__self__, "ip_address_version", ip_address_version)
        if preserve_client_ip_enabled and not isinstance(preserve_client_ip_enabled, bool):
            raise TypeError("Expected argument 'preserve_client_ip_enabled' to be a bool")
        pulumi.set(__self__, "preserve_client_ip_enabled", preserve_client_ip_enabled)
        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 proxy_protocol_type and not isinstance(proxy_protocol_type, str):
            raise TypeError("Expected argument 'proxy_protocol_type' to be a str")
        pulumi.set(__self__, "proxy_protocol_type", proxy_protocol_type)
        if related_load_balancer_ids and not isinstance(related_load_balancer_ids, list):
            raise TypeError("Expected argument 'related_load_balancer_ids' to be a list")
        pulumi.set(__self__, "related_load_balancer_ids", related_load_balancer_ids)
        if scheduler and not isinstance(scheduler, str):
            raise TypeError("Expected argument 'scheduler' to be a str")
        pulumi.set(__self__, "scheduler", scheduler)
        if server_count and not isinstance(server_count, int):
            raise TypeError("Expected argument 'server_count' to be a int")
        pulumi.set(__self__, "server_count", server_count)
        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_group_name and not isinstance(server_group_name, str):
            raise TypeError("Expected argument 'server_group_name' to be a str")
        pulumi.set(__self__, "server_group_name", server_group_name)
        if servers and not isinstance(servers, list):
            raise TypeError("Expected argument 'servers' to be a list")
        pulumi.set(__self__, "servers", servers)
        if session_persistence_enabled and not isinstance(session_persistence_enabled, bool):
            raise TypeError("Expected argument 'session_persistence_enabled' to be a bool")
        pulumi.set(__self__, "session_persistence_enabled", session_persistence_enabled)
        if session_persistence_timeout and not isinstance(session_persistence_timeout, int):
            raise TypeError("Expected argument 'session_persistence_timeout' to be a int")
        pulumi.set(__self__, "session_persistence_timeout", session_persistence_timeout)
        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 timestamp_remove_enabled and not isinstance(timestamp_remove_enabled, bool):
            raise TypeError("Expected argument 'timestamp_remove_enabled' to be a bool")
        pulumi.set(__self__, "timestamp_remove_enabled", timestamp_remove_enabled)
        if type and not isinstance(type, str):
            raise TypeError("Expected argument 'type' to be a str")
        pulumi.set(__self__, "type", type)
        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)
        if vpc_id and not isinstance(vpc_id, str):
            raise TypeError("Expected argument 'vpc_id' to be a str")
        pulumi.set(__self__, "vpc_id", vpc_id)

    @property
    @pulumi.getter(name="accountId")
    def account_id(self) -> builtins.str:
        """
        账号ID。
        """
        return pulumi.get(self, "account_id")

    @property
    @pulumi.getter(name="anyPortEnabled")
    def any_port_enabled(self) -> builtins.bool:
        """
        是否开启全端口转发。
        """
        return pulumi.get(self, "any_port_enabled")

    @property
    @pulumi.getter(name="bypassSecurityGroupEnabled")
    def bypass_security_group_enabled(self) -> builtins.bool:
        """
        是否开启放通后端安全组功能。仅参数Type为“instance”时，可以配置此参数。
        """
        return pulumi.get(self, "bypass_security_group_enabled")

    @property
    @pulumi.getter(name="connectionDrainEnabled")
    def connection_drain_enabled(self) -> builtins.bool:
        """
        是否开启连接优雅中断。
        """
        return pulumi.get(self, "connection_drain_enabled")

    @property
    @pulumi.getter(name="connectionDrainTimeout")
    def connection_drain_timeout(self) -> builtins.int:
        """
        连接优雅中断超时时间，取值范围为0～900秒。参数ConnectionDrainEnabled为“true”时，该参数为必填。
        """
        return pulumi.get(self, "connection_drain_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:
        """
        后端服务器组的描述,服务器组的描述。必须以字母、数字或中文开头，可包含以下特殊字符：英文逗号（,）、点号（.）、下划线（_）、空格（ ）、等号（=）、中划线（-）、中文逗号（，）、中文句号（。）长度限制为0 ～ 255个字符。该参数不传入，则默认为空字符串。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="healthCheck")
    def health_check(self) -> 'outputs.GetNlbServerGroupHealthCheckResult':
        """
        健康检查相关参数。
        """
        return pulumi.get(self, "health_check")

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

    @property
    @pulumi.getter(name="ipAddressVersion")
    def ip_address_version(self) -> builtins.str:
        """
        服务器组的IP地址类型。取值如下：ipv4（默认值）：表示该服务器组仅支持添加IPv4类型的后端服务器。ipv6：表示该服务器组仅支持添加IPv6类型的后端服务器。
        """
        return pulumi.get(self, "ip_address_version")

    @property
    @pulumi.getter(name="preserveClientIpEnabled")
    def preserve_client_ip_enabled(self) -> builtins.bool:
        """
        是否开启源地址保持。
        """
        return pulumi.get(self, "preserve_client_ip_enabled")

    @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:
        """
        NLB转发流量到后端服务器时使用的通信协议。取值如下：TCP。UDP。
        """
        return pulumi.get(self, "protocol")

    @property
    @pulumi.getter(name="proxyProtocolType")
    def proxy_protocol_type(self) -> builtins.str:
        """
        是否开启Proxy-Protocol协议。取值如下：off（默认值）：关闭。standard：开启。NLB将通过Proxy-Protocol协议携带客户端源IP地址转发至后端服务器，还需要在后端服务器上配置Proxy-Protocol。
        """
        return pulumi.get(self, "proxy_protocol_type")

    @property
    @pulumi.getter(name="relatedLoadBalancerIds")
    def related_load_balancer_ids(self) -> Sequence[builtins.str]:
        """
        服务器组关联的NLB实例。
        """
        return pulumi.get(self, "related_load_balancer_ids")

    @property
    @pulumi.getter
    def scheduler(self) -> builtins.str:
        """
        NLB转发流量时遵循的规则。取值如下：wrr（默认值）：加权轮询，权重值越高的后端服务器，被轮询到的次数（概率）越高。wlc：加权最小连接数，在最少连接数的基础上，根据后端服务器的不同处理能力，给每个服务器分配不同的权重，使其能够接受相应权值数的服务请求。sh：源地址哈希，基于源IP地址的一致性哈希，相同的源地址会调度到相同的后端服务器。
        """
        return pulumi.get(self, "scheduler")

    @property
    @pulumi.getter(name="serverCount")
    def server_count(self) -> builtins.int:
        """
        服务器组中后端服务器的数量。
        """
        return pulumi.get(self, "server_count")

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

    @property
    @pulumi.getter(name="serverGroupName")
    def server_group_name(self) -> builtins.str:
        """
        服务器组名称, 必须以字母、数字或中文开头，可包含以下特殊字符：点号（.）、下划线（_）和中划线（-）。限制为1 ～ 128个字符。该参数不传入，则默认为服务器组ID。
        """
        return pulumi.get(self, "server_group_name")

    @property
    @pulumi.getter
    def servers(self) -> Sequence['outputs.GetNlbServerGroupServerResult']:
        """
        服务器组中待添加后端服务器的信息。
        """
        return pulumi.get(self, "servers")

    @property
    @pulumi.getter(name="sessionPersistenceEnabled")
    def session_persistence_enabled(self) -> builtins.bool:
        """
        是否开启会话保持。
        """
        return pulumi.get(self, "session_persistence_enabled")

    @property
    @pulumi.getter(name="sessionPersistenceTimeout")
    def session_persistence_timeout(self) -> builtins.int:
        """
        会话保持的超时时间，取值范围为1～3600秒，默认1000秒。
        """
        return pulumi.get(self, "session_persistence_timeout")

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

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

    @property
    @pulumi.getter(name="timestampRemoveEnabled")
    def timestamp_remove_enabled(self) -> builtins.bool:
        """
        是否开启清除TCP/HTTP/HTTPS报文的timestamp（即时间戳）的功能。
        """
        return pulumi.get(self, "timestamp_remove_enabled")

    @property
    @pulumi.getter
    def type(self) -> builtins.str:
        """
        服务器组的类型。取值如下：instance（默认值）：服务器类型。支持添加云服务器实例和已绑定云服务器实例的辅助网卡作为后端服务器。ip：IP地址类型。支持添加任何网络可达的VPC或IDC中的服务器作为后端服务器。
        """
        return pulumi.get(self, "type")

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> builtins.str:
        """
        后端服务器组的更新时间。
        """
        return pulumi.get(self, "updated_time")

    @property
    @pulumi.getter(name="vpcId")
    def vpc_id(self) -> builtins.str:
        """
        服务器组所属私有网络的ID。
        """
        return pulumi.get(self, "vpc_id")


class AwaitableGetNlbServerGroupResult(GetNlbServerGroupResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetNlbServerGroupResult(
            account_id=self.account_id,
            any_port_enabled=self.any_port_enabled,
            bypass_security_group_enabled=self.bypass_security_group_enabled,
            connection_drain_enabled=self.connection_drain_enabled,
            connection_drain_timeout=self.connection_drain_timeout,
            created_time=self.created_time,
            description=self.description,
            health_check=self.health_check,
            id=self.id,
            ip_address_version=self.ip_address_version,
            preserve_client_ip_enabled=self.preserve_client_ip_enabled,
            project_name=self.project_name,
            protocol=self.protocol,
            proxy_protocol_type=self.proxy_protocol_type,
            related_load_balancer_ids=self.related_load_balancer_ids,
            scheduler=self.scheduler,
            server_count=self.server_count,
            server_group_id=self.server_group_id,
            server_group_name=self.server_group_name,
            servers=self.servers,
            session_persistence_enabled=self.session_persistence_enabled,
            session_persistence_timeout=self.session_persistence_timeout,
            status=self.status,
            tags=self.tags,
            timestamp_remove_enabled=self.timestamp_remove_enabled,
            type=self.type,
            updated_time=self.updated_time,
            vpc_id=self.vpc_id)


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


    :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/getNlbServerGroup:getNlbServerGroup', __args__, opts=opts, typ=GetNlbServerGroupResult).value

    return AwaitableGetNlbServerGroupResult(
        account_id=pulumi.get(__ret__, 'account_id'),
        any_port_enabled=pulumi.get(__ret__, 'any_port_enabled'),
        bypass_security_group_enabled=pulumi.get(__ret__, 'bypass_security_group_enabled'),
        connection_drain_enabled=pulumi.get(__ret__, 'connection_drain_enabled'),
        connection_drain_timeout=pulumi.get(__ret__, 'connection_drain_timeout'),
        created_time=pulumi.get(__ret__, 'created_time'),
        description=pulumi.get(__ret__, 'description'),
        health_check=pulumi.get(__ret__, 'health_check'),
        id=pulumi.get(__ret__, 'id'),
        ip_address_version=pulumi.get(__ret__, 'ip_address_version'),
        preserve_client_ip_enabled=pulumi.get(__ret__, 'preserve_client_ip_enabled'),
        project_name=pulumi.get(__ret__, 'project_name'),
        protocol=pulumi.get(__ret__, 'protocol'),
        proxy_protocol_type=pulumi.get(__ret__, 'proxy_protocol_type'),
        related_load_balancer_ids=pulumi.get(__ret__, 'related_load_balancer_ids'),
        scheduler=pulumi.get(__ret__, 'scheduler'),
        server_count=pulumi.get(__ret__, 'server_count'),
        server_group_id=pulumi.get(__ret__, 'server_group_id'),
        server_group_name=pulumi.get(__ret__, 'server_group_name'),
        servers=pulumi.get(__ret__, 'servers'),
        session_persistence_enabled=pulumi.get(__ret__, 'session_persistence_enabled'),
        session_persistence_timeout=pulumi.get(__ret__, 'session_persistence_timeout'),
        status=pulumi.get(__ret__, 'status'),
        tags=pulumi.get(__ret__, 'tags'),
        timestamp_remove_enabled=pulumi.get(__ret__, 'timestamp_remove_enabled'),
        type=pulumi.get(__ret__, 'type'),
        updated_time=pulumi.get(__ret__, 'updated_time'),
        vpc_id=pulumi.get(__ret__, 'vpc_id'))
def get_nlb_server_group_output(id: Optional[pulumi.Input[builtins.str]] = None,
                                opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetNlbServerGroupResult]:
    """
    Data Source schema for Byteplus::CLB::NLBServerGroup


    :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/getNlbServerGroup:getNlbServerGroup', __args__, opts=opts, typ=GetNlbServerGroupResult)
    return __ret__.apply(lambda __response__: GetNlbServerGroupResult(
        account_id=pulumi.get(__response__, 'account_id'),
        any_port_enabled=pulumi.get(__response__, 'any_port_enabled'),
        bypass_security_group_enabled=pulumi.get(__response__, 'bypass_security_group_enabled'),
        connection_drain_enabled=pulumi.get(__response__, 'connection_drain_enabled'),
        connection_drain_timeout=pulumi.get(__response__, 'connection_drain_timeout'),
        created_time=pulumi.get(__response__, 'created_time'),
        description=pulumi.get(__response__, 'description'),
        health_check=pulumi.get(__response__, 'health_check'),
        id=pulumi.get(__response__, 'id'),
        ip_address_version=pulumi.get(__response__, 'ip_address_version'),
        preserve_client_ip_enabled=pulumi.get(__response__, 'preserve_client_ip_enabled'),
        project_name=pulumi.get(__response__, 'project_name'),
        protocol=pulumi.get(__response__, 'protocol'),
        proxy_protocol_type=pulumi.get(__response__, 'proxy_protocol_type'),
        related_load_balancer_ids=pulumi.get(__response__, 'related_load_balancer_ids'),
        scheduler=pulumi.get(__response__, 'scheduler'),
        server_count=pulumi.get(__response__, 'server_count'),
        server_group_id=pulumi.get(__response__, 'server_group_id'),
        server_group_name=pulumi.get(__response__, 'server_group_name'),
        servers=pulumi.get(__response__, 'servers'),
        session_persistence_enabled=pulumi.get(__response__, 'session_persistence_enabled'),
        session_persistence_timeout=pulumi.get(__response__, 'session_persistence_timeout'),
        status=pulumi.get(__response__, 'status'),
        tags=pulumi.get(__response__, 'tags'),
        timestamp_remove_enabled=pulumi.get(__response__, 'timestamp_remove_enabled'),
        type=pulumi.get(__response__, 'type'),
        updated_time=pulumi.get(__response__, 'updated_time'),
        vpc_id=pulumi.get(__response__, 'vpc_id')))
