# 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
from ._inputs import *

__all__ = ['DbEndpointArgs', 'DbEndpoint']

@pulumi.input_type
class DbEndpointArgs:
    def __init__(__self__, *,
                 addresses: Optional[pulumi.Input[Sequence[pulumi.Input['DbEndpointAddressArgs']]]] = None,
                 enable_read_write_splitting: Optional[pulumi.Input[builtins.str]] = None,
                 endpoint_name: Optional[pulumi.Input[builtins.str]] = None,
                 endpoint_type: Optional[pulumi.Input[builtins.str]] = None,
                 instance_id: Optional[pulumi.Input[builtins.str]] = None,
                 nodes: Optional[pulumi.Input[builtins.str]] = None,
                 read_only_node_distribution_type: Optional[pulumi.Input[builtins.str]] = None,
                 read_only_node_max_delay_time: Optional[pulumi.Input[builtins.int]] = None,
                 read_only_node_weights: Optional[pulumi.Input[Sequence[pulumi.Input['DbEndpointReadOnlyNodeWeightArgs']]]] = None,
                 read_write_mode: Optional[pulumi.Input[builtins.str]] = None,
                 read_write_proxy_connection: Optional[pulumi.Input[builtins.int]] = None,
                 write_node_halt_writing: Optional[pulumi.Input[builtins.bool]] = None):
        """
        The set of arguments for constructing a DbEndpoint resource.
        :param pulumi.Input[builtins.str] enable_read_write_splitting: 是否已开启读写分离，取值：Enable：开启。Disable：未开启。
        :param pulumi.Input[builtins.str] endpoint_name: 实例连接终端名称。
        :param pulumi.Input[builtins.str] endpoint_type: 终端类型：Cluster：默认终端（默认创建）。Custom：自定义终端。
        :param pulumi.Input[builtins.str] instance_id: 实例 ID。
        :param pulumi.Input[builtins.str] nodes: 连接终端配置的节点列表。说明当 EndpointType 为 Custom 时必选。主节点无需传节点 ID，传入 Primary 字符串即可。
        :param pulumi.Input[builtins.str] read_only_node_distribution_type: 只读权重分配模式。取值：Default：标准权重分配（默认值）。Custom：自定义权重分配。
        :param pulumi.Input[builtins.int] read_only_node_max_delay_time: 只读节点的最大延迟阈值，当只读节点延迟时间超过该值时，读取流量不发往该节点，单位：秒。取值：0~3600。默认值：30。说明支持对开通了读写分离的默认终端设置此参数。
        :param pulumi.Input[builtins.str] read_write_mode: 读写模式：ReadWrite：读写。ReadOnly：只读。
        :param pulumi.Input[builtins.int] read_write_proxy_connection: 终端开启读写分离后，为终端设置的代理连接数。代理连接数的取值下限为 20。代理连接数的取值上限取决于实例主节点的规格，不同规格支持的代理连接数上限不同，详细信息请参见产品规格。
        :param pulumi.Input[builtins.bool] write_node_halt_writing: 终端是否将写请求发送给写节点（目前仅主节点为写节点）。取值：true：是。默认值。false：否。
        """
        if addresses is not None:
            pulumi.set(__self__, "addresses", addresses)
        if enable_read_write_splitting is not None:
            pulumi.set(__self__, "enable_read_write_splitting", enable_read_write_splitting)
        if endpoint_name is not None:
            pulumi.set(__self__, "endpoint_name", endpoint_name)
        if endpoint_type is not None:
            pulumi.set(__self__, "endpoint_type", endpoint_type)
        if instance_id is not None:
            pulumi.set(__self__, "instance_id", instance_id)
        if nodes is not None:
            pulumi.set(__self__, "nodes", nodes)
        if read_only_node_distribution_type is not None:
            pulumi.set(__self__, "read_only_node_distribution_type", read_only_node_distribution_type)
        if read_only_node_max_delay_time is not None:
            pulumi.set(__self__, "read_only_node_max_delay_time", read_only_node_max_delay_time)
        if read_only_node_weights is not None:
            pulumi.set(__self__, "read_only_node_weights", read_only_node_weights)
        if read_write_mode is not None:
            pulumi.set(__self__, "read_write_mode", read_write_mode)
        if read_write_proxy_connection is not None:
            pulumi.set(__self__, "read_write_proxy_connection", read_write_proxy_connection)
        if write_node_halt_writing is not None:
            pulumi.set(__self__, "write_node_halt_writing", write_node_halt_writing)

    @property
    @pulumi.getter
    def addresses(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DbEndpointAddressArgs']]]]:
        return pulumi.get(self, "addresses")

    @addresses.setter
    def addresses(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DbEndpointAddressArgs']]]]):
        pulumi.set(self, "addresses", value)

    @property
    @pulumi.getter(name="enableReadWriteSplitting")
    def enable_read_write_splitting(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        是否已开启读写分离，取值：Enable：开启。Disable：未开启。
        """
        return pulumi.get(self, "enable_read_write_splitting")

    @enable_read_write_splitting.setter
    def enable_read_write_splitting(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "enable_read_write_splitting", value)

    @property
    @pulumi.getter(name="endpointName")
    def endpoint_name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        实例连接终端名称。
        """
        return pulumi.get(self, "endpoint_name")

    @endpoint_name.setter
    def endpoint_name(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "endpoint_name", value)

    @property
    @pulumi.getter(name="endpointType")
    def endpoint_type(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        终端类型：Cluster：默认终端（默认创建）。Custom：自定义终端。
        """
        return pulumi.get(self, "endpoint_type")

    @endpoint_type.setter
    def endpoint_type(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "endpoint_type", value)

    @property
    @pulumi.getter(name="instanceId")
    def instance_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        实例 ID。
        """
        return pulumi.get(self, "instance_id")

    @instance_id.setter
    def instance_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "instance_id", value)

    @property
    @pulumi.getter
    def nodes(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        连接终端配置的节点列表。说明当 EndpointType 为 Custom 时必选。主节点无需传节点 ID，传入 Primary 字符串即可。
        """
        return pulumi.get(self, "nodes")

    @nodes.setter
    def nodes(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "nodes", value)

    @property
    @pulumi.getter(name="readOnlyNodeDistributionType")
    def read_only_node_distribution_type(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        只读权重分配模式。取值：Default：标准权重分配（默认值）。Custom：自定义权重分配。
        """
        return pulumi.get(self, "read_only_node_distribution_type")

    @read_only_node_distribution_type.setter
    def read_only_node_distribution_type(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "read_only_node_distribution_type", value)

    @property
    @pulumi.getter(name="readOnlyNodeMaxDelayTime")
    def read_only_node_max_delay_time(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        只读节点的最大延迟阈值，当只读节点延迟时间超过该值时，读取流量不发往该节点，单位：秒。取值：0~3600。默认值：30。说明支持对开通了读写分离的默认终端设置此参数。
        """
        return pulumi.get(self, "read_only_node_max_delay_time")

    @read_only_node_max_delay_time.setter
    def read_only_node_max_delay_time(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "read_only_node_max_delay_time", value)

    @property
    @pulumi.getter(name="readOnlyNodeWeights")
    def read_only_node_weights(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DbEndpointReadOnlyNodeWeightArgs']]]]:
        return pulumi.get(self, "read_only_node_weights")

    @read_only_node_weights.setter
    def read_only_node_weights(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DbEndpointReadOnlyNodeWeightArgs']]]]):
        pulumi.set(self, "read_only_node_weights", value)

    @property
    @pulumi.getter(name="readWriteMode")
    def read_write_mode(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        读写模式：ReadWrite：读写。ReadOnly：只读。
        """
        return pulumi.get(self, "read_write_mode")

    @read_write_mode.setter
    def read_write_mode(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "read_write_mode", value)

    @property
    @pulumi.getter(name="readWriteProxyConnection")
    def read_write_proxy_connection(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        终端开启读写分离后，为终端设置的代理连接数。代理连接数的取值下限为 20。代理连接数的取值上限取决于实例主节点的规格，不同规格支持的代理连接数上限不同，详细信息请参见产品规格。
        """
        return pulumi.get(self, "read_write_proxy_connection")

    @read_write_proxy_connection.setter
    def read_write_proxy_connection(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "read_write_proxy_connection", value)

    @property
    @pulumi.getter(name="writeNodeHaltWriting")
    def write_node_halt_writing(self) -> Optional[pulumi.Input[builtins.bool]]:
        """
        终端是否将写请求发送给写节点（目前仅主节点为写节点）。取值：true：是。默认值。false：否。
        """
        return pulumi.get(self, "write_node_halt_writing")

    @write_node_halt_writing.setter
    def write_node_halt_writing(self, value: Optional[pulumi.Input[builtins.bool]]):
        pulumi.set(self, "write_node_halt_writing", value)


@pulumi.input_type
class _DbEndpointState:
    def __init__(__self__, *,
                 addresses: Optional[pulumi.Input[Sequence[pulumi.Input['DbEndpointAddressArgs']]]] = None,
                 auto_add_new_nodes: Optional[pulumi.Input[builtins.str]] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 enable_read_only: Optional[pulumi.Input[builtins.str]] = None,
                 enable_read_write_splitting: Optional[pulumi.Input[builtins.str]] = None,
                 endpoint_id: Optional[pulumi.Input[builtins.str]] = None,
                 endpoint_name: Optional[pulumi.Input[builtins.str]] = None,
                 endpoint_type: Optional[pulumi.Input[builtins.str]] = None,
                 instance_id: Optional[pulumi.Input[builtins.str]] = None,
                 nodes: Optional[pulumi.Input[builtins.str]] = None,
                 read_only_node_distribution_type: Optional[pulumi.Input[builtins.str]] = None,
                 read_only_node_max_delay_time: Optional[pulumi.Input[builtins.int]] = None,
                 read_only_node_weights: Optional[pulumi.Input[Sequence[pulumi.Input['DbEndpointReadOnlyNodeWeightArgs']]]] = None,
                 read_write_mode: Optional[pulumi.Input[builtins.str]] = None,
                 read_write_proxy_connection: Optional[pulumi.Input[builtins.int]] = None,
                 write_node_halt_writing: Optional[pulumi.Input[builtins.bool]] = None):
        """
        Input properties used for looking up and filtering DbEndpoint resources.
        :param pulumi.Input[builtins.str] auto_add_new_nodes: 当终端类型为读写终端或只读终端时，支持设置新节点是否自动加入。取值：Enable：自动加入。Disable：不自动加入（默认）。
        :param pulumi.Input[builtins.str] description: 地址描述。
        :param pulumi.Input[builtins.str] enable_read_only: 是否已开启全局只读。Enable：开启。Disable：未开启。
        :param pulumi.Input[builtins.str] enable_read_write_splitting: 是否已开启读写分离，取值：Enable：开启。Disable：未开启。
        :param pulumi.Input[builtins.str] endpoint_id: 实例连接终端 ID。
        :param pulumi.Input[builtins.str] endpoint_name: 实例连接终端名称。
        :param pulumi.Input[builtins.str] endpoint_type: 终端类型：Cluster：默认终端（默认创建）。Custom：自定义终端。
        :param pulumi.Input[builtins.str] instance_id: 实例 ID。
        :param pulumi.Input[builtins.str] nodes: 连接终端配置的节点列表。说明当 EndpointType 为 Custom 时必选。主节点无需传节点 ID，传入 Primary 字符串即可。
        :param pulumi.Input[builtins.str] read_only_node_distribution_type: 只读权重分配模式。取值：Default：标准权重分配（默认值）。Custom：自定义权重分配。
        :param pulumi.Input[builtins.int] read_only_node_max_delay_time: 只读节点的最大延迟阈值，当只读节点延迟时间超过该值时，读取流量不发往该节点，单位：秒。取值：0~3600。默认值：30。说明支持对开通了读写分离的默认终端设置此参数。
        :param pulumi.Input[builtins.str] read_write_mode: 读写模式：ReadWrite：读写。ReadOnly：只读。
        :param pulumi.Input[builtins.int] read_write_proxy_connection: 终端开启读写分离后，为终端设置的代理连接数。代理连接数的取值下限为 20。代理连接数的取值上限取决于实例主节点的规格，不同规格支持的代理连接数上限不同，详细信息请参见产品规格。
        :param pulumi.Input[builtins.bool] write_node_halt_writing: 终端是否将写请求发送给写节点（目前仅主节点为写节点）。取值：true：是。默认值。false：否。
        """
        if addresses is not None:
            pulumi.set(__self__, "addresses", addresses)
        if auto_add_new_nodes is not None:
            pulumi.set(__self__, "auto_add_new_nodes", auto_add_new_nodes)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if enable_read_only is not None:
            pulumi.set(__self__, "enable_read_only", enable_read_only)
        if enable_read_write_splitting is not None:
            pulumi.set(__self__, "enable_read_write_splitting", enable_read_write_splitting)
        if endpoint_id is not None:
            pulumi.set(__self__, "endpoint_id", endpoint_id)
        if endpoint_name is not None:
            pulumi.set(__self__, "endpoint_name", endpoint_name)
        if endpoint_type is not None:
            pulumi.set(__self__, "endpoint_type", endpoint_type)
        if instance_id is not None:
            pulumi.set(__self__, "instance_id", instance_id)
        if nodes is not None:
            pulumi.set(__self__, "nodes", nodes)
        if read_only_node_distribution_type is not None:
            pulumi.set(__self__, "read_only_node_distribution_type", read_only_node_distribution_type)
        if read_only_node_max_delay_time is not None:
            pulumi.set(__self__, "read_only_node_max_delay_time", read_only_node_max_delay_time)
        if read_only_node_weights is not None:
            pulumi.set(__self__, "read_only_node_weights", read_only_node_weights)
        if read_write_mode is not None:
            pulumi.set(__self__, "read_write_mode", read_write_mode)
        if read_write_proxy_connection is not None:
            pulumi.set(__self__, "read_write_proxy_connection", read_write_proxy_connection)
        if write_node_halt_writing is not None:
            pulumi.set(__self__, "write_node_halt_writing", write_node_halt_writing)

    @property
    @pulumi.getter
    def addresses(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DbEndpointAddressArgs']]]]:
        return pulumi.get(self, "addresses")

    @addresses.setter
    def addresses(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DbEndpointAddressArgs']]]]):
        pulumi.set(self, "addresses", value)

    @property
    @pulumi.getter(name="autoAddNewNodes")
    def auto_add_new_nodes(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        当终端类型为读写终端或只读终端时，支持设置新节点是否自动加入。取值：Enable：自动加入。Disable：不自动加入（默认）。
        """
        return pulumi.get(self, "auto_add_new_nodes")

    @auto_add_new_nodes.setter
    def auto_add_new_nodes(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "auto_add_new_nodes", value)

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        地址描述。
        """
        return pulumi.get(self, "description")

    @description.setter
    def description(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "description", value)

    @property
    @pulumi.getter(name="enableReadOnly")
    def enable_read_only(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        是否已开启全局只读。Enable：开启。Disable：未开启。
        """
        return pulumi.get(self, "enable_read_only")

    @enable_read_only.setter
    def enable_read_only(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "enable_read_only", value)

    @property
    @pulumi.getter(name="enableReadWriteSplitting")
    def enable_read_write_splitting(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        是否已开启读写分离，取值：Enable：开启。Disable：未开启。
        """
        return pulumi.get(self, "enable_read_write_splitting")

    @enable_read_write_splitting.setter
    def enable_read_write_splitting(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "enable_read_write_splitting", value)

    @property
    @pulumi.getter(name="endpointId")
    def endpoint_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        实例连接终端 ID。
        """
        return pulumi.get(self, "endpoint_id")

    @endpoint_id.setter
    def endpoint_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "endpoint_id", value)

    @property
    @pulumi.getter(name="endpointName")
    def endpoint_name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        实例连接终端名称。
        """
        return pulumi.get(self, "endpoint_name")

    @endpoint_name.setter
    def endpoint_name(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "endpoint_name", value)

    @property
    @pulumi.getter(name="endpointType")
    def endpoint_type(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        终端类型：Cluster：默认终端（默认创建）。Custom：自定义终端。
        """
        return pulumi.get(self, "endpoint_type")

    @endpoint_type.setter
    def endpoint_type(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "endpoint_type", value)

    @property
    @pulumi.getter(name="instanceId")
    def instance_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        实例 ID。
        """
        return pulumi.get(self, "instance_id")

    @instance_id.setter
    def instance_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "instance_id", value)

    @property
    @pulumi.getter
    def nodes(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        连接终端配置的节点列表。说明当 EndpointType 为 Custom 时必选。主节点无需传节点 ID，传入 Primary 字符串即可。
        """
        return pulumi.get(self, "nodes")

    @nodes.setter
    def nodes(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "nodes", value)

    @property
    @pulumi.getter(name="readOnlyNodeDistributionType")
    def read_only_node_distribution_type(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        只读权重分配模式。取值：Default：标准权重分配（默认值）。Custom：自定义权重分配。
        """
        return pulumi.get(self, "read_only_node_distribution_type")

    @read_only_node_distribution_type.setter
    def read_only_node_distribution_type(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "read_only_node_distribution_type", value)

    @property
    @pulumi.getter(name="readOnlyNodeMaxDelayTime")
    def read_only_node_max_delay_time(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        只读节点的最大延迟阈值，当只读节点延迟时间超过该值时，读取流量不发往该节点，单位：秒。取值：0~3600。默认值：30。说明支持对开通了读写分离的默认终端设置此参数。
        """
        return pulumi.get(self, "read_only_node_max_delay_time")

    @read_only_node_max_delay_time.setter
    def read_only_node_max_delay_time(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "read_only_node_max_delay_time", value)

    @property
    @pulumi.getter(name="readOnlyNodeWeights")
    def read_only_node_weights(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DbEndpointReadOnlyNodeWeightArgs']]]]:
        return pulumi.get(self, "read_only_node_weights")

    @read_only_node_weights.setter
    def read_only_node_weights(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DbEndpointReadOnlyNodeWeightArgs']]]]):
        pulumi.set(self, "read_only_node_weights", value)

    @property
    @pulumi.getter(name="readWriteMode")
    def read_write_mode(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        读写模式：ReadWrite：读写。ReadOnly：只读。
        """
        return pulumi.get(self, "read_write_mode")

    @read_write_mode.setter
    def read_write_mode(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "read_write_mode", value)

    @property
    @pulumi.getter(name="readWriteProxyConnection")
    def read_write_proxy_connection(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        终端开启读写分离后，为终端设置的代理连接数。代理连接数的取值下限为 20。代理连接数的取值上限取决于实例主节点的规格，不同规格支持的代理连接数上限不同，详细信息请参见产品规格。
        """
        return pulumi.get(self, "read_write_proxy_connection")

    @read_write_proxy_connection.setter
    def read_write_proxy_connection(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "read_write_proxy_connection", value)

    @property
    @pulumi.getter(name="writeNodeHaltWriting")
    def write_node_halt_writing(self) -> Optional[pulumi.Input[builtins.bool]]:
        """
        终端是否将写请求发送给写节点（目前仅主节点为写节点）。取值：true：是。默认值。false：否。
        """
        return pulumi.get(self, "write_node_halt_writing")

    @write_node_halt_writing.setter
    def write_node_halt_writing(self, value: Optional[pulumi.Input[builtins.bool]]):
        pulumi.set(self, "write_node_halt_writing", value)


@pulumi.type_token("bytepluscc:rdspostgresql/dbEndpoint:DbEndpoint")
class DbEndpoint(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 addresses: Optional[pulumi.Input[Sequence[pulumi.Input[Union['DbEndpointAddressArgs', 'DbEndpointAddressArgsDict']]]]] = None,
                 enable_read_write_splitting: Optional[pulumi.Input[builtins.str]] = None,
                 endpoint_name: Optional[pulumi.Input[builtins.str]] = None,
                 endpoint_type: Optional[pulumi.Input[builtins.str]] = None,
                 instance_id: Optional[pulumi.Input[builtins.str]] = None,
                 nodes: Optional[pulumi.Input[builtins.str]] = None,
                 read_only_node_distribution_type: Optional[pulumi.Input[builtins.str]] = None,
                 read_only_node_max_delay_time: Optional[pulumi.Input[builtins.int]] = None,
                 read_only_node_weights: Optional[pulumi.Input[Sequence[pulumi.Input[Union['DbEndpointReadOnlyNodeWeightArgs', 'DbEndpointReadOnlyNodeWeightArgsDict']]]]] = None,
                 read_write_mode: Optional[pulumi.Input[builtins.str]] = None,
                 read_write_proxy_connection: Optional[pulumi.Input[builtins.int]] = None,
                 write_node_halt_writing: Optional[pulumi.Input[builtins.bool]] = None,
                 __props__=None):
        """
        连接终端是位于数据库和应用程序之间的网络代理服务，用于代理应用程序访问数据库时的所有请求，具有高可用、高性能、可运维、简单易用等特点，支持读写分离和负载均衡等高级功能。云数据库 PostgreSQL 版提供了默认终端和自定义只读终端两种类型。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        rds_postgresql_db_endpoint_demo = bytepluscc.rdspostgresql.DbEndpoint("RdsPostgresqlDbEndpointDemo",
            endpoint_name="ccapi-test-1",
            endpoint_type="Custom",
            instance_id="postgres-9dxxxxxd",
            nodes="Primary",
            read_write_mode="ReadWrite")
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:rdspostgresql/dbEndpoint:DbEndpoint example "instance_id|endpoint_id"
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] enable_read_write_splitting: 是否已开启读写分离，取值：Enable：开启。Disable：未开启。
        :param pulumi.Input[builtins.str] endpoint_name: 实例连接终端名称。
        :param pulumi.Input[builtins.str] endpoint_type: 终端类型：Cluster：默认终端（默认创建）。Custom：自定义终端。
        :param pulumi.Input[builtins.str] instance_id: 实例 ID。
        :param pulumi.Input[builtins.str] nodes: 连接终端配置的节点列表。说明当 EndpointType 为 Custom 时必选。主节点无需传节点 ID，传入 Primary 字符串即可。
        :param pulumi.Input[builtins.str] read_only_node_distribution_type: 只读权重分配模式。取值：Default：标准权重分配（默认值）。Custom：自定义权重分配。
        :param pulumi.Input[builtins.int] read_only_node_max_delay_time: 只读节点的最大延迟阈值，当只读节点延迟时间超过该值时，读取流量不发往该节点，单位：秒。取值：0~3600。默认值：30。说明支持对开通了读写分离的默认终端设置此参数。
        :param pulumi.Input[builtins.str] read_write_mode: 读写模式：ReadWrite：读写。ReadOnly：只读。
        :param pulumi.Input[builtins.int] read_write_proxy_connection: 终端开启读写分离后，为终端设置的代理连接数。代理连接数的取值下限为 20。代理连接数的取值上限取决于实例主节点的规格，不同规格支持的代理连接数上限不同，详细信息请参见产品规格。
        :param pulumi.Input[builtins.bool] write_node_halt_writing: 终端是否将写请求发送给写节点（目前仅主节点为写节点）。取值：true：是。默认值。false：否。
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: Optional[DbEndpointArgs] = None,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        连接终端是位于数据库和应用程序之间的网络代理服务，用于代理应用程序访问数据库时的所有请求，具有高可用、高性能、可运维、简单易用等特点，支持读写分离和负载均衡等高级功能。云数据库 PostgreSQL 版提供了默认终端和自定义只读终端两种类型。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        rds_postgresql_db_endpoint_demo = bytepluscc.rdspostgresql.DbEndpoint("RdsPostgresqlDbEndpointDemo",
            endpoint_name="ccapi-test-1",
            endpoint_type="Custom",
            instance_id="postgres-9dxxxxxd",
            nodes="Primary",
            read_write_mode="ReadWrite")
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:rdspostgresql/dbEndpoint:DbEndpoint example "instance_id|endpoint_id"
        ```

        :param str resource_name: The name of the resource.
        :param DbEndpointArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(DbEndpointArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 addresses: Optional[pulumi.Input[Sequence[pulumi.Input[Union['DbEndpointAddressArgs', 'DbEndpointAddressArgsDict']]]]] = None,
                 enable_read_write_splitting: Optional[pulumi.Input[builtins.str]] = None,
                 endpoint_name: Optional[pulumi.Input[builtins.str]] = None,
                 endpoint_type: Optional[pulumi.Input[builtins.str]] = None,
                 instance_id: Optional[pulumi.Input[builtins.str]] = None,
                 nodes: Optional[pulumi.Input[builtins.str]] = None,
                 read_only_node_distribution_type: Optional[pulumi.Input[builtins.str]] = None,
                 read_only_node_max_delay_time: Optional[pulumi.Input[builtins.int]] = None,
                 read_only_node_weights: Optional[pulumi.Input[Sequence[pulumi.Input[Union['DbEndpointReadOnlyNodeWeightArgs', 'DbEndpointReadOnlyNodeWeightArgsDict']]]]] = None,
                 read_write_mode: Optional[pulumi.Input[builtins.str]] = None,
                 read_write_proxy_connection: Optional[pulumi.Input[builtins.int]] = None,
                 write_node_halt_writing: Optional[pulumi.Input[builtins.bool]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = DbEndpointArgs.__new__(DbEndpointArgs)

            __props__.__dict__["addresses"] = addresses
            __props__.__dict__["enable_read_write_splitting"] = enable_read_write_splitting
            __props__.__dict__["endpoint_name"] = endpoint_name
            __props__.__dict__["endpoint_type"] = endpoint_type
            __props__.__dict__["instance_id"] = instance_id
            __props__.__dict__["nodes"] = nodes
            __props__.__dict__["read_only_node_distribution_type"] = read_only_node_distribution_type
            __props__.__dict__["read_only_node_max_delay_time"] = read_only_node_max_delay_time
            __props__.__dict__["read_only_node_weights"] = read_only_node_weights
            __props__.__dict__["read_write_mode"] = read_write_mode
            __props__.__dict__["read_write_proxy_connection"] = read_write_proxy_connection
            __props__.__dict__["write_node_halt_writing"] = write_node_halt_writing
            __props__.__dict__["auto_add_new_nodes"] = None
            __props__.__dict__["description"] = None
            __props__.__dict__["enable_read_only"] = None
            __props__.__dict__["endpoint_id"] = None
        super(DbEndpoint, __self__).__init__(
            'bytepluscc:rdspostgresql/dbEndpoint:DbEndpoint',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            addresses: Optional[pulumi.Input[Sequence[pulumi.Input[Union['DbEndpointAddressArgs', 'DbEndpointAddressArgsDict']]]]] = None,
            auto_add_new_nodes: Optional[pulumi.Input[builtins.str]] = None,
            description: Optional[pulumi.Input[builtins.str]] = None,
            enable_read_only: Optional[pulumi.Input[builtins.str]] = None,
            enable_read_write_splitting: Optional[pulumi.Input[builtins.str]] = None,
            endpoint_id: Optional[pulumi.Input[builtins.str]] = None,
            endpoint_name: Optional[pulumi.Input[builtins.str]] = None,
            endpoint_type: Optional[pulumi.Input[builtins.str]] = None,
            instance_id: Optional[pulumi.Input[builtins.str]] = None,
            nodes: Optional[pulumi.Input[builtins.str]] = None,
            read_only_node_distribution_type: Optional[pulumi.Input[builtins.str]] = None,
            read_only_node_max_delay_time: Optional[pulumi.Input[builtins.int]] = None,
            read_only_node_weights: Optional[pulumi.Input[Sequence[pulumi.Input[Union['DbEndpointReadOnlyNodeWeightArgs', 'DbEndpointReadOnlyNodeWeightArgsDict']]]]] = None,
            read_write_mode: Optional[pulumi.Input[builtins.str]] = None,
            read_write_proxy_connection: Optional[pulumi.Input[builtins.int]] = None,
            write_node_halt_writing: Optional[pulumi.Input[builtins.bool]] = None) -> 'DbEndpoint':
        """
        Get an existing DbEndpoint resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] auto_add_new_nodes: 当终端类型为读写终端或只读终端时，支持设置新节点是否自动加入。取值：Enable：自动加入。Disable：不自动加入（默认）。
        :param pulumi.Input[builtins.str] description: 地址描述。
        :param pulumi.Input[builtins.str] enable_read_only: 是否已开启全局只读。Enable：开启。Disable：未开启。
        :param pulumi.Input[builtins.str] enable_read_write_splitting: 是否已开启读写分离，取值：Enable：开启。Disable：未开启。
        :param pulumi.Input[builtins.str] endpoint_id: 实例连接终端 ID。
        :param pulumi.Input[builtins.str] endpoint_name: 实例连接终端名称。
        :param pulumi.Input[builtins.str] endpoint_type: 终端类型：Cluster：默认终端（默认创建）。Custom：自定义终端。
        :param pulumi.Input[builtins.str] instance_id: 实例 ID。
        :param pulumi.Input[builtins.str] nodes: 连接终端配置的节点列表。说明当 EndpointType 为 Custom 时必选。主节点无需传节点 ID，传入 Primary 字符串即可。
        :param pulumi.Input[builtins.str] read_only_node_distribution_type: 只读权重分配模式。取值：Default：标准权重分配（默认值）。Custom：自定义权重分配。
        :param pulumi.Input[builtins.int] read_only_node_max_delay_time: 只读节点的最大延迟阈值，当只读节点延迟时间超过该值时，读取流量不发往该节点，单位：秒。取值：0~3600。默认值：30。说明支持对开通了读写分离的默认终端设置此参数。
        :param pulumi.Input[builtins.str] read_write_mode: 读写模式：ReadWrite：读写。ReadOnly：只读。
        :param pulumi.Input[builtins.int] read_write_proxy_connection: 终端开启读写分离后，为终端设置的代理连接数。代理连接数的取值下限为 20。代理连接数的取值上限取决于实例主节点的规格，不同规格支持的代理连接数上限不同，详细信息请参见产品规格。
        :param pulumi.Input[builtins.bool] write_node_halt_writing: 终端是否将写请求发送给写节点（目前仅主节点为写节点）。取值：true：是。默认值。false：否。
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _DbEndpointState.__new__(_DbEndpointState)

        __props__.__dict__["addresses"] = addresses
        __props__.__dict__["auto_add_new_nodes"] = auto_add_new_nodes
        __props__.__dict__["description"] = description
        __props__.__dict__["enable_read_only"] = enable_read_only
        __props__.__dict__["enable_read_write_splitting"] = enable_read_write_splitting
        __props__.__dict__["endpoint_id"] = endpoint_id
        __props__.__dict__["endpoint_name"] = endpoint_name
        __props__.__dict__["endpoint_type"] = endpoint_type
        __props__.__dict__["instance_id"] = instance_id
        __props__.__dict__["nodes"] = nodes
        __props__.__dict__["read_only_node_distribution_type"] = read_only_node_distribution_type
        __props__.__dict__["read_only_node_max_delay_time"] = read_only_node_max_delay_time
        __props__.__dict__["read_only_node_weights"] = read_only_node_weights
        __props__.__dict__["read_write_mode"] = read_write_mode
        __props__.__dict__["read_write_proxy_connection"] = read_write_proxy_connection
        __props__.__dict__["write_node_halt_writing"] = write_node_halt_writing
        return DbEndpoint(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def addresses(self) -> pulumi.Output[Sequence['outputs.DbEndpointAddress']]:
        return pulumi.get(self, "addresses")

    @property
    @pulumi.getter(name="autoAddNewNodes")
    def auto_add_new_nodes(self) -> pulumi.Output[builtins.str]:
        """
        当终端类型为读写终端或只读终端时，支持设置新节点是否自动加入。取值：Enable：自动加入。Disable：不自动加入（默认）。
        """
        return pulumi.get(self, "auto_add_new_nodes")

    @property
    @pulumi.getter
    def description(self) -> pulumi.Output[builtins.str]:
        """
        地址描述。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="enableReadOnly")
    def enable_read_only(self) -> pulumi.Output[builtins.str]:
        """
        是否已开启全局只读。Enable：开启。Disable：未开启。
        """
        return pulumi.get(self, "enable_read_only")

    @property
    @pulumi.getter(name="enableReadWriteSplitting")
    def enable_read_write_splitting(self) -> pulumi.Output[builtins.str]:
        """
        是否已开启读写分离，取值：Enable：开启。Disable：未开启。
        """
        return pulumi.get(self, "enable_read_write_splitting")

    @property
    @pulumi.getter(name="endpointId")
    def endpoint_id(self) -> pulumi.Output[builtins.str]:
        """
        实例连接终端 ID。
        """
        return pulumi.get(self, "endpoint_id")

    @property
    @pulumi.getter(name="endpointName")
    def endpoint_name(self) -> pulumi.Output[builtins.str]:
        """
        实例连接终端名称。
        """
        return pulumi.get(self, "endpoint_name")

    @property
    @pulumi.getter(name="endpointType")
    def endpoint_type(self) -> pulumi.Output[builtins.str]:
        """
        终端类型：Cluster：默认终端（默认创建）。Custom：自定义终端。
        """
        return pulumi.get(self, "endpoint_type")

    @property
    @pulumi.getter(name="instanceId")
    def instance_id(self) -> pulumi.Output[builtins.str]:
        """
        实例 ID。
        """
        return pulumi.get(self, "instance_id")

    @property
    @pulumi.getter
    def nodes(self) -> pulumi.Output[builtins.str]:
        """
        连接终端配置的节点列表。说明当 EndpointType 为 Custom 时必选。主节点无需传节点 ID，传入 Primary 字符串即可。
        """
        return pulumi.get(self, "nodes")

    @property
    @pulumi.getter(name="readOnlyNodeDistributionType")
    def read_only_node_distribution_type(self) -> pulumi.Output[builtins.str]:
        """
        只读权重分配模式。取值：Default：标准权重分配（默认值）。Custom：自定义权重分配。
        """
        return pulumi.get(self, "read_only_node_distribution_type")

    @property
    @pulumi.getter(name="readOnlyNodeMaxDelayTime")
    def read_only_node_max_delay_time(self) -> pulumi.Output[builtins.int]:
        """
        只读节点的最大延迟阈值，当只读节点延迟时间超过该值时，读取流量不发往该节点，单位：秒。取值：0~3600。默认值：30。说明支持对开通了读写分离的默认终端设置此参数。
        """
        return pulumi.get(self, "read_only_node_max_delay_time")

    @property
    @pulumi.getter(name="readOnlyNodeWeights")
    def read_only_node_weights(self) -> pulumi.Output[Sequence['outputs.DbEndpointReadOnlyNodeWeight']]:
        return pulumi.get(self, "read_only_node_weights")

    @property
    @pulumi.getter(name="readWriteMode")
    def read_write_mode(self) -> pulumi.Output[builtins.str]:
        """
        读写模式：ReadWrite：读写。ReadOnly：只读。
        """
        return pulumi.get(self, "read_write_mode")

    @property
    @pulumi.getter(name="readWriteProxyConnection")
    def read_write_proxy_connection(self) -> pulumi.Output[builtins.int]:
        """
        终端开启读写分离后，为终端设置的代理连接数。代理连接数的取值下限为 20。代理连接数的取值上限取决于实例主节点的规格，不同规格支持的代理连接数上限不同，详细信息请参见产品规格。
        """
        return pulumi.get(self, "read_write_proxy_connection")

    @property
    @pulumi.getter(name="writeNodeHaltWriting")
    def write_node_halt_writing(self) -> pulumi.Output[builtins.bool]:
        """
        终端是否将写请求发送给写节点（目前仅主节点为写节点）。取值：true：是。默认值。false：否。
        """
        return pulumi.get(self, "write_node_halt_writing")

