# 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__ = ['AllowListArgs', 'AllowList']

@pulumi.input_type
class AllowListArgs:
    def __init__(__self__, *,
                 allow_list: pulumi.Input[builtins.str],
                 allow_list_name: pulumi.Input[builtins.str],
                 allow_list_desc: Optional[pulumi.Input[builtins.str]] = None,
                 apply_instance_num: Optional[pulumi.Input[builtins.int]] = None,
                 associated_instances: Optional[pulumi.Input[Sequence[pulumi.Input['AllowListAssociatedInstanceArgs']]]] = None):
        """
        The set of arguments for constructing a AllowList resource.
        :param pulumi.Input[builtins.str] allow_list: 白名单规则列表。支持指定为 IP 地址或者 IP 网段。多个 IP 地址或网段之间使用英文逗号（,）分隔。每个白名单最多可配置 300 个 IP 地址或网段。
        :param pulumi.Input[builtins.str] allow_list_name: 白名单规则名称。长度为 1～128 个字符。只能包含中文、字母、数字、下划线和连字符（-）。不能以数字或连字符（-）开头。白名单名称在当前地域下唯一。
        :param pulumi.Input[builtins.str] allow_list_desc: 白名单描述。长度不超过200个字符。
        :param pulumi.Input[builtins.int] apply_instance_num: 此白名单已绑定的实例数量。若指定 AllowList 参数，则此字段必填，用于指定规则修改后预期将会影响到的实例个数。若预期影响个数与实际影响个数不符，则请求失败。
        """
        pulumi.set(__self__, "allow_list", allow_list)
        pulumi.set(__self__, "allow_list_name", allow_list_name)
        if allow_list_desc is not None:
            pulumi.set(__self__, "allow_list_desc", allow_list_desc)
        if apply_instance_num is not None:
            pulumi.set(__self__, "apply_instance_num", apply_instance_num)
        if associated_instances is not None:
            pulumi.set(__self__, "associated_instances", associated_instances)

    @property
    @pulumi.getter(name="allowList")
    def allow_list(self) -> pulumi.Input[builtins.str]:
        """
        白名单规则列表。支持指定为 IP 地址或者 IP 网段。多个 IP 地址或网段之间使用英文逗号（,）分隔。每个白名单最多可配置 300 个 IP 地址或网段。
        """
        return pulumi.get(self, "allow_list")

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

    @property
    @pulumi.getter(name="allowListName")
    def allow_list_name(self) -> pulumi.Input[builtins.str]:
        """
        白名单规则名称。长度为 1～128 个字符。只能包含中文、字母、数字、下划线和连字符（-）。不能以数字或连字符（-）开头。白名单名称在当前地域下唯一。
        """
        return pulumi.get(self, "allow_list_name")

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

    @property
    @pulumi.getter(name="allowListDesc")
    def allow_list_desc(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        白名单描述。长度不超过200个字符。
        """
        return pulumi.get(self, "allow_list_desc")

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

    @property
    @pulumi.getter(name="applyInstanceNum")
    def apply_instance_num(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        此白名单已绑定的实例数量。若指定 AllowList 参数，则此字段必填，用于指定规则修改后预期将会影响到的实例个数。若预期影响个数与实际影响个数不符，则请求失败。
        """
        return pulumi.get(self, "apply_instance_num")

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

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

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


@pulumi.input_type
class _AllowListState:
    def __init__(__self__, *,
                 allow_list: Optional[pulumi.Input[builtins.str]] = None,
                 allow_list_desc: Optional[pulumi.Input[builtins.str]] = None,
                 allow_list_id: Optional[pulumi.Input[builtins.str]] = None,
                 allow_list_ip_num: Optional[pulumi.Input[builtins.int]] = None,
                 allow_list_name: Optional[pulumi.Input[builtins.str]] = None,
                 apply_instance_num: Optional[pulumi.Input[builtins.int]] = None,
                 associated_instance_num: Optional[pulumi.Input[builtins.int]] = None,
                 associated_instances: Optional[pulumi.Input[Sequence[pulumi.Input['AllowListAssociatedInstanceArgs']]]] = None):
        """
        Input properties used for looking up and filtering AllowList resources.
        :param pulumi.Input[builtins.str] allow_list: 白名单规则列表。支持指定为 IP 地址或者 IP 网段。多个 IP 地址或网段之间使用英文逗号（,）分隔。每个白名单最多可配置 300 个 IP 地址或网段。
        :param pulumi.Input[builtins.str] allow_list_desc: 白名单描述。长度不超过200个字符。
        :param pulumi.Input[builtins.str] allow_list_id: 白名单 ID。
        :param pulumi.Input[builtins.int] allow_list_ip_num: 白名单指定的规则个数。
        :param pulumi.Input[builtins.str] allow_list_name: 白名单规则名称。长度为 1～128 个字符。只能包含中文、字母、数字、下划线和连字符（-）。不能以数字或连字符（-）开头。白名单名称在当前地域下唯一。
        :param pulumi.Input[builtins.int] apply_instance_num: 此白名单已绑定的实例数量。若指定 AllowList 参数，则此字段必填，用于指定规则修改后预期将会影响到的实例个数。若预期影响个数与实际影响个数不符，则请求失败。
        :param pulumi.Input[builtins.int] associated_instance_num: 白名单绑定的实例个数。
        """
        if allow_list is not None:
            pulumi.set(__self__, "allow_list", allow_list)
        if allow_list_desc is not None:
            pulumi.set(__self__, "allow_list_desc", allow_list_desc)
        if allow_list_id is not None:
            pulumi.set(__self__, "allow_list_id", allow_list_id)
        if allow_list_ip_num is not None:
            pulumi.set(__self__, "allow_list_ip_num", allow_list_ip_num)
        if allow_list_name is not None:
            pulumi.set(__self__, "allow_list_name", allow_list_name)
        if apply_instance_num is not None:
            pulumi.set(__self__, "apply_instance_num", apply_instance_num)
        if associated_instance_num is not None:
            pulumi.set(__self__, "associated_instance_num", associated_instance_num)
        if associated_instances is not None:
            pulumi.set(__self__, "associated_instances", associated_instances)

    @property
    @pulumi.getter(name="allowList")
    def allow_list(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        白名单规则列表。支持指定为 IP 地址或者 IP 网段。多个 IP 地址或网段之间使用英文逗号（,）分隔。每个白名单最多可配置 300 个 IP 地址或网段。
        """
        return pulumi.get(self, "allow_list")

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

    @property
    @pulumi.getter(name="allowListDesc")
    def allow_list_desc(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        白名单描述。长度不超过200个字符。
        """
        return pulumi.get(self, "allow_list_desc")

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

    @property
    @pulumi.getter(name="allowListId")
    def allow_list_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        白名单 ID。
        """
        return pulumi.get(self, "allow_list_id")

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

    @property
    @pulumi.getter(name="allowListIpNum")
    def allow_list_ip_num(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        白名单指定的规则个数。
        """
        return pulumi.get(self, "allow_list_ip_num")

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

    @property
    @pulumi.getter(name="allowListName")
    def allow_list_name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        白名单规则名称。长度为 1～128 个字符。只能包含中文、字母、数字、下划线和连字符（-）。不能以数字或连字符（-）开头。白名单名称在当前地域下唯一。
        """
        return pulumi.get(self, "allow_list_name")

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

    @property
    @pulumi.getter(name="applyInstanceNum")
    def apply_instance_num(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        此白名单已绑定的实例数量。若指定 AllowList 参数，则此字段必填，用于指定规则修改后预期将会影响到的实例个数。若预期影响个数与实际影响个数不符，则请求失败。
        """
        return pulumi.get(self, "apply_instance_num")

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

    @property
    @pulumi.getter(name="associatedInstanceNum")
    def associated_instance_num(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        白名单绑定的实例个数。
        """
        return pulumi.get(self, "associated_instance_num")

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

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

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


@pulumi.type_token("bytepluscc:kafka/allowList:AllowList")
class AllowList(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 allow_list: Optional[pulumi.Input[builtins.str]] = None,
                 allow_list_desc: Optional[pulumi.Input[builtins.str]] = None,
                 allow_list_name: Optional[pulumi.Input[builtins.str]] = None,
                 apply_instance_num: Optional[pulumi.Input[builtins.int]] = None,
                 associated_instances: Optional[pulumi.Input[Sequence[pulumi.Input[Union['AllowListAssociatedInstanceArgs', 'AllowListAssociatedInstanceArgsDict']]]]] = None,
                 __props__=None):
        """
        创建 Kafka 实例时，可以按需为其绑定白名单，绑定白名单与 Kafka 实例之后，仅配置在白名单中的 IP 地址与地址段才能访问消息队列 Kafka版实例。安全起见，建议您创建白名单，并将客户端的 IP 地址或 IP 地址段添加到 Kafka 实例的白名单中。建议您定期维护和管理白名单，提高 Kafka 实例访问的安全性。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        kafka_allow_list_demo = bytepluscc.index.KafkaAllowlist("KafkaAllowListDemo",
            allow_list=127.0.0.2,
            allow_list_desc=test,
            allow_list_name=ccapi-text,
            associated_instances=[
                {
                    instanceId: kafka-cnng9x9s***,
                },
                {
                    instanceId: kafka-cnnghf99**,
                },
            ],
            apply_instance_num=2)
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:kafka/allowList:AllowList example "allow_list_id"
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] allow_list: 白名单规则列表。支持指定为 IP 地址或者 IP 网段。多个 IP 地址或网段之间使用英文逗号（,）分隔。每个白名单最多可配置 300 个 IP 地址或网段。
        :param pulumi.Input[builtins.str] allow_list_desc: 白名单描述。长度不超过200个字符。
        :param pulumi.Input[builtins.str] allow_list_name: 白名单规则名称。长度为 1～128 个字符。只能包含中文、字母、数字、下划线和连字符（-）。不能以数字或连字符（-）开头。白名单名称在当前地域下唯一。
        :param pulumi.Input[builtins.int] apply_instance_num: 此白名单已绑定的实例数量。若指定 AllowList 参数，则此字段必填，用于指定规则修改后预期将会影响到的实例个数。若预期影响个数与实际影响个数不符，则请求失败。
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: AllowListArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        创建 Kafka 实例时，可以按需为其绑定白名单，绑定白名单与 Kafka 实例之后，仅配置在白名单中的 IP 地址与地址段才能访问消息队列 Kafka版实例。安全起见，建议您创建白名单，并将客户端的 IP 地址或 IP 地址段添加到 Kafka 实例的白名单中。建议您定期维护和管理白名单，提高 Kafka 实例访问的安全性。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        kafka_allow_list_demo = bytepluscc.index.KafkaAllowlist("KafkaAllowListDemo",
            allow_list=127.0.0.2,
            allow_list_desc=test,
            allow_list_name=ccapi-text,
            associated_instances=[
                {
                    instanceId: kafka-cnng9x9s***,
                },
                {
                    instanceId: kafka-cnnghf99**,
                },
            ],
            apply_instance_num=2)
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:kafka/allowList:AllowList example "allow_list_id"
        ```

        :param str resource_name: The name of the resource.
        :param AllowListArgs 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(AllowListArgs, 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,
                 allow_list: Optional[pulumi.Input[builtins.str]] = None,
                 allow_list_desc: Optional[pulumi.Input[builtins.str]] = None,
                 allow_list_name: Optional[pulumi.Input[builtins.str]] = None,
                 apply_instance_num: Optional[pulumi.Input[builtins.int]] = None,
                 associated_instances: Optional[pulumi.Input[Sequence[pulumi.Input[Union['AllowListAssociatedInstanceArgs', 'AllowListAssociatedInstanceArgsDict']]]]] = 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__ = AllowListArgs.__new__(AllowListArgs)

            if allow_list is None and not opts.urn:
                raise TypeError("Missing required property 'allow_list'")
            __props__.__dict__["allow_list"] = allow_list
            __props__.__dict__["allow_list_desc"] = allow_list_desc
            if allow_list_name is None and not opts.urn:
                raise TypeError("Missing required property 'allow_list_name'")
            __props__.__dict__["allow_list_name"] = allow_list_name
            __props__.__dict__["apply_instance_num"] = apply_instance_num
            __props__.__dict__["associated_instances"] = associated_instances
            __props__.__dict__["allow_list_id"] = None
            __props__.__dict__["allow_list_ip_num"] = None
            __props__.__dict__["associated_instance_num"] = None
        super(AllowList, __self__).__init__(
            'bytepluscc:kafka/allowList:AllowList',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            allow_list: Optional[pulumi.Input[builtins.str]] = None,
            allow_list_desc: Optional[pulumi.Input[builtins.str]] = None,
            allow_list_id: Optional[pulumi.Input[builtins.str]] = None,
            allow_list_ip_num: Optional[pulumi.Input[builtins.int]] = None,
            allow_list_name: Optional[pulumi.Input[builtins.str]] = None,
            apply_instance_num: Optional[pulumi.Input[builtins.int]] = None,
            associated_instance_num: Optional[pulumi.Input[builtins.int]] = None,
            associated_instances: Optional[pulumi.Input[Sequence[pulumi.Input[Union['AllowListAssociatedInstanceArgs', 'AllowListAssociatedInstanceArgsDict']]]]] = None) -> 'AllowList':
        """
        Get an existing AllowList 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] allow_list: 白名单规则列表。支持指定为 IP 地址或者 IP 网段。多个 IP 地址或网段之间使用英文逗号（,）分隔。每个白名单最多可配置 300 个 IP 地址或网段。
        :param pulumi.Input[builtins.str] allow_list_desc: 白名单描述。长度不超过200个字符。
        :param pulumi.Input[builtins.str] allow_list_id: 白名单 ID。
        :param pulumi.Input[builtins.int] allow_list_ip_num: 白名单指定的规则个数。
        :param pulumi.Input[builtins.str] allow_list_name: 白名单规则名称。长度为 1～128 个字符。只能包含中文、字母、数字、下划线和连字符（-）。不能以数字或连字符（-）开头。白名单名称在当前地域下唯一。
        :param pulumi.Input[builtins.int] apply_instance_num: 此白名单已绑定的实例数量。若指定 AllowList 参数，则此字段必填，用于指定规则修改后预期将会影响到的实例个数。若预期影响个数与实际影响个数不符，则请求失败。
        :param pulumi.Input[builtins.int] associated_instance_num: 白名单绑定的实例个数。
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _AllowListState.__new__(_AllowListState)

        __props__.__dict__["allow_list"] = allow_list
        __props__.__dict__["allow_list_desc"] = allow_list_desc
        __props__.__dict__["allow_list_id"] = allow_list_id
        __props__.__dict__["allow_list_ip_num"] = allow_list_ip_num
        __props__.__dict__["allow_list_name"] = allow_list_name
        __props__.__dict__["apply_instance_num"] = apply_instance_num
        __props__.__dict__["associated_instance_num"] = associated_instance_num
        __props__.__dict__["associated_instances"] = associated_instances
        return AllowList(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="allowList")
    def allow_list(self) -> pulumi.Output[builtins.str]:
        """
        白名单规则列表。支持指定为 IP 地址或者 IP 网段。多个 IP 地址或网段之间使用英文逗号（,）分隔。每个白名单最多可配置 300 个 IP 地址或网段。
        """
        return pulumi.get(self, "allow_list")

    @property
    @pulumi.getter(name="allowListDesc")
    def allow_list_desc(self) -> pulumi.Output[builtins.str]:
        """
        白名单描述。长度不超过200个字符。
        """
        return pulumi.get(self, "allow_list_desc")

    @property
    @pulumi.getter(name="allowListId")
    def allow_list_id(self) -> pulumi.Output[builtins.str]:
        """
        白名单 ID。
        """
        return pulumi.get(self, "allow_list_id")

    @property
    @pulumi.getter(name="allowListIpNum")
    def allow_list_ip_num(self) -> pulumi.Output[builtins.int]:
        """
        白名单指定的规则个数。
        """
        return pulumi.get(self, "allow_list_ip_num")

    @property
    @pulumi.getter(name="allowListName")
    def allow_list_name(self) -> pulumi.Output[builtins.str]:
        """
        白名单规则名称。长度为 1～128 个字符。只能包含中文、字母、数字、下划线和连字符（-）。不能以数字或连字符（-）开头。白名单名称在当前地域下唯一。
        """
        return pulumi.get(self, "allow_list_name")

    @property
    @pulumi.getter(name="applyInstanceNum")
    def apply_instance_num(self) -> pulumi.Output[builtins.int]:
        """
        此白名单已绑定的实例数量。若指定 AllowList 参数，则此字段必填，用于指定规则修改后预期将会影响到的实例个数。若预期影响个数与实际影响个数不符，则请求失败。
        """
        return pulumi.get(self, "apply_instance_num")

    @property
    @pulumi.getter(name="associatedInstanceNum")
    def associated_instance_num(self) -> pulumi.Output[builtins.int]:
        """
        白名单绑定的实例个数。
        """
        return pulumi.get(self, "associated_instance_num")

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

