# 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__ = [
    'GetResolverRuleResult',
    'AwaitableGetResolverRuleResult',
    'get_resolver_rule',
    'get_resolver_rule_output',
]

@pulumi.output_type
class GetResolverRuleResult:
    """
    A collection of values returned by getResolverRule.
    """
    def __init__(__self__, created_time=None, enable=None, endpoint_id=None, forward_ips=None, id=None, last_operator=None, line=None, name=None, project_name=None, rule_id=None, tags=None, type=None, updated_time=None, vp_cs=None, zone_name=None):
        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 enable and not isinstance(enable, bool):
            raise TypeError("Expected argument 'enable' to be a bool")
        pulumi.set(__self__, "enable", enable)
        if endpoint_id and not isinstance(endpoint_id, int):
            raise TypeError("Expected argument 'endpoint_id' to be a int")
        pulumi.set(__self__, "endpoint_id", endpoint_id)
        if forward_ips and not isinstance(forward_ips, list):
            raise TypeError("Expected argument 'forward_ips' to be a list")
        pulumi.set(__self__, "forward_ips", forward_ips)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if last_operator and not isinstance(last_operator, str):
            raise TypeError("Expected argument 'last_operator' to be a str")
        pulumi.set(__self__, "last_operator", last_operator)
        if line and not isinstance(line, str):
            raise TypeError("Expected argument 'line' to be a str")
        pulumi.set(__self__, "line", line)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        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 rule_id and not isinstance(rule_id, str):
            raise TypeError("Expected argument 'rule_id' to be a str")
        pulumi.set(__self__, "rule_id", rule_id)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        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 vp_cs and not isinstance(vp_cs, list):
            raise TypeError("Expected argument 'vp_cs' to be a list")
        pulumi.set(__self__, "vp_cs", vp_cs)
        if zone_name and not isinstance(zone_name, str):
            raise TypeError("Expected argument 'zone_name' to be a str")
        pulumi.set(__self__, "zone_name", zone_name)

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> builtins.str:
        """
        转发规则的创建时间
        """
        return pulumi.get(self, "created_time")

    @property
    @pulumi.getter
    def enable(self) -> builtins.bool:
        """
        转发规则是否被启用。true：启用。false：禁用。
        """
        return pulumi.get(self, "enable")

    @property
    @pulumi.getter(name="endpointId")
    def endpoint_id(self) -> builtins.int:
        """
        终端节点的 ID。该参数仅在 Type 参数是 OUTBOUND 时有效且为必选参数。
        """
        return pulumi.get(self, "endpoint_id")

    @property
    @pulumi.getter(name="forwardIPs")
    def forward_ips(self) -> Sequence['outputs.GetResolverRuleForwardIPResult']:
        """
        外部的 DNS 服务器的 IP 地址和端口。您最多只能添加 10 个 IP 地址。该参数仅在 Type 参数是 OUTBOUND 时有效且为必选参数。
        """
        return pulumi.get(self, "forward_ips")

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

    @property
    @pulumi.getter(name="lastOperator")
    def last_operator(self) -> builtins.str:
        """
        最近一次更新转发规则的账号的 ID
        """
        return pulumi.get(self, "last_operator")

    @property
    @pulumi.getter
    def line(self) -> builtins.str:
        """
        递归 DNS 服务器的出口 IP 地址的运营商。该参数仅在 Type 参数是 LINE 时有效。支持的取值：移动：中国移动，电信：中国电信，联通：中国联通
        """
        return pulumi.get(self, "line")

    @property
    @pulumi.getter
    def name(self) -> builtins.str:
        """
        转发规则的名称。支持 UTF-8 格式。
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="projectName")
    def project_name(self) -> builtins.str:
        """
        转发规则所属的项目名称。默认为 default。
        """
        return pulumi.get(self, "project_name")

    @property
    @pulumi.getter(name="ruleId")
    def rule_id(self) -> builtins.str:
        """
        转发规则的 ID。
        """
        return pulumi.get(self, "rule_id")

    @property
    @pulumi.getter
    def tags(self) -> Sequence['outputs.GetResolverRuleTagResult']:
        """
        转发规则所属的一个或多个标签
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter
    def type(self) -> builtins.str:
        """
        转发规则类型。OUTBOUND：转发到外部的 DNS 服务器。LINE：自定义公网递归 DNS 服务器的出口 IP 地址的运营商。
        """
        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="vpCs")
    def vp_cs(self) -> Sequence['outputs.GetResolverRuleVpCResult']:
        """
        转发规则所关联的 VPC。转发规则在关联的 VPC 中生效。Type 参数是 OUTBOUND 时，VPC 的地域必须和终端节点所在的地域相同。
        """
        return pulumi.get(self, "vp_cs")

    @property
    @pulumi.getter(name="zoneName")
    def zone_name(self) -> builtins.str:
        """
        转发规则转发规则所关联的域名。您可以输入一个或多个域名。多个域名之间使用英文逗号, 分隔。最多支持输入 500 个域名。该参数仅在 Type 参数是 OUTBOUND 时有效且为必选参数。如果您把该参数设置为 *，则转发规则适用于 VPC 关联的所有域名。
        """
        return pulumi.get(self, "zone_name")


class AwaitableGetResolverRuleResult(GetResolverRuleResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetResolverRuleResult(
            created_time=self.created_time,
            enable=self.enable,
            endpoint_id=self.endpoint_id,
            forward_ips=self.forward_ips,
            id=self.id,
            last_operator=self.last_operator,
            line=self.line,
            name=self.name,
            project_name=self.project_name,
            rule_id=self.rule_id,
            tags=self.tags,
            type=self.type,
            updated_time=self.updated_time,
            vp_cs=self.vp_cs,
            zone_name=self.zone_name)


def get_resolver_rule(id: Optional[builtins.str] = None,
                      opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetResolverRuleResult:
    """
    Data Source schema for Byteplus::PrivateZone::ResolverRule


    :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:privatezone/getResolverRule:getResolverRule', __args__, opts=opts, typ=GetResolverRuleResult).value

    return AwaitableGetResolverRuleResult(
        created_time=pulumi.get(__ret__, 'created_time'),
        enable=pulumi.get(__ret__, 'enable'),
        endpoint_id=pulumi.get(__ret__, 'endpoint_id'),
        forward_ips=pulumi.get(__ret__, 'forward_ips'),
        id=pulumi.get(__ret__, 'id'),
        last_operator=pulumi.get(__ret__, 'last_operator'),
        line=pulumi.get(__ret__, 'line'),
        name=pulumi.get(__ret__, 'name'),
        project_name=pulumi.get(__ret__, 'project_name'),
        rule_id=pulumi.get(__ret__, 'rule_id'),
        tags=pulumi.get(__ret__, 'tags'),
        type=pulumi.get(__ret__, 'type'),
        updated_time=pulumi.get(__ret__, 'updated_time'),
        vp_cs=pulumi.get(__ret__, 'vp_cs'),
        zone_name=pulumi.get(__ret__, 'zone_name'))
def get_resolver_rule_output(id: Optional[pulumi.Input[builtins.str]] = None,
                             opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetResolverRuleResult]:
    """
    Data Source schema for Byteplus::PrivateZone::ResolverRule


    :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:privatezone/getResolverRule:getResolverRule', __args__, opts=opts, typ=GetResolverRuleResult)
    return __ret__.apply(lambda __response__: GetResolverRuleResult(
        created_time=pulumi.get(__response__, 'created_time'),
        enable=pulumi.get(__response__, 'enable'),
        endpoint_id=pulumi.get(__response__, 'endpoint_id'),
        forward_ips=pulumi.get(__response__, 'forward_ips'),
        id=pulumi.get(__response__, 'id'),
        last_operator=pulumi.get(__response__, 'last_operator'),
        line=pulumi.get(__response__, 'line'),
        name=pulumi.get(__response__, 'name'),
        project_name=pulumi.get(__response__, 'project_name'),
        rule_id=pulumi.get(__response__, 'rule_id'),
        tags=pulumi.get(__response__, 'tags'),
        type=pulumi.get(__response__, 'type'),
        updated_time=pulumi.get(__response__, 'updated_time'),
        vp_cs=pulumi.get(__response__, 'vp_cs'),
        zone_name=pulumi.get(__response__, 'zone_name')))
