# 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

__all__ = [
    'GetEndpointPublicAddressResult',
    'AwaitableGetEndpointPublicAddressResult',
    'get_endpoint_public_address',
    'get_endpoint_public_address_output',
]

@pulumi.output_type
class GetEndpointPublicAddressResult:
    """
    A collection of values returned by getEndpointPublicAddress.
    """
    def __init__(__self__, addr_type=None, address=None, eip_id=None, id=None, instance_id=None, new_address_prefix=None, port=None, upgrade_region_domain=None, vi_pv6=None, vip=None):
        if addr_type and not isinstance(addr_type, str):
            raise TypeError("Expected argument 'addr_type' to be a str")
        pulumi.set(__self__, "addr_type", addr_type)
        if address and not isinstance(address, str):
            raise TypeError("Expected argument 'address' to be a str")
        pulumi.set(__self__, "address", address)
        if eip_id and not isinstance(eip_id, str):
            raise TypeError("Expected argument 'eip_id' to be a str")
        pulumi.set(__self__, "eip_id", eip_id)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if instance_id and not isinstance(instance_id, str):
            raise TypeError("Expected argument 'instance_id' to be a str")
        pulumi.set(__self__, "instance_id", instance_id)
        if new_address_prefix and not isinstance(new_address_prefix, str):
            raise TypeError("Expected argument 'new_address_prefix' to be a str")
        pulumi.set(__self__, "new_address_prefix", new_address_prefix)
        if port and not isinstance(port, int):
            raise TypeError("Expected argument 'port' to be a int")
        pulumi.set(__self__, "port", port)
        if upgrade_region_domain and not isinstance(upgrade_region_domain, bool):
            raise TypeError("Expected argument 'upgrade_region_domain' to be a bool")
        pulumi.set(__self__, "upgrade_region_domain", upgrade_region_domain)
        if vi_pv6 and not isinstance(vi_pv6, str):
            raise TypeError("Expected argument 'vi_pv6' to be a str")
        pulumi.set(__self__, "vi_pv6", vi_pv6)
        if vip and not isinstance(vip, str):
            raise TypeError("Expected argument 'vip' to be a str")
        pulumi.set(__self__, "vip", vip)

    @property
    @pulumi.getter(name="addrType")
    def addr_type(self) -> builtins.str:
        """
        连接地址类型，取值范围如下：Private：私网连接地址。Public：公网连接地址。DirectLink：直连地址。说明仅启用分片集群的 Redis 实例申请了直连地址后，才会返回直连地址信息。关于连接地址的更多信息，请参见连接地址类型。
        """
        return pulumi.get(self, "addr_type")

    @property
    @pulumi.getter
    def address(self) -> builtins.str:
        """
        IP 地址或者域名。
        """
        return pulumi.get(self, "address")

    @property
    @pulumi.getter(name="eipId")
    def eip_id(self) -> builtins.str:
        """
        弹性公网 IP 的 ID。
        """
        return pulumi.get(self, "eip_id")

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

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

    @property
    @pulumi.getter(name="newAddressPrefix")
    def new_address_prefix(self) -> builtins.str:
        """
        修改后的连接地址前缀。连接地址前缀需同时满足如下要求：由小写字母、数字或连字符（-）组成。以字母开头，字母或数字结尾。长度为 8~53 个字符。修改后的连接地址需要保证全局唯一，不可以与火山引擎中任何地域下的任何连接地址重名。
        """
        return pulumi.get(self, "new_address_prefix")

    @property
    @pulumi.getter
    def port(self) -> builtins.int:
        """
        端口号。
        """
        return pulumi.get(self, "port")

    @property
    @pulumi.getter(name="upgradeRegionDomain")
    def upgrade_region_domain(self) -> builtins.bool:
        """
        是否升级连接地址的域名后缀。取值范围如下：true：升级。false（默认值）：不升级。注意当需要升级域名后缀（即 UpgradeRegionDomain 为 true）时，必须同时传入连接地址前缀信息（即 Address 参数不允许为空。）升级域名后缀后，原有的连接会断开，请及时修改客户端的连接信息，使用新的连接地址来连接实例。连接实例的具体方法，请参见连接实例。连接地址域名后缀升级后不支持再降级回原来的后缀，请谨慎操作。升级后的连接地址域名后缀会自动包含实例所属地域信息，旧的连接地址会保留 12 小时，12 小时保留期到期后会被自动释放。更多详情，请参见升级域名后缀。
        """
        return pulumi.get(self, "upgrade_region_domain")

    @property
    @pulumi.getter(name="viPv6")
    def vi_pv6(self) -> builtins.str:
        """
        连接地址所对应的 IPv6 地址。说明仅当实例使用了 IPv6 地址时才会返回该参数。仅私网地址和直连地址支持 IPv6 地址，公网地址不支持，因此当连接地址类型为公网地址（即 AddrType 为 Public）时，该参数值固定为空。
        """
        return pulumi.get(self, "vi_pv6")

    @property
    @pulumi.getter
    def vip(self) -> builtins.str:
        """
        连接地址所对应的 IPv4 地址。
        """
        return pulumi.get(self, "vip")


class AwaitableGetEndpointPublicAddressResult(GetEndpointPublicAddressResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetEndpointPublicAddressResult(
            addr_type=self.addr_type,
            address=self.address,
            eip_id=self.eip_id,
            id=self.id,
            instance_id=self.instance_id,
            new_address_prefix=self.new_address_prefix,
            port=self.port,
            upgrade_region_domain=self.upgrade_region_domain,
            vi_pv6=self.vi_pv6,
            vip=self.vip)


def get_endpoint_public_address(id: Optional[builtins.str] = None,
                                opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetEndpointPublicAddressResult:
    """
    Data Source schema for Byteplus::Redis::EndpointPublicAddress


    :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:redis/getEndpointPublicAddress:getEndpointPublicAddress', __args__, opts=opts, typ=GetEndpointPublicAddressResult).value

    return AwaitableGetEndpointPublicAddressResult(
        addr_type=pulumi.get(__ret__, 'addr_type'),
        address=pulumi.get(__ret__, 'address'),
        eip_id=pulumi.get(__ret__, 'eip_id'),
        id=pulumi.get(__ret__, 'id'),
        instance_id=pulumi.get(__ret__, 'instance_id'),
        new_address_prefix=pulumi.get(__ret__, 'new_address_prefix'),
        port=pulumi.get(__ret__, 'port'),
        upgrade_region_domain=pulumi.get(__ret__, 'upgrade_region_domain'),
        vi_pv6=pulumi.get(__ret__, 'vi_pv6'),
        vip=pulumi.get(__ret__, 'vip'))
def get_endpoint_public_address_output(id: Optional[pulumi.Input[builtins.str]] = None,
                                       opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetEndpointPublicAddressResult]:
    """
    Data Source schema for Byteplus::Redis::EndpointPublicAddress


    :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:redis/getEndpointPublicAddress:getEndpointPublicAddress', __args__, opts=opts, typ=GetEndpointPublicAddressResult)
    return __ret__.apply(lambda __response__: GetEndpointPublicAddressResult(
        addr_type=pulumi.get(__response__, 'addr_type'),
        address=pulumi.get(__response__, 'address'),
        eip_id=pulumi.get(__response__, 'eip_id'),
        id=pulumi.get(__response__, 'id'),
        instance_id=pulumi.get(__response__, 'instance_id'),
        new_address_prefix=pulumi.get(__response__, 'new_address_prefix'),
        port=pulumi.get(__response__, 'port'),
        upgrade_region_domain=pulumi.get(__response__, 'upgrade_region_domain'),
        vi_pv6=pulumi.get(__response__, 'vi_pv6'),
        vip=pulumi.get(__response__, 'vip')))
