# 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__ = [
    'GetTrafficMirrorFilterRuleResult',
    'AwaitableGetTrafficMirrorFilterRuleResult',
    'get_traffic_mirror_filter_rule',
    'get_traffic_mirror_filter_rule_output',
]

@pulumi.output_type
class GetTrafficMirrorFilterRuleResult:
    """
    A collection of values returned by getTrafficMirrorFilterRule.
    """
    def __init__(__self__, description=None, destination_cidr_block=None, destination_port_range=None, id=None, policy=None, priority=None, protocol=None, source_cidr_block=None, source_port_range=None, status=None, traffic_direction=None, traffic_mirror_filter_id=None, traffic_mirror_filter_rule_id=None):
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if destination_cidr_block and not isinstance(destination_cidr_block, str):
            raise TypeError("Expected argument 'destination_cidr_block' to be a str")
        pulumi.set(__self__, "destination_cidr_block", destination_cidr_block)
        if destination_port_range and not isinstance(destination_port_range, str):
            raise TypeError("Expected argument 'destination_port_range' to be a str")
        pulumi.set(__self__, "destination_port_range", destination_port_range)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if policy and not isinstance(policy, str):
            raise TypeError("Expected argument 'policy' to be a str")
        pulumi.set(__self__, "policy", policy)
        if priority and not isinstance(priority, int):
            raise TypeError("Expected argument 'priority' to be a int")
        pulumi.set(__self__, "priority", priority)
        if protocol and not isinstance(protocol, str):
            raise TypeError("Expected argument 'protocol' to be a str")
        pulumi.set(__self__, "protocol", protocol)
        if source_cidr_block and not isinstance(source_cidr_block, str):
            raise TypeError("Expected argument 'source_cidr_block' to be a str")
        pulumi.set(__self__, "source_cidr_block", source_cidr_block)
        if source_port_range and not isinstance(source_port_range, str):
            raise TypeError("Expected argument 'source_port_range' to be a str")
        pulumi.set(__self__, "source_port_range", source_port_range)
        if status and not isinstance(status, str):
            raise TypeError("Expected argument 'status' to be a str")
        pulumi.set(__self__, "status", status)
        if traffic_direction and not isinstance(traffic_direction, str):
            raise TypeError("Expected argument 'traffic_direction' to be a str")
        pulumi.set(__self__, "traffic_direction", traffic_direction)
        if traffic_mirror_filter_id and not isinstance(traffic_mirror_filter_id, str):
            raise TypeError("Expected argument 'traffic_mirror_filter_id' to be a str")
        pulumi.set(__self__, "traffic_mirror_filter_id", traffic_mirror_filter_id)
        if traffic_mirror_filter_rule_id and not isinstance(traffic_mirror_filter_rule_id, str):
            raise TypeError("Expected argument 'traffic_mirror_filter_rule_id' to be a str")
        pulumi.set(__self__, "traffic_mirror_filter_rule_id", traffic_mirror_filter_rule_id)

    @property
    @pulumi.getter
    def description(self) -> builtins.str:
        """
        筛选规则的描述。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="destinationCidrBlock")
    def destination_cidr_block(self) -> builtins.str:
        """
        目的网段。
        """
        return pulumi.get(self, "destination_cidr_block")

    @property
    @pulumi.getter(name="destinationPortRange")
    def destination_port_range(self) -> builtins.str:
        """
        流量目的端口范围。当Protocol传入all或icmp时，无需传入本参数，默认取值-1/-1，表示不限制端口。当Protocol传入tcp或udp时，本参数为必选，取值范围1～65535，使用正斜线（/）隔开起始端口和终止端口，如1/50、80/80。
        """
        return pulumi.get(self, "destination_port_range")

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

    @property
    @pulumi.getter
    def policy(self) -> builtins.str:
        """
        流量采集策略。accept：允许。即当镜像源的流量匹配该规则时，复制该流量至镜像目标进行监控分析。reject：拒绝。即当镜像源的流量匹配该规则时，不复制该流量，拒绝对该流量进行监控分析。
        """
        return pulumi.get(self, "policy")

    @property
    @pulumi.getter
    def priority(self) -> builtins.int:
        """
        筛选规则的优先级，范围为1-1000。数值越小，优先级越高。默认为1，1为最高优先级。同一筛选条件同一方向的优先级唯一。
        """
        return pulumi.get(self, "priority")

    @property
    @pulumi.getter
    def protocol(self) -> builtins.str:
        """
        流量的协议。取值如下：all：含TCP、UDP、ICMP协议。tcp：TCP协议。udp：UDP协议。icmp：ICMP协议。
        """
        return pulumi.get(self, "protocol")

    @property
    @pulumi.getter(name="sourceCidrBlock")
    def source_cidr_block(self) -> builtins.str:
        """
        流量源网段。
        """
        return pulumi.get(self, "source_cidr_block")

    @property
    @pulumi.getter(name="sourcePortRange")
    def source_port_range(self) -> builtins.str:
        """
        流量源端口范围。当Protocol传入all或icmp时，无需传入本参数，默认取值-1/-1，表示不限制端口。当Protocol传入tcp或udp时，本参数为必选，取值范围1～65535，使用正斜线（/）隔开起始端口和终止端口，如1/50、80/80。
        """
        return pulumi.get(self, "source_port_range")

    @property
    @pulumi.getter
    def status(self) -> builtins.str:
        """
        筛选规则的状态。Available：可用。Deleting：删除中。Creating：创建中。Pending：修改中。
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter(name="trafficDirection")
    def traffic_direction(self) -> builtins.str:
        """
        流量的方向。取值如下：ingress：入向规则。egress：出向规则。
        """
        return pulumi.get(self, "traffic_direction")

    @property
    @pulumi.getter(name="trafficMirrorFilterId")
    def traffic_mirror_filter_id(self) -> builtins.str:
        """
        筛选条件的ID。
        """
        return pulumi.get(self, "traffic_mirror_filter_id")

    @property
    @pulumi.getter(name="trafficMirrorFilterRuleId")
    def traffic_mirror_filter_rule_id(self) -> builtins.str:
        """
        筛选规则的ID。
        """
        return pulumi.get(self, "traffic_mirror_filter_rule_id")


class AwaitableGetTrafficMirrorFilterRuleResult(GetTrafficMirrorFilterRuleResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetTrafficMirrorFilterRuleResult(
            description=self.description,
            destination_cidr_block=self.destination_cidr_block,
            destination_port_range=self.destination_port_range,
            id=self.id,
            policy=self.policy,
            priority=self.priority,
            protocol=self.protocol,
            source_cidr_block=self.source_cidr_block,
            source_port_range=self.source_port_range,
            status=self.status,
            traffic_direction=self.traffic_direction,
            traffic_mirror_filter_id=self.traffic_mirror_filter_id,
            traffic_mirror_filter_rule_id=self.traffic_mirror_filter_rule_id)


def get_traffic_mirror_filter_rule(id: Optional[builtins.str] = None,
                                   opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetTrafficMirrorFilterRuleResult:
    """
    Data Source schema for Byteplus::VPC::TrafficMirrorFilterRule


    :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:vpc/getTrafficMirrorFilterRule:getTrafficMirrorFilterRule', __args__, opts=opts, typ=GetTrafficMirrorFilterRuleResult).value

    return AwaitableGetTrafficMirrorFilterRuleResult(
        description=pulumi.get(__ret__, 'description'),
        destination_cidr_block=pulumi.get(__ret__, 'destination_cidr_block'),
        destination_port_range=pulumi.get(__ret__, 'destination_port_range'),
        id=pulumi.get(__ret__, 'id'),
        policy=pulumi.get(__ret__, 'policy'),
        priority=pulumi.get(__ret__, 'priority'),
        protocol=pulumi.get(__ret__, 'protocol'),
        source_cidr_block=pulumi.get(__ret__, 'source_cidr_block'),
        source_port_range=pulumi.get(__ret__, 'source_port_range'),
        status=pulumi.get(__ret__, 'status'),
        traffic_direction=pulumi.get(__ret__, 'traffic_direction'),
        traffic_mirror_filter_id=pulumi.get(__ret__, 'traffic_mirror_filter_id'),
        traffic_mirror_filter_rule_id=pulumi.get(__ret__, 'traffic_mirror_filter_rule_id'))
def get_traffic_mirror_filter_rule_output(id: Optional[pulumi.Input[builtins.str]] = None,
                                          opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetTrafficMirrorFilterRuleResult]:
    """
    Data Source schema for Byteplus::VPC::TrafficMirrorFilterRule


    :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:vpc/getTrafficMirrorFilterRule:getTrafficMirrorFilterRule', __args__, opts=opts, typ=GetTrafficMirrorFilterRuleResult)
    return __ret__.apply(lambda __response__: GetTrafficMirrorFilterRuleResult(
        description=pulumi.get(__response__, 'description'),
        destination_cidr_block=pulumi.get(__response__, 'destination_cidr_block'),
        destination_port_range=pulumi.get(__response__, 'destination_port_range'),
        id=pulumi.get(__response__, 'id'),
        policy=pulumi.get(__response__, 'policy'),
        priority=pulumi.get(__response__, 'priority'),
        protocol=pulumi.get(__response__, 'protocol'),
        source_cidr_block=pulumi.get(__response__, 'source_cidr_block'),
        source_port_range=pulumi.get(__response__, 'source_port_range'),
        status=pulumi.get(__response__, 'status'),
        traffic_direction=pulumi.get(__response__, 'traffic_direction'),
        traffic_mirror_filter_id=pulumi.get(__response__, 'traffic_mirror_filter_id'),
        traffic_mirror_filter_rule_id=pulumi.get(__response__, 'traffic_mirror_filter_rule_id')))
