# 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__ = ['RuleArgs', 'Rule']

@pulumi.input_type
class RuleArgs:
    def __init__(__self__, *,
                 listener_id: pulumi.Input[builtins.str],
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 domain: Optional[pulumi.Input[builtins.str]] = None,
                 forward_group_config: Optional[pulumi.Input['RuleForwardGroupConfigArgs']] = None,
                 priority: Optional[pulumi.Input[builtins.int]] = None,
                 redirect_config: Optional[pulumi.Input['RuleRedirectConfigArgs']] = None,
                 rewrite_config: Optional[pulumi.Input['RuleRewriteConfigArgs']] = None,
                 rewrite_enabled: Optional[pulumi.Input[builtins.str]] = None,
                 rule_action: Optional[pulumi.Input[builtins.str]] = None,
                 rule_actions: Optional[pulumi.Input[Sequence[pulumi.Input['RuleRuleActionArgs']]]] = None,
                 rule_conditions: Optional[pulumi.Input[Sequence[pulumi.Input['RuleRuleConditionArgs']]]] = None,
                 server_group_id: Optional[pulumi.Input[builtins.str]] = None,
                 traffic_limit_enabled: Optional[pulumi.Input[builtins.str]] = None,
                 traffic_limit_qps: Optional[pulumi.Input[builtins.int]] = None,
                 url: Optional[pulumi.Input[builtins.str]] = None):
        """
        The set of arguments for constructing a Rule resource.
        :param pulumi.Input[builtins.str] listener_id: 监听器ID。
        :param pulumi.Input[builtins.str] description: 转发规则的描述。
        :param pulumi.Input[builtins.str] domain: 转发规则的域名。
        :param pulumi.Input['RuleForwardGroupConfigArgs'] forward_group_config: 转发规则服务器组配置
        :param pulumi.Input[builtins.int] priority: 标准版转发规则优先级。
        :param pulumi.Input['RuleRedirectConfigArgs'] redirect_config: 重定向相关配置信息。
        :param pulumi.Input['RuleRewriteConfigArgs'] rewrite_config: 重定向相关配置信息。
        :param pulumi.Input[builtins.str] rewrite_enabled: 转发规则重写配置开关。on：开启。off：关闭。
        :param pulumi.Input[builtins.str] rule_action: 转发规则动作。空：默认转发至服务器组。Redirect：重定向。
        :param pulumi.Input[builtins.str] server_group_id: 转发规则关联的后端服务器组ID。
        :param pulumi.Input[builtins.str] traffic_limit_enabled: 转发规则 QPS 限速开关。on：开启。off：关闭。
        :param pulumi.Input[builtins.int] traffic_limit_qps: 每秒请求数。取值范围：100～100000。
        :param pulumi.Input[builtins.str] url: 转发规则的URL。
        """
        pulumi.set(__self__, "listener_id", listener_id)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if domain is not None:
            pulumi.set(__self__, "domain", domain)
        if forward_group_config is not None:
            pulumi.set(__self__, "forward_group_config", forward_group_config)
        if priority is not None:
            pulumi.set(__self__, "priority", priority)
        if redirect_config is not None:
            pulumi.set(__self__, "redirect_config", redirect_config)
        if rewrite_config is not None:
            pulumi.set(__self__, "rewrite_config", rewrite_config)
        if rewrite_enabled is not None:
            pulumi.set(__self__, "rewrite_enabled", rewrite_enabled)
        if rule_action is not None:
            pulumi.set(__self__, "rule_action", rule_action)
        if rule_actions is not None:
            pulumi.set(__self__, "rule_actions", rule_actions)
        if rule_conditions is not None:
            pulumi.set(__self__, "rule_conditions", rule_conditions)
        if server_group_id is not None:
            pulumi.set(__self__, "server_group_id", server_group_id)
        if traffic_limit_enabled is not None:
            pulumi.set(__self__, "traffic_limit_enabled", traffic_limit_enabled)
        if traffic_limit_qps is not None:
            pulumi.set(__self__, "traffic_limit_qps", traffic_limit_qps)
        if url is not None:
            pulumi.set(__self__, "url", url)

    @property
    @pulumi.getter(name="listenerId")
    def listener_id(self) -> pulumi.Input[builtins.str]:
        """
        监听器ID。
        """
        return pulumi.get(self, "listener_id")

    @listener_id.setter
    def listener_id(self, value: pulumi.Input[builtins.str]):
        pulumi.set(self, "listener_id", 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
    def domain(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        转发规则的域名。
        """
        return pulumi.get(self, "domain")

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

    @property
    @pulumi.getter(name="forwardGroupConfig")
    def forward_group_config(self) -> Optional[pulumi.Input['RuleForwardGroupConfigArgs']]:
        """
        转发规则服务器组配置
        """
        return pulumi.get(self, "forward_group_config")

    @forward_group_config.setter
    def forward_group_config(self, value: Optional[pulumi.Input['RuleForwardGroupConfigArgs']]):
        pulumi.set(self, "forward_group_config", value)

    @property
    @pulumi.getter
    def priority(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        标准版转发规则优先级。
        """
        return pulumi.get(self, "priority")

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

    @property
    @pulumi.getter(name="redirectConfig")
    def redirect_config(self) -> Optional[pulumi.Input['RuleRedirectConfigArgs']]:
        """
        重定向相关配置信息。
        """
        return pulumi.get(self, "redirect_config")

    @redirect_config.setter
    def redirect_config(self, value: Optional[pulumi.Input['RuleRedirectConfigArgs']]):
        pulumi.set(self, "redirect_config", value)

    @property
    @pulumi.getter(name="rewriteConfig")
    def rewrite_config(self) -> Optional[pulumi.Input['RuleRewriteConfigArgs']]:
        """
        重定向相关配置信息。
        """
        return pulumi.get(self, "rewrite_config")

    @rewrite_config.setter
    def rewrite_config(self, value: Optional[pulumi.Input['RuleRewriteConfigArgs']]):
        pulumi.set(self, "rewrite_config", value)

    @property
    @pulumi.getter(name="rewriteEnabled")
    def rewrite_enabled(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        转发规则重写配置开关。on：开启。off：关闭。
        """
        return pulumi.get(self, "rewrite_enabled")

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

    @property
    @pulumi.getter(name="ruleAction")
    def rule_action(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        转发规则动作。空：默认转发至服务器组。Redirect：重定向。
        """
        return pulumi.get(self, "rule_action")

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

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

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

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

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

    @property
    @pulumi.getter(name="serverGroupId")
    def server_group_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        转发规则关联的后端服务器组ID。
        """
        return pulumi.get(self, "server_group_id")

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

    @property
    @pulumi.getter(name="trafficLimitEnabled")
    def traffic_limit_enabled(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        转发规则 QPS 限速开关。on：开启。off：关闭。
        """
        return pulumi.get(self, "traffic_limit_enabled")

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

    @property
    @pulumi.getter(name="trafficLimitQps")
    def traffic_limit_qps(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        每秒请求数。取值范围：100～100000。
        """
        return pulumi.get(self, "traffic_limit_qps")

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

    @property
    @pulumi.getter
    def url(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        转发规则的URL。
        """
        return pulumi.get(self, "url")

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


@pulumi.input_type
class _RuleState:
    def __init__(__self__, *,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 domain: Optional[pulumi.Input[builtins.str]] = None,
                 forward_group_config: Optional[pulumi.Input['RuleForwardGroupConfigArgs']] = None,
                 listener_id: Optional[pulumi.Input[builtins.str]] = None,
                 priority: Optional[pulumi.Input[builtins.int]] = None,
                 redirect_config: Optional[pulumi.Input['RuleRedirectConfigArgs']] = None,
                 rewrite_config: Optional[pulumi.Input['RuleRewriteConfigArgs']] = None,
                 rewrite_enabled: Optional[pulumi.Input[builtins.str]] = None,
                 rule_action: Optional[pulumi.Input[builtins.str]] = None,
                 rule_actions: Optional[pulumi.Input[Sequence[pulumi.Input['RuleRuleActionArgs']]]] = None,
                 rule_conditions: Optional[pulumi.Input[Sequence[pulumi.Input['RuleRuleConditionArgs']]]] = None,
                 rule_id: Optional[pulumi.Input[builtins.str]] = None,
                 server_group_id: Optional[pulumi.Input[builtins.str]] = None,
                 traffic_limit_enabled: Optional[pulumi.Input[builtins.str]] = None,
                 traffic_limit_qps: Optional[pulumi.Input[builtins.int]] = None,
                 url: Optional[pulumi.Input[builtins.str]] = None):
        """
        Input properties used for looking up and filtering Rule resources.
        :param pulumi.Input[builtins.str] description: 转发规则的描述。
        :param pulumi.Input[builtins.str] domain: 转发规则的域名。
        :param pulumi.Input['RuleForwardGroupConfigArgs'] forward_group_config: 转发规则服务器组配置
        :param pulumi.Input[builtins.str] listener_id: 监听器ID。
        :param pulumi.Input[builtins.int] priority: 标准版转发规则优先级。
        :param pulumi.Input['RuleRedirectConfigArgs'] redirect_config: 重定向相关配置信息。
        :param pulumi.Input['RuleRewriteConfigArgs'] rewrite_config: 重定向相关配置信息。
        :param pulumi.Input[builtins.str] rewrite_enabled: 转发规则重写配置开关。on：开启。off：关闭。
        :param pulumi.Input[builtins.str] rule_action: 转发规则动作。空：默认转发至服务器组。Redirect：重定向。
        :param pulumi.Input[builtins.str] rule_id: 转发规则ID。
        :param pulumi.Input[builtins.str] server_group_id: 转发规则关联的后端服务器组ID。
        :param pulumi.Input[builtins.str] traffic_limit_enabled: 转发规则 QPS 限速开关。on：开启。off：关闭。
        :param pulumi.Input[builtins.int] traffic_limit_qps: 每秒请求数。取值范围：100～100000。
        :param pulumi.Input[builtins.str] url: 转发规则的URL。
        """
        if description is not None:
            pulumi.set(__self__, "description", description)
        if domain is not None:
            pulumi.set(__self__, "domain", domain)
        if forward_group_config is not None:
            pulumi.set(__self__, "forward_group_config", forward_group_config)
        if listener_id is not None:
            pulumi.set(__self__, "listener_id", listener_id)
        if priority is not None:
            pulumi.set(__self__, "priority", priority)
        if redirect_config is not None:
            pulumi.set(__self__, "redirect_config", redirect_config)
        if rewrite_config is not None:
            pulumi.set(__self__, "rewrite_config", rewrite_config)
        if rewrite_enabled is not None:
            pulumi.set(__self__, "rewrite_enabled", rewrite_enabled)
        if rule_action is not None:
            pulumi.set(__self__, "rule_action", rule_action)
        if rule_actions is not None:
            pulumi.set(__self__, "rule_actions", rule_actions)
        if rule_conditions is not None:
            pulumi.set(__self__, "rule_conditions", rule_conditions)
        if rule_id is not None:
            pulumi.set(__self__, "rule_id", rule_id)
        if server_group_id is not None:
            pulumi.set(__self__, "server_group_id", server_group_id)
        if traffic_limit_enabled is not None:
            pulumi.set(__self__, "traffic_limit_enabled", traffic_limit_enabled)
        if traffic_limit_qps is not None:
            pulumi.set(__self__, "traffic_limit_qps", traffic_limit_qps)
        if url is not None:
            pulumi.set(__self__, "url", url)

    @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
    def domain(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        转发规则的域名。
        """
        return pulumi.get(self, "domain")

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

    @property
    @pulumi.getter(name="forwardGroupConfig")
    def forward_group_config(self) -> Optional[pulumi.Input['RuleForwardGroupConfigArgs']]:
        """
        转发规则服务器组配置
        """
        return pulumi.get(self, "forward_group_config")

    @forward_group_config.setter
    def forward_group_config(self, value: Optional[pulumi.Input['RuleForwardGroupConfigArgs']]):
        pulumi.set(self, "forward_group_config", value)

    @property
    @pulumi.getter(name="listenerId")
    def listener_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        监听器ID。
        """
        return pulumi.get(self, "listener_id")

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

    @property
    @pulumi.getter
    def priority(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        标准版转发规则优先级。
        """
        return pulumi.get(self, "priority")

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

    @property
    @pulumi.getter(name="redirectConfig")
    def redirect_config(self) -> Optional[pulumi.Input['RuleRedirectConfigArgs']]:
        """
        重定向相关配置信息。
        """
        return pulumi.get(self, "redirect_config")

    @redirect_config.setter
    def redirect_config(self, value: Optional[pulumi.Input['RuleRedirectConfigArgs']]):
        pulumi.set(self, "redirect_config", value)

    @property
    @pulumi.getter(name="rewriteConfig")
    def rewrite_config(self) -> Optional[pulumi.Input['RuleRewriteConfigArgs']]:
        """
        重定向相关配置信息。
        """
        return pulumi.get(self, "rewrite_config")

    @rewrite_config.setter
    def rewrite_config(self, value: Optional[pulumi.Input['RuleRewriteConfigArgs']]):
        pulumi.set(self, "rewrite_config", value)

    @property
    @pulumi.getter(name="rewriteEnabled")
    def rewrite_enabled(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        转发规则重写配置开关。on：开启。off：关闭。
        """
        return pulumi.get(self, "rewrite_enabled")

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

    @property
    @pulumi.getter(name="ruleAction")
    def rule_action(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        转发规则动作。空：默认转发至服务器组。Redirect：重定向。
        """
        return pulumi.get(self, "rule_action")

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

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

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

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

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

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

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

    @property
    @pulumi.getter(name="serverGroupId")
    def server_group_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        转发规则关联的后端服务器组ID。
        """
        return pulumi.get(self, "server_group_id")

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

    @property
    @pulumi.getter(name="trafficLimitEnabled")
    def traffic_limit_enabled(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        转发规则 QPS 限速开关。on：开启。off：关闭。
        """
        return pulumi.get(self, "traffic_limit_enabled")

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

    @property
    @pulumi.getter(name="trafficLimitQps")
    def traffic_limit_qps(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        每秒请求数。取值范围：100～100000。
        """
        return pulumi.get(self, "traffic_limit_qps")

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

    @property
    @pulumi.getter
    def url(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        转发规则的URL。
        """
        return pulumi.get(self, "url")

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


@pulumi.type_token("bytepluscc:alb/rule:Rule")
class Rule(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 domain: Optional[pulumi.Input[builtins.str]] = None,
                 forward_group_config: Optional[pulumi.Input[Union['RuleForwardGroupConfigArgs', 'RuleForwardGroupConfigArgsDict']]] = None,
                 listener_id: Optional[pulumi.Input[builtins.str]] = None,
                 priority: Optional[pulumi.Input[builtins.int]] = None,
                 redirect_config: Optional[pulumi.Input[Union['RuleRedirectConfigArgs', 'RuleRedirectConfigArgsDict']]] = None,
                 rewrite_config: Optional[pulumi.Input[Union['RuleRewriteConfigArgs', 'RuleRewriteConfigArgsDict']]] = None,
                 rewrite_enabled: Optional[pulumi.Input[builtins.str]] = None,
                 rule_action: Optional[pulumi.Input[builtins.str]] = None,
                 rule_actions: Optional[pulumi.Input[Sequence[pulumi.Input[Union['RuleRuleActionArgs', 'RuleRuleActionArgsDict']]]]] = None,
                 rule_conditions: Optional[pulumi.Input[Sequence[pulumi.Input[Union['RuleRuleConditionArgs', 'RuleRuleConditionArgsDict']]]]] = None,
                 server_group_id: Optional[pulumi.Input[builtins.str]] = None,
                 traffic_limit_enabled: Optional[pulumi.Input[builtins.str]] = None,
                 traffic_limit_qps: Optional[pulumi.Input[builtins.int]] = None,
                 url: Optional[pulumi.Input[builtins.str]] = None,
                 __props__=None):
        """
        ALB 按照您设置的转发规则，对不同特征的访问流量进行分发。您可以为一个监听器配置多条转发规则。基础版 ALB 实例支持基于域名和路径的转发规则。标准版 ALB 实例支持基于域名、路径和 HTTP 标头的转发规则，并支持复合转发条件。

        ## Import

        ```sh
        $ pulumi import bytepluscc:alb/rule:Rule example "listener_id|rule_id"
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] description: 转发规则的描述。
        :param pulumi.Input[builtins.str] domain: 转发规则的域名。
        :param pulumi.Input[Union['RuleForwardGroupConfigArgs', 'RuleForwardGroupConfigArgsDict']] forward_group_config: 转发规则服务器组配置
        :param pulumi.Input[builtins.str] listener_id: 监听器ID。
        :param pulumi.Input[builtins.int] priority: 标准版转发规则优先级。
        :param pulumi.Input[Union['RuleRedirectConfigArgs', 'RuleRedirectConfigArgsDict']] redirect_config: 重定向相关配置信息。
        :param pulumi.Input[Union['RuleRewriteConfigArgs', 'RuleRewriteConfigArgsDict']] rewrite_config: 重定向相关配置信息。
        :param pulumi.Input[builtins.str] rewrite_enabled: 转发规则重写配置开关。on：开启。off：关闭。
        :param pulumi.Input[builtins.str] rule_action: 转发规则动作。空：默认转发至服务器组。Redirect：重定向。
        :param pulumi.Input[builtins.str] server_group_id: 转发规则关联的后端服务器组ID。
        :param pulumi.Input[builtins.str] traffic_limit_enabled: 转发规则 QPS 限速开关。on：开启。off：关闭。
        :param pulumi.Input[builtins.int] traffic_limit_qps: 每秒请求数。取值范围：100～100000。
        :param pulumi.Input[builtins.str] url: 转发规则的URL。
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: RuleArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        ALB 按照您设置的转发规则，对不同特征的访问流量进行分发。您可以为一个监听器配置多条转发规则。基础版 ALB 实例支持基于域名和路径的转发规则。标准版 ALB 实例支持基于域名、路径和 HTTP 标头的转发规则，并支持复合转发条件。

        ## Import

        ```sh
        $ pulumi import bytepluscc:alb/rule:Rule example "listener_id|rule_id"
        ```

        :param str resource_name: The name of the resource.
        :param RuleArgs 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(RuleArgs, 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,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 domain: Optional[pulumi.Input[builtins.str]] = None,
                 forward_group_config: Optional[pulumi.Input[Union['RuleForwardGroupConfigArgs', 'RuleForwardGroupConfigArgsDict']]] = None,
                 listener_id: Optional[pulumi.Input[builtins.str]] = None,
                 priority: Optional[pulumi.Input[builtins.int]] = None,
                 redirect_config: Optional[pulumi.Input[Union['RuleRedirectConfigArgs', 'RuleRedirectConfigArgsDict']]] = None,
                 rewrite_config: Optional[pulumi.Input[Union['RuleRewriteConfigArgs', 'RuleRewriteConfigArgsDict']]] = None,
                 rewrite_enabled: Optional[pulumi.Input[builtins.str]] = None,
                 rule_action: Optional[pulumi.Input[builtins.str]] = None,
                 rule_actions: Optional[pulumi.Input[Sequence[pulumi.Input[Union['RuleRuleActionArgs', 'RuleRuleActionArgsDict']]]]] = None,
                 rule_conditions: Optional[pulumi.Input[Sequence[pulumi.Input[Union['RuleRuleConditionArgs', 'RuleRuleConditionArgsDict']]]]] = None,
                 server_group_id: Optional[pulumi.Input[builtins.str]] = None,
                 traffic_limit_enabled: Optional[pulumi.Input[builtins.str]] = None,
                 traffic_limit_qps: Optional[pulumi.Input[builtins.int]] = None,
                 url: Optional[pulumi.Input[builtins.str]] = 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__ = RuleArgs.__new__(RuleArgs)

            __props__.__dict__["description"] = description
            __props__.__dict__["domain"] = domain
            __props__.__dict__["forward_group_config"] = forward_group_config
            if listener_id is None and not opts.urn:
                raise TypeError("Missing required property 'listener_id'")
            __props__.__dict__["listener_id"] = listener_id
            __props__.__dict__["priority"] = priority
            __props__.__dict__["redirect_config"] = redirect_config
            __props__.__dict__["rewrite_config"] = rewrite_config
            __props__.__dict__["rewrite_enabled"] = rewrite_enabled
            __props__.__dict__["rule_action"] = rule_action
            __props__.__dict__["rule_actions"] = rule_actions
            __props__.__dict__["rule_conditions"] = rule_conditions
            __props__.__dict__["server_group_id"] = server_group_id
            __props__.__dict__["traffic_limit_enabled"] = traffic_limit_enabled
            __props__.__dict__["traffic_limit_qps"] = traffic_limit_qps
            __props__.__dict__["url"] = url
            __props__.__dict__["rule_id"] = None
        super(Rule, __self__).__init__(
            'bytepluscc:alb/rule:Rule',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            description: Optional[pulumi.Input[builtins.str]] = None,
            domain: Optional[pulumi.Input[builtins.str]] = None,
            forward_group_config: Optional[pulumi.Input[Union['RuleForwardGroupConfigArgs', 'RuleForwardGroupConfigArgsDict']]] = None,
            listener_id: Optional[pulumi.Input[builtins.str]] = None,
            priority: Optional[pulumi.Input[builtins.int]] = None,
            redirect_config: Optional[pulumi.Input[Union['RuleRedirectConfigArgs', 'RuleRedirectConfigArgsDict']]] = None,
            rewrite_config: Optional[pulumi.Input[Union['RuleRewriteConfigArgs', 'RuleRewriteConfigArgsDict']]] = None,
            rewrite_enabled: Optional[pulumi.Input[builtins.str]] = None,
            rule_action: Optional[pulumi.Input[builtins.str]] = None,
            rule_actions: Optional[pulumi.Input[Sequence[pulumi.Input[Union['RuleRuleActionArgs', 'RuleRuleActionArgsDict']]]]] = None,
            rule_conditions: Optional[pulumi.Input[Sequence[pulumi.Input[Union['RuleRuleConditionArgs', 'RuleRuleConditionArgsDict']]]]] = None,
            rule_id: Optional[pulumi.Input[builtins.str]] = None,
            server_group_id: Optional[pulumi.Input[builtins.str]] = None,
            traffic_limit_enabled: Optional[pulumi.Input[builtins.str]] = None,
            traffic_limit_qps: Optional[pulumi.Input[builtins.int]] = None,
            url: Optional[pulumi.Input[builtins.str]] = None) -> 'Rule':
        """
        Get an existing Rule 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] description: 转发规则的描述。
        :param pulumi.Input[builtins.str] domain: 转发规则的域名。
        :param pulumi.Input[Union['RuleForwardGroupConfigArgs', 'RuleForwardGroupConfigArgsDict']] forward_group_config: 转发规则服务器组配置
        :param pulumi.Input[builtins.str] listener_id: 监听器ID。
        :param pulumi.Input[builtins.int] priority: 标准版转发规则优先级。
        :param pulumi.Input[Union['RuleRedirectConfigArgs', 'RuleRedirectConfigArgsDict']] redirect_config: 重定向相关配置信息。
        :param pulumi.Input[Union['RuleRewriteConfigArgs', 'RuleRewriteConfigArgsDict']] rewrite_config: 重定向相关配置信息。
        :param pulumi.Input[builtins.str] rewrite_enabled: 转发规则重写配置开关。on：开启。off：关闭。
        :param pulumi.Input[builtins.str] rule_action: 转发规则动作。空：默认转发至服务器组。Redirect：重定向。
        :param pulumi.Input[builtins.str] rule_id: 转发规则ID。
        :param pulumi.Input[builtins.str] server_group_id: 转发规则关联的后端服务器组ID。
        :param pulumi.Input[builtins.str] traffic_limit_enabled: 转发规则 QPS 限速开关。on：开启。off：关闭。
        :param pulumi.Input[builtins.int] traffic_limit_qps: 每秒请求数。取值范围：100～100000。
        :param pulumi.Input[builtins.str] url: 转发规则的URL。
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _RuleState.__new__(_RuleState)

        __props__.__dict__["description"] = description
        __props__.__dict__["domain"] = domain
        __props__.__dict__["forward_group_config"] = forward_group_config
        __props__.__dict__["listener_id"] = listener_id
        __props__.__dict__["priority"] = priority
        __props__.__dict__["redirect_config"] = redirect_config
        __props__.__dict__["rewrite_config"] = rewrite_config
        __props__.__dict__["rewrite_enabled"] = rewrite_enabled
        __props__.__dict__["rule_action"] = rule_action
        __props__.__dict__["rule_actions"] = rule_actions
        __props__.__dict__["rule_conditions"] = rule_conditions
        __props__.__dict__["rule_id"] = rule_id
        __props__.__dict__["server_group_id"] = server_group_id
        __props__.__dict__["traffic_limit_enabled"] = traffic_limit_enabled
        __props__.__dict__["traffic_limit_qps"] = traffic_limit_qps
        __props__.__dict__["url"] = url
        return Rule(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def description(self) -> pulumi.Output[builtins.str]:
        """
        转发规则的描述。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter
    def domain(self) -> pulumi.Output[builtins.str]:
        """
        转发规则的域名。
        """
        return pulumi.get(self, "domain")

    @property
    @pulumi.getter(name="forwardGroupConfig")
    def forward_group_config(self) -> pulumi.Output['outputs.RuleForwardGroupConfig']:
        """
        转发规则服务器组配置
        """
        return pulumi.get(self, "forward_group_config")

    @property
    @pulumi.getter(name="listenerId")
    def listener_id(self) -> pulumi.Output[builtins.str]:
        """
        监听器ID。
        """
        return pulumi.get(self, "listener_id")

    @property
    @pulumi.getter
    def priority(self) -> pulumi.Output[builtins.int]:
        """
        标准版转发规则优先级。
        """
        return pulumi.get(self, "priority")

    @property
    @pulumi.getter(name="redirectConfig")
    def redirect_config(self) -> pulumi.Output['outputs.RuleRedirectConfig']:
        """
        重定向相关配置信息。
        """
        return pulumi.get(self, "redirect_config")

    @property
    @pulumi.getter(name="rewriteConfig")
    def rewrite_config(self) -> pulumi.Output['outputs.RuleRewriteConfig']:
        """
        重定向相关配置信息。
        """
        return pulumi.get(self, "rewrite_config")

    @property
    @pulumi.getter(name="rewriteEnabled")
    def rewrite_enabled(self) -> pulumi.Output[builtins.str]:
        """
        转发规则重写配置开关。on：开启。off：关闭。
        """
        return pulumi.get(self, "rewrite_enabled")

    @property
    @pulumi.getter(name="ruleAction")
    def rule_action(self) -> pulumi.Output[builtins.str]:
        """
        转发规则动作。空：默认转发至服务器组。Redirect：重定向。
        """
        return pulumi.get(self, "rule_action")

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

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

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

    @property
    @pulumi.getter(name="serverGroupId")
    def server_group_id(self) -> pulumi.Output[builtins.str]:
        """
        转发规则关联的后端服务器组ID。
        """
        return pulumi.get(self, "server_group_id")

    @property
    @pulumi.getter(name="trafficLimitEnabled")
    def traffic_limit_enabled(self) -> pulumi.Output[builtins.str]:
        """
        转发规则 QPS 限速开关。on：开启。off：关闭。
        """
        return pulumi.get(self, "traffic_limit_enabled")

    @property
    @pulumi.getter(name="trafficLimitQps")
    def traffic_limit_qps(self) -> pulumi.Output[builtins.int]:
        """
        每秒请求数。取值范围：100～100000。
        """
        return pulumi.get(self, "traffic_limit_qps")

    @property
    @pulumi.getter
    def url(self) -> pulumi.Output[builtins.str]:
        """
        转发规则的URL。
        """
        return pulumi.get(self, "url")

