# 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__ = ['AntiBruteForceRuleArgs', 'AntiBruteForceRule']

@pulumi.input_type
class AntiBruteForceRuleArgs:
    def __init__(__self__, *,
                 anti_brute_force_rule_name: pulumi.Input[builtins.str],
                 fail_count: pulumi.Input[builtins.int],
                 forbidden_time: pulumi.Input[builtins.int],
                 span: pulumi.Input[builtins.int],
                 uuid_lists: pulumi.Input[Sequence[pulumi.Input[builtins.str]]],
                 default_rule: Optional[pulumi.Input[builtins.bool]] = None):
        """
        The set of arguments for constructing a AntiBruteForceRule resource.
        :param pulumi.Input[builtins.str] anti_brute_force_rule_name: The name of the defense rule.
        :param pulumi.Input[builtins.int] fail_count: FailCount
        :param pulumi.Input[builtins.int] forbidden_time: The period of time during which logons from an account are not allowed. Unit: minutes. Valid values:
        :param pulumi.Input[builtins.int] span: The maximum period of time during which failed logon attempts from an account can occur. Unit: minutes. Valid values:
        :param pulumi.Input[Sequence[pulumi.Input[builtins.str]]] uuid_lists: The UUIDs of the servers to which you want to apply the defense rule.
        :param pulumi.Input[builtins.bool] default_rule: Specifies whether to set the defense rule as the default rule. Valid values:
        """
        pulumi.set(__self__, "anti_brute_force_rule_name", anti_brute_force_rule_name)
        pulumi.set(__self__, "fail_count", fail_count)
        pulumi.set(__self__, "forbidden_time", forbidden_time)
        pulumi.set(__self__, "span", span)
        pulumi.set(__self__, "uuid_lists", uuid_lists)
        if default_rule is not None:
            pulumi.set(__self__, "default_rule", default_rule)

    @property
    @pulumi.getter(name="antiBruteForceRuleName")
    def anti_brute_force_rule_name(self) -> pulumi.Input[builtins.str]:
        """
        The name of the defense rule.
        """
        return pulumi.get(self, "anti_brute_force_rule_name")

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

    @property
    @pulumi.getter(name="failCount")
    def fail_count(self) -> pulumi.Input[builtins.int]:
        """
        FailCount
        """
        return pulumi.get(self, "fail_count")

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

    @property
    @pulumi.getter(name="forbiddenTime")
    def forbidden_time(self) -> pulumi.Input[builtins.int]:
        """
        The period of time during which logons from an account are not allowed. Unit: minutes. Valid values:
        """
        return pulumi.get(self, "forbidden_time")

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

    @property
    @pulumi.getter
    def span(self) -> pulumi.Input[builtins.int]:
        """
        The maximum period of time during which failed logon attempts from an account can occur. Unit: minutes. Valid values:
        """
        return pulumi.get(self, "span")

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

    @property
    @pulumi.getter(name="uuidLists")
    def uuid_lists(self) -> pulumi.Input[Sequence[pulumi.Input[builtins.str]]]:
        """
        The UUIDs of the servers to which you want to apply the defense rule.
        """
        return pulumi.get(self, "uuid_lists")

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

    @property
    @pulumi.getter(name="defaultRule")
    def default_rule(self) -> Optional[pulumi.Input[builtins.bool]]:
        """
        Specifies whether to set the defense rule as the default rule. Valid values:
        """
        return pulumi.get(self, "default_rule")

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


@pulumi.input_type
class _AntiBruteForceRuleState:
    def __init__(__self__, *,
                 anti_brute_force_rule_name: Optional[pulumi.Input[builtins.str]] = None,
                 default_rule: Optional[pulumi.Input[builtins.bool]] = None,
                 fail_count: Optional[pulumi.Input[builtins.int]] = None,
                 forbidden_time: Optional[pulumi.Input[builtins.int]] = None,
                 span: Optional[pulumi.Input[builtins.int]] = None,
                 uuid_lists: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]] = None):
        """
        Input properties used for looking up and filtering AntiBruteForceRule resources.
        :param pulumi.Input[builtins.str] anti_brute_force_rule_name: The name of the defense rule.
        :param pulumi.Input[builtins.bool] default_rule: Specifies whether to set the defense rule as the default rule. Valid values:
        :param pulumi.Input[builtins.int] fail_count: FailCount
        :param pulumi.Input[builtins.int] forbidden_time: The period of time during which logons from an account are not allowed. Unit: minutes. Valid values:
        :param pulumi.Input[builtins.int] span: The maximum period of time during which failed logon attempts from an account can occur. Unit: minutes. Valid values:
        :param pulumi.Input[Sequence[pulumi.Input[builtins.str]]] uuid_lists: The UUIDs of the servers to which you want to apply the defense rule.
        """
        if anti_brute_force_rule_name is not None:
            pulumi.set(__self__, "anti_brute_force_rule_name", anti_brute_force_rule_name)
        if default_rule is not None:
            pulumi.set(__self__, "default_rule", default_rule)
        if fail_count is not None:
            pulumi.set(__self__, "fail_count", fail_count)
        if forbidden_time is not None:
            pulumi.set(__self__, "forbidden_time", forbidden_time)
        if span is not None:
            pulumi.set(__self__, "span", span)
        if uuid_lists is not None:
            pulumi.set(__self__, "uuid_lists", uuid_lists)

    @property
    @pulumi.getter(name="antiBruteForceRuleName")
    def anti_brute_force_rule_name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        The name of the defense rule.
        """
        return pulumi.get(self, "anti_brute_force_rule_name")

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

    @property
    @pulumi.getter(name="defaultRule")
    def default_rule(self) -> Optional[pulumi.Input[builtins.bool]]:
        """
        Specifies whether to set the defense rule as the default rule. Valid values:
        """
        return pulumi.get(self, "default_rule")

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

    @property
    @pulumi.getter(name="failCount")
    def fail_count(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        FailCount
        """
        return pulumi.get(self, "fail_count")

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

    @property
    @pulumi.getter(name="forbiddenTime")
    def forbidden_time(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        The period of time during which logons from an account are not allowed. Unit: minutes. Valid values:
        """
        return pulumi.get(self, "forbidden_time")

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

    @property
    @pulumi.getter
    def span(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        The maximum period of time during which failed logon attempts from an account can occur. Unit: minutes. Valid values:
        """
        return pulumi.get(self, "span")

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

    @property
    @pulumi.getter(name="uuidLists")
    def uuid_lists(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]]:
        """
        The UUIDs of the servers to which you want to apply the defense rule.
        """
        return pulumi.get(self, "uuid_lists")

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


@pulumi.type_token("alicloud:threatdetection/antiBruteForceRule:AntiBruteForceRule")
class AntiBruteForceRule(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 anti_brute_force_rule_name: Optional[pulumi.Input[builtins.str]] = None,
                 default_rule: Optional[pulumi.Input[builtins.bool]] = None,
                 fail_count: Optional[pulumi.Input[builtins.int]] = None,
                 forbidden_time: Optional[pulumi.Input[builtins.int]] = None,
                 span: Optional[pulumi.Input[builtins.int]] = None,
                 uuid_lists: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]] = None,
                 __props__=None):
        """
        Provides a Threat Detection Anti Brute Force Rule resource.

        Anti-brute force cracking rules.

        For information about Threat Detection Anti Brute Force Rule and how to use it, see [What is Anti Brute Force Rule](https://www.alibabacloud.com/help/en/security-center/developer-reference/api-sas-2018-12-03-createantibruteforcerule).

        > **NOTE:** Available since v1.195.0.

        ## Example Usage

        Basic Usage

        ```python
        import pulumi
        import pulumi_alicloud as alicloud

        default = alicloud.threatdetection.AntiBruteForceRule("default",
            anti_brute_force_rule_name="apispec_example",
            forbidden_time=360,
            uuid_lists=["032b618f-b220-4a0d-bd37-fbdc6ef58b6a"],
            fail_count=80,
            span=10)
        ```

        ## Import

        Threat Detection Anti Brute Force Rule can be imported using the id, e.g.

        ```sh
        $ pulumi import alicloud:threatdetection/antiBruteForceRule:AntiBruteForceRule example <id>
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] anti_brute_force_rule_name: The name of the defense rule.
        :param pulumi.Input[builtins.bool] default_rule: Specifies whether to set the defense rule as the default rule. Valid values:
        :param pulumi.Input[builtins.int] fail_count: FailCount
        :param pulumi.Input[builtins.int] forbidden_time: The period of time during which logons from an account are not allowed. Unit: minutes. Valid values:
        :param pulumi.Input[builtins.int] span: The maximum period of time during which failed logon attempts from an account can occur. Unit: minutes. Valid values:
        :param pulumi.Input[Sequence[pulumi.Input[builtins.str]]] uuid_lists: The UUIDs of the servers to which you want to apply the defense rule.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: AntiBruteForceRuleArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Provides a Threat Detection Anti Brute Force Rule resource.

        Anti-brute force cracking rules.

        For information about Threat Detection Anti Brute Force Rule and how to use it, see [What is Anti Brute Force Rule](https://www.alibabacloud.com/help/en/security-center/developer-reference/api-sas-2018-12-03-createantibruteforcerule).

        > **NOTE:** Available since v1.195.0.

        ## Example Usage

        Basic Usage

        ```python
        import pulumi
        import pulumi_alicloud as alicloud

        default = alicloud.threatdetection.AntiBruteForceRule("default",
            anti_brute_force_rule_name="apispec_example",
            forbidden_time=360,
            uuid_lists=["032b618f-b220-4a0d-bd37-fbdc6ef58b6a"],
            fail_count=80,
            span=10)
        ```

        ## Import

        Threat Detection Anti Brute Force Rule can be imported using the id, e.g.

        ```sh
        $ pulumi import alicloud:threatdetection/antiBruteForceRule:AntiBruteForceRule example <id>
        ```

        :param str resource_name: The name of the resource.
        :param AntiBruteForceRuleArgs 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(AntiBruteForceRuleArgs, 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,
                 anti_brute_force_rule_name: Optional[pulumi.Input[builtins.str]] = None,
                 default_rule: Optional[pulumi.Input[builtins.bool]] = None,
                 fail_count: Optional[pulumi.Input[builtins.int]] = None,
                 forbidden_time: Optional[pulumi.Input[builtins.int]] = None,
                 span: Optional[pulumi.Input[builtins.int]] = None,
                 uuid_lists: Optional[pulumi.Input[Sequence[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__ = AntiBruteForceRuleArgs.__new__(AntiBruteForceRuleArgs)

            if anti_brute_force_rule_name is None and not opts.urn:
                raise TypeError("Missing required property 'anti_brute_force_rule_name'")
            __props__.__dict__["anti_brute_force_rule_name"] = anti_brute_force_rule_name
            __props__.__dict__["default_rule"] = default_rule
            if fail_count is None and not opts.urn:
                raise TypeError("Missing required property 'fail_count'")
            __props__.__dict__["fail_count"] = fail_count
            if forbidden_time is None and not opts.urn:
                raise TypeError("Missing required property 'forbidden_time'")
            __props__.__dict__["forbidden_time"] = forbidden_time
            if span is None and not opts.urn:
                raise TypeError("Missing required property 'span'")
            __props__.__dict__["span"] = span
            if uuid_lists is None and not opts.urn:
                raise TypeError("Missing required property 'uuid_lists'")
            __props__.__dict__["uuid_lists"] = uuid_lists
        super(AntiBruteForceRule, __self__).__init__(
            'alicloud:threatdetection/antiBruteForceRule:AntiBruteForceRule',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            anti_brute_force_rule_name: Optional[pulumi.Input[builtins.str]] = None,
            default_rule: Optional[pulumi.Input[builtins.bool]] = None,
            fail_count: Optional[pulumi.Input[builtins.int]] = None,
            forbidden_time: Optional[pulumi.Input[builtins.int]] = None,
            span: Optional[pulumi.Input[builtins.int]] = None,
            uuid_lists: Optional[pulumi.Input[Sequence[pulumi.Input[builtins.str]]]] = None) -> 'AntiBruteForceRule':
        """
        Get an existing AntiBruteForceRule 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] anti_brute_force_rule_name: The name of the defense rule.
        :param pulumi.Input[builtins.bool] default_rule: Specifies whether to set the defense rule as the default rule. Valid values:
        :param pulumi.Input[builtins.int] fail_count: FailCount
        :param pulumi.Input[builtins.int] forbidden_time: The period of time during which logons from an account are not allowed. Unit: minutes. Valid values:
        :param pulumi.Input[builtins.int] span: The maximum period of time during which failed logon attempts from an account can occur. Unit: minutes. Valid values:
        :param pulumi.Input[Sequence[pulumi.Input[builtins.str]]] uuid_lists: The UUIDs of the servers to which you want to apply the defense rule.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _AntiBruteForceRuleState.__new__(_AntiBruteForceRuleState)

        __props__.__dict__["anti_brute_force_rule_name"] = anti_brute_force_rule_name
        __props__.__dict__["default_rule"] = default_rule
        __props__.__dict__["fail_count"] = fail_count
        __props__.__dict__["forbidden_time"] = forbidden_time
        __props__.__dict__["span"] = span
        __props__.__dict__["uuid_lists"] = uuid_lists
        return AntiBruteForceRule(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="antiBruteForceRuleName")
    def anti_brute_force_rule_name(self) -> pulumi.Output[builtins.str]:
        """
        The name of the defense rule.
        """
        return pulumi.get(self, "anti_brute_force_rule_name")

    @property
    @pulumi.getter(name="defaultRule")
    def default_rule(self) -> pulumi.Output[Optional[builtins.bool]]:
        """
        Specifies whether to set the defense rule as the default rule. Valid values:
        """
        return pulumi.get(self, "default_rule")

    @property
    @pulumi.getter(name="failCount")
    def fail_count(self) -> pulumi.Output[builtins.int]:
        """
        FailCount
        """
        return pulumi.get(self, "fail_count")

    @property
    @pulumi.getter(name="forbiddenTime")
    def forbidden_time(self) -> pulumi.Output[builtins.int]:
        """
        The period of time during which logons from an account are not allowed. Unit: minutes. Valid values:
        """
        return pulumi.get(self, "forbidden_time")

    @property
    @pulumi.getter
    def span(self) -> pulumi.Output[builtins.int]:
        """
        The maximum period of time during which failed logon attempts from an account can occur. Unit: minutes. Valid values:
        """
        return pulumi.get(self, "span")

    @property
    @pulumi.getter(name="uuidLists")
    def uuid_lists(self) -> pulumi.Output[Sequence[builtins.str]]:
        """
        The UUIDs of the servers to which you want to apply the defense rule.
        """
        return pulumi.get(self, "uuid_lists")

