# 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__ = ['TrafficMirrorFilterRuleArgs', 'TrafficMirrorFilterRule']

@pulumi.input_type
class TrafficMirrorFilterRuleArgs:
    def __init__(__self__, *,
                 destination_cidr_block: pulumi.Input[builtins.str],
                 policy: pulumi.Input[builtins.str],
                 protocol: pulumi.Input[builtins.str],
                 source_cidr_block: pulumi.Input[builtins.str],
                 traffic_direction: pulumi.Input[builtins.str],
                 traffic_mirror_filter_id: pulumi.Input[builtins.str],
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 destination_port_range: Optional[pulumi.Input[builtins.str]] = None,
                 priority: Optional[pulumi.Input[builtins.int]] = None,
                 source_port_range: Optional[pulumi.Input[builtins.str]] = None):
        """
        The set of arguments for constructing a TrafficMirrorFilterRule resource.
        :param pulumi.Input[builtins.str] destination_cidr_block: 目的网段。
        :param pulumi.Input[builtins.str] policy: 流量采集策略。accept：允许。即当镜像源的流量匹配该规则时，复制该流量至镜像目标进行监控分析。reject：拒绝。即当镜像源的流量匹配该规则时，不复制该流量，拒绝对该流量进行监控分析。
        :param pulumi.Input[builtins.str] protocol: 流量的协议。取值如下：all：含TCP、UDP、ICMP协议。tcp：TCP协议。udp：UDP协议。icmp：ICMP协议。
        :param pulumi.Input[builtins.str] source_cidr_block: 流量源网段。
        :param pulumi.Input[builtins.str] traffic_direction: 流量的方向。取值如下：ingress：入向规则。egress：出向规则。
        :param pulumi.Input[builtins.str] traffic_mirror_filter_id: 筛选条件的ID。
        :param pulumi.Input[builtins.str] description: 筛选规则的描述。
        :param pulumi.Input[builtins.str] destination_port_range: 流量目的端口范围。当Protocol传入all或icmp时，无需传入本参数，默认取值-1/-1，表示不限制端口。当Protocol传入tcp或udp时，本参数为必选，取值范围1～65535，使用正斜线（/）隔开起始端口和终止端口，如1/50、80/80。
        :param pulumi.Input[builtins.int] priority: 筛选规则的优先级，范围为1-1000。数值越小，优先级越高。默认为1，1为最高优先级。同一筛选条件同一方向的优先级唯一。
        :param pulumi.Input[builtins.str] source_port_range: 流量源端口范围。当Protocol传入all或icmp时，无需传入本参数，默认取值-1/-1，表示不限制端口。当Protocol传入tcp或udp时，本参数为必选，取值范围1～65535，使用正斜线（/）隔开起始端口和终止端口，如1/50、80/80。
        """
        pulumi.set(__self__, "destination_cidr_block", destination_cidr_block)
        pulumi.set(__self__, "policy", policy)
        pulumi.set(__self__, "protocol", protocol)
        pulumi.set(__self__, "source_cidr_block", source_cidr_block)
        pulumi.set(__self__, "traffic_direction", traffic_direction)
        pulumi.set(__self__, "traffic_mirror_filter_id", traffic_mirror_filter_id)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if destination_port_range is not None:
            pulumi.set(__self__, "destination_port_range", destination_port_range)
        if priority is not None:
            pulumi.set(__self__, "priority", priority)
        if source_port_range is not None:
            pulumi.set(__self__, "source_port_range", source_port_range)

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

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

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

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

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

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

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

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

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

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

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

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

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

    @property
    @pulumi.getter
    def priority(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        筛选规则的优先级，范围为1-1000。数值越小，优先级越高。默认为1，1为最高优先级。同一筛选条件同一方向的优先级唯一。
        """
        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="sourcePortRange")
    def source_port_range(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        流量源端口范围。当Protocol传入all或icmp时，无需传入本参数，默认取值-1/-1，表示不限制端口。当Protocol传入tcp或udp时，本参数为必选，取值范围1～65535，使用正斜线（/）隔开起始端口和终止端口，如1/50、80/80。
        """
        return pulumi.get(self, "source_port_range")

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


@pulumi.input_type
class _TrafficMirrorFilterRuleState:
    def __init__(__self__, *,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 destination_cidr_block: Optional[pulumi.Input[builtins.str]] = None,
                 destination_port_range: Optional[pulumi.Input[builtins.str]] = None,
                 policy: Optional[pulumi.Input[builtins.str]] = None,
                 priority: Optional[pulumi.Input[builtins.int]] = None,
                 protocol: Optional[pulumi.Input[builtins.str]] = None,
                 source_cidr_block: Optional[pulumi.Input[builtins.str]] = None,
                 source_port_range: Optional[pulumi.Input[builtins.str]] = None,
                 status: Optional[pulumi.Input[builtins.str]] = None,
                 traffic_direction: Optional[pulumi.Input[builtins.str]] = None,
                 traffic_mirror_filter_id: Optional[pulumi.Input[builtins.str]] = None,
                 traffic_mirror_filter_rule_id: Optional[pulumi.Input[builtins.str]] = None):
        """
        Input properties used for looking up and filtering TrafficMirrorFilterRule resources.
        :param pulumi.Input[builtins.str] description: 筛选规则的描述。
        :param pulumi.Input[builtins.str] destination_cidr_block: 目的网段。
        :param pulumi.Input[builtins.str] destination_port_range: 流量目的端口范围。当Protocol传入all或icmp时，无需传入本参数，默认取值-1/-1，表示不限制端口。当Protocol传入tcp或udp时，本参数为必选，取值范围1～65535，使用正斜线（/）隔开起始端口和终止端口，如1/50、80/80。
        :param pulumi.Input[builtins.str] policy: 流量采集策略。accept：允许。即当镜像源的流量匹配该规则时，复制该流量至镜像目标进行监控分析。reject：拒绝。即当镜像源的流量匹配该规则时，不复制该流量，拒绝对该流量进行监控分析。
        :param pulumi.Input[builtins.int] priority: 筛选规则的优先级，范围为1-1000。数值越小，优先级越高。默认为1，1为最高优先级。同一筛选条件同一方向的优先级唯一。
        :param pulumi.Input[builtins.str] protocol: 流量的协议。取值如下：all：含TCP、UDP、ICMP协议。tcp：TCP协议。udp：UDP协议。icmp：ICMP协议。
        :param pulumi.Input[builtins.str] source_cidr_block: 流量源网段。
        :param pulumi.Input[builtins.str] source_port_range: 流量源端口范围。当Protocol传入all或icmp时，无需传入本参数，默认取值-1/-1，表示不限制端口。当Protocol传入tcp或udp时，本参数为必选，取值范围1～65535，使用正斜线（/）隔开起始端口和终止端口，如1/50、80/80。
        :param pulumi.Input[builtins.str] status: 筛选规则的状态。Available：可用。Deleting：删除中。Creating：创建中。Pending：修改中。
        :param pulumi.Input[builtins.str] traffic_direction: 流量的方向。取值如下：ingress：入向规则。egress：出向规则。
        :param pulumi.Input[builtins.str] traffic_mirror_filter_id: 筛选条件的ID。
        :param pulumi.Input[builtins.str] traffic_mirror_filter_rule_id: 筛选规则的ID。
        """
        if description is not None:
            pulumi.set(__self__, "description", description)
        if destination_cidr_block is not None:
            pulumi.set(__self__, "destination_cidr_block", destination_cidr_block)
        if destination_port_range is not None:
            pulumi.set(__self__, "destination_port_range", destination_port_range)
        if policy is not None:
            pulumi.set(__self__, "policy", policy)
        if priority is not None:
            pulumi.set(__self__, "priority", priority)
        if protocol is not None:
            pulumi.set(__self__, "protocol", protocol)
        if source_cidr_block is not None:
            pulumi.set(__self__, "source_cidr_block", source_cidr_block)
        if source_port_range is not None:
            pulumi.set(__self__, "source_port_range", source_port_range)
        if status is not None:
            pulumi.set(__self__, "status", status)
        if traffic_direction is not None:
            pulumi.set(__self__, "traffic_direction", traffic_direction)
        if traffic_mirror_filter_id is not None:
            pulumi.set(__self__, "traffic_mirror_filter_id", traffic_mirror_filter_id)
        if traffic_mirror_filter_rule_id is not None:
            pulumi.set(__self__, "traffic_mirror_filter_rule_id", traffic_mirror_filter_rule_id)

    @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="destinationCidrBlock")
    def destination_cidr_block(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        目的网段。
        """
        return pulumi.get(self, "destination_cidr_block")

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


@pulumi.type_token("bytepluscc:vpc/trafficMirrorFilterRule:TrafficMirrorFilterRule")
class TrafficMirrorFilterRule(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 destination_cidr_block: Optional[pulumi.Input[builtins.str]] = None,
                 destination_port_range: Optional[pulumi.Input[builtins.str]] = None,
                 policy: Optional[pulumi.Input[builtins.str]] = None,
                 priority: Optional[pulumi.Input[builtins.int]] = None,
                 protocol: Optional[pulumi.Input[builtins.str]] = None,
                 source_cidr_block: Optional[pulumi.Input[builtins.str]] = None,
                 source_port_range: Optional[pulumi.Input[builtins.str]] = None,
                 traffic_direction: Optional[pulumi.Input[builtins.str]] = None,
                 traffic_mirror_filter_id: Optional[pulumi.Input[builtins.str]] = None,
                 __props__=None):
        """
        筛选条件由筛选规则组成，分为入向筛选规则和出向筛选规则。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        v_pc_traffic_mirror_filter_rule_demo = bytepluscc.vpc.TrafficMirrorFilterRule("VPCTrafficMirrorFilterRuleDemo",
            description="test",
            destination_cidr_block="10.*.*.0/24",
            destination_port_range="80/80",
            policy="accept",
            priority=1,
            protocol="tcp",
            source_cidr_block="10.*.*.0/24",
            source_port_range="80/80",
            traffic_direction="ingress",
            traffic_mirror_filter_id="tmf-3nqp5bt6a3dog931exxxxx")
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:vpc/trafficMirrorFilterRule:TrafficMirrorFilterRule example "traffic_mirror_filter_id|traffic_mirror_filter_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] destination_cidr_block: 目的网段。
        :param pulumi.Input[builtins.str] destination_port_range: 流量目的端口范围。当Protocol传入all或icmp时，无需传入本参数，默认取值-1/-1，表示不限制端口。当Protocol传入tcp或udp时，本参数为必选，取值范围1～65535，使用正斜线（/）隔开起始端口和终止端口，如1/50、80/80。
        :param pulumi.Input[builtins.str] policy: 流量采集策略。accept：允许。即当镜像源的流量匹配该规则时，复制该流量至镜像目标进行监控分析。reject：拒绝。即当镜像源的流量匹配该规则时，不复制该流量，拒绝对该流量进行监控分析。
        :param pulumi.Input[builtins.int] priority: 筛选规则的优先级，范围为1-1000。数值越小，优先级越高。默认为1，1为最高优先级。同一筛选条件同一方向的优先级唯一。
        :param pulumi.Input[builtins.str] protocol: 流量的协议。取值如下：all：含TCP、UDP、ICMP协议。tcp：TCP协议。udp：UDP协议。icmp：ICMP协议。
        :param pulumi.Input[builtins.str] source_cidr_block: 流量源网段。
        :param pulumi.Input[builtins.str] source_port_range: 流量源端口范围。当Protocol传入all或icmp时，无需传入本参数，默认取值-1/-1，表示不限制端口。当Protocol传入tcp或udp时，本参数为必选，取值范围1～65535，使用正斜线（/）隔开起始端口和终止端口，如1/50、80/80。
        :param pulumi.Input[builtins.str] traffic_direction: 流量的方向。取值如下：ingress：入向规则。egress：出向规则。
        :param pulumi.Input[builtins.str] traffic_mirror_filter_id: 筛选条件的ID。
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: TrafficMirrorFilterRuleArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        筛选条件由筛选规则组成，分为入向筛选规则和出向筛选规则。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        v_pc_traffic_mirror_filter_rule_demo = bytepluscc.vpc.TrafficMirrorFilterRule("VPCTrafficMirrorFilterRuleDemo",
            description="test",
            destination_cidr_block="10.*.*.0/24",
            destination_port_range="80/80",
            policy="accept",
            priority=1,
            protocol="tcp",
            source_cidr_block="10.*.*.0/24",
            source_port_range="80/80",
            traffic_direction="ingress",
            traffic_mirror_filter_id="tmf-3nqp5bt6a3dog931exxxxx")
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:vpc/trafficMirrorFilterRule:TrafficMirrorFilterRule example "traffic_mirror_filter_id|traffic_mirror_filter_rule_id"
        ```

        :param str resource_name: The name of the resource.
        :param TrafficMirrorFilterRuleArgs 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(TrafficMirrorFilterRuleArgs, 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,
                 destination_cidr_block: Optional[pulumi.Input[builtins.str]] = None,
                 destination_port_range: Optional[pulumi.Input[builtins.str]] = None,
                 policy: Optional[pulumi.Input[builtins.str]] = None,
                 priority: Optional[pulumi.Input[builtins.int]] = None,
                 protocol: Optional[pulumi.Input[builtins.str]] = None,
                 source_cidr_block: Optional[pulumi.Input[builtins.str]] = None,
                 source_port_range: Optional[pulumi.Input[builtins.str]] = None,
                 traffic_direction: Optional[pulumi.Input[builtins.str]] = None,
                 traffic_mirror_filter_id: 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__ = TrafficMirrorFilterRuleArgs.__new__(TrafficMirrorFilterRuleArgs)

            __props__.__dict__["description"] = description
            if destination_cidr_block is None and not opts.urn:
                raise TypeError("Missing required property 'destination_cidr_block'")
            __props__.__dict__["destination_cidr_block"] = destination_cidr_block
            __props__.__dict__["destination_port_range"] = destination_port_range
            if policy is None and not opts.urn:
                raise TypeError("Missing required property 'policy'")
            __props__.__dict__["policy"] = policy
            __props__.__dict__["priority"] = priority
            if protocol is None and not opts.urn:
                raise TypeError("Missing required property 'protocol'")
            __props__.__dict__["protocol"] = protocol
            if source_cidr_block is None and not opts.urn:
                raise TypeError("Missing required property 'source_cidr_block'")
            __props__.__dict__["source_cidr_block"] = source_cidr_block
            __props__.__dict__["source_port_range"] = source_port_range
            if traffic_direction is None and not opts.urn:
                raise TypeError("Missing required property 'traffic_direction'")
            __props__.__dict__["traffic_direction"] = traffic_direction
            if traffic_mirror_filter_id is None and not opts.urn:
                raise TypeError("Missing required property 'traffic_mirror_filter_id'")
            __props__.__dict__["traffic_mirror_filter_id"] = traffic_mirror_filter_id
            __props__.__dict__["status"] = None
            __props__.__dict__["traffic_mirror_filter_rule_id"] = None
        super(TrafficMirrorFilterRule, __self__).__init__(
            'bytepluscc:vpc/trafficMirrorFilterRule:TrafficMirrorFilterRule',
            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,
            destination_cidr_block: Optional[pulumi.Input[builtins.str]] = None,
            destination_port_range: Optional[pulumi.Input[builtins.str]] = None,
            policy: Optional[pulumi.Input[builtins.str]] = None,
            priority: Optional[pulumi.Input[builtins.int]] = None,
            protocol: Optional[pulumi.Input[builtins.str]] = None,
            source_cidr_block: Optional[pulumi.Input[builtins.str]] = None,
            source_port_range: Optional[pulumi.Input[builtins.str]] = None,
            status: Optional[pulumi.Input[builtins.str]] = None,
            traffic_direction: Optional[pulumi.Input[builtins.str]] = None,
            traffic_mirror_filter_id: Optional[pulumi.Input[builtins.str]] = None,
            traffic_mirror_filter_rule_id: Optional[pulumi.Input[builtins.str]] = None) -> 'TrafficMirrorFilterRule':
        """
        Get an existing TrafficMirrorFilterRule 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] destination_cidr_block: 目的网段。
        :param pulumi.Input[builtins.str] destination_port_range: 流量目的端口范围。当Protocol传入all或icmp时，无需传入本参数，默认取值-1/-1，表示不限制端口。当Protocol传入tcp或udp时，本参数为必选，取值范围1～65535，使用正斜线（/）隔开起始端口和终止端口，如1/50、80/80。
        :param pulumi.Input[builtins.str] policy: 流量采集策略。accept：允许。即当镜像源的流量匹配该规则时，复制该流量至镜像目标进行监控分析。reject：拒绝。即当镜像源的流量匹配该规则时，不复制该流量，拒绝对该流量进行监控分析。
        :param pulumi.Input[builtins.int] priority: 筛选规则的优先级，范围为1-1000。数值越小，优先级越高。默认为1，1为最高优先级。同一筛选条件同一方向的优先级唯一。
        :param pulumi.Input[builtins.str] protocol: 流量的协议。取值如下：all：含TCP、UDP、ICMP协议。tcp：TCP协议。udp：UDP协议。icmp：ICMP协议。
        :param pulumi.Input[builtins.str] source_cidr_block: 流量源网段。
        :param pulumi.Input[builtins.str] source_port_range: 流量源端口范围。当Protocol传入all或icmp时，无需传入本参数，默认取值-1/-1，表示不限制端口。当Protocol传入tcp或udp时，本参数为必选，取值范围1～65535，使用正斜线（/）隔开起始端口和终止端口，如1/50、80/80。
        :param pulumi.Input[builtins.str] status: 筛选规则的状态。Available：可用。Deleting：删除中。Creating：创建中。Pending：修改中。
        :param pulumi.Input[builtins.str] traffic_direction: 流量的方向。取值如下：ingress：入向规则。egress：出向规则。
        :param pulumi.Input[builtins.str] traffic_mirror_filter_id: 筛选条件的ID。
        :param pulumi.Input[builtins.str] traffic_mirror_filter_rule_id: 筛选规则的ID。
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _TrafficMirrorFilterRuleState.__new__(_TrafficMirrorFilterRuleState)

        __props__.__dict__["description"] = description
        __props__.__dict__["destination_cidr_block"] = destination_cidr_block
        __props__.__dict__["destination_port_range"] = destination_port_range
        __props__.__dict__["policy"] = policy
        __props__.__dict__["priority"] = priority
        __props__.__dict__["protocol"] = protocol
        __props__.__dict__["source_cidr_block"] = source_cidr_block
        __props__.__dict__["source_port_range"] = source_port_range
        __props__.__dict__["status"] = status
        __props__.__dict__["traffic_direction"] = traffic_direction
        __props__.__dict__["traffic_mirror_filter_id"] = traffic_mirror_filter_id
        __props__.__dict__["traffic_mirror_filter_rule_id"] = traffic_mirror_filter_rule_id
        return TrafficMirrorFilterRule(resource_name, opts=opts, __props__=__props__)

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

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

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

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

    @property
    @pulumi.getter
    def protocol(self) -> pulumi.Output[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) -> pulumi.Output[builtins.str]:
        """
        流量源网段。
        """
        return pulumi.get(self, "source_cidr_block")

    @property
    @pulumi.getter(name="sourcePortRange")
    def source_port_range(self) -> pulumi.Output[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) -> pulumi.Output[builtins.str]:
        """
        筛选规则的状态。Available：可用。Deleting：删除中。Creating：创建中。Pending：修改中。
        """
        return pulumi.get(self, "status")

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

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

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

