# 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__ = ['KeyRingArgs', 'KeyRing']

@pulumi.input_type
class KeyRingArgs:
    def __init__(__self__, *,
                 keyring_name: pulumi.Input[builtins.str],
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 keyring_type: Optional[pulumi.Input[builtins.str]] = None,
                 project_name: Optional[pulumi.Input[builtins.str]] = None):
        """
        The set of arguments for constructing a KeyRing resource.
        :param pulumi.Input[builtins.str] keyring_name: 密钥环名称，长度为 2   - 31 个字符。合法字符：[a-zA-Z0-9-_]。
        :param pulumi.Input[builtins.str] description: 密钥环描述，长度为 0   - 8192 个字符。
        :param pulumi.Input[builtins.str] keyring_type: 密钥环类型，取值：CustomKeyring。
        :param pulumi.Input[builtins.str] project_name: 项目名称，默认值：default。
        """
        pulumi.set(__self__, "keyring_name", keyring_name)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if keyring_type is not None:
            pulumi.set(__self__, "keyring_type", keyring_type)
        if project_name is not None:
            pulumi.set(__self__, "project_name", project_name)

    @property
    @pulumi.getter(name="keyringName")
    def keyring_name(self) -> pulumi.Input[builtins.str]:
        """
        密钥环名称，长度为 2   - 31 个字符。合法字符：[a-zA-Z0-9-_]。
        """
        return pulumi.get(self, "keyring_name")

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

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥环描述，长度为 0   - 8192 个字符。
        """
        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="keyringType")
    def keyring_type(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥环类型，取值：CustomKeyring。
        """
        return pulumi.get(self, "keyring_type")

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

    @property
    @pulumi.getter(name="projectName")
    def project_name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        项目名称，默认值：default。
        """
        return pulumi.get(self, "project_name")

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


@pulumi.input_type
class _KeyRingState:
    def __init__(__self__, *,
                 create_date: Optional[pulumi.Input[builtins.int]] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 key_count: Optional[pulumi.Input[builtins.int]] = None,
                 key_ring_id: Optional[pulumi.Input[builtins.str]] = None,
                 keyring_name: Optional[pulumi.Input[builtins.str]] = None,
                 keyring_type: Optional[pulumi.Input[builtins.str]] = None,
                 project_name: Optional[pulumi.Input[builtins.str]] = None,
                 uid: Optional[pulumi.Input[builtins.str]] = None,
                 update_date: Optional[pulumi.Input[builtins.int]] = None):
        """
        Input properties used for looking up and filtering KeyRing resources.
        :param pulumi.Input[builtins.int] create_date: 密钥环创建日期。
        :param pulumi.Input[builtins.str] description: 密钥环描述，长度为 0   - 8192 个字符。
        :param pulumi.Input[builtins.int] key_count: 密钥环密钥次数。
        :param pulumi.Input[builtins.str] key_ring_id: 密钥环唯一标识符，UUID形式。
        :param pulumi.Input[builtins.str] keyring_name: 密钥环名称，长度为 2   - 31 个字符。合法字符：[a-zA-Z0-9-_]。
        :param pulumi.Input[builtins.str] keyring_type: 密钥环类型，取值：CustomKeyring。
        :param pulumi.Input[builtins.str] project_name: 项目名称，默认值：default。
        :param pulumi.Input[builtins.str] uid: 密钥环租户ID。
        :param pulumi.Input[builtins.int] update_date: 密钥环更新日期。
        """
        if create_date is not None:
            pulumi.set(__self__, "create_date", create_date)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if key_count is not None:
            pulumi.set(__self__, "key_count", key_count)
        if key_ring_id is not None:
            pulumi.set(__self__, "key_ring_id", key_ring_id)
        if keyring_name is not None:
            pulumi.set(__self__, "keyring_name", keyring_name)
        if keyring_type is not None:
            pulumi.set(__self__, "keyring_type", keyring_type)
        if project_name is not None:
            pulumi.set(__self__, "project_name", project_name)
        if uid is not None:
            pulumi.set(__self__, "uid", uid)
        if update_date is not None:
            pulumi.set(__self__, "update_date", update_date)

    @property
    @pulumi.getter(name="createDate")
    def create_date(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        密钥环创建日期。
        """
        return pulumi.get(self, "create_date")

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

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥环描述，长度为 0   - 8192 个字符。
        """
        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="keyCount")
    def key_count(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        密钥环密钥次数。
        """
        return pulumi.get(self, "key_count")

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

    @property
    @pulumi.getter(name="keyRingId")
    def key_ring_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥环唯一标识符，UUID形式。
        """
        return pulumi.get(self, "key_ring_id")

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

    @property
    @pulumi.getter(name="keyringName")
    def keyring_name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥环名称，长度为 2   - 31 个字符。合法字符：[a-zA-Z0-9-_]。
        """
        return pulumi.get(self, "keyring_name")

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

    @property
    @pulumi.getter(name="keyringType")
    def keyring_type(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥环类型，取值：CustomKeyring。
        """
        return pulumi.get(self, "keyring_type")

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

    @property
    @pulumi.getter(name="projectName")
    def project_name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        项目名称，默认值：default。
        """
        return pulumi.get(self, "project_name")

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

    @property
    @pulumi.getter
    def uid(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥环租户ID。
        """
        return pulumi.get(self, "uid")

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

    @property
    @pulumi.getter(name="updateDate")
    def update_date(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        密钥环更新日期。
        """
        return pulumi.get(self, "update_date")

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


@pulumi.type_token("bytepluscc:kms/keyRing:KeyRing")
class KeyRing(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 keyring_name: Optional[pulumi.Input[builtins.str]] = None,
                 keyring_type: Optional[pulumi.Input[builtins.str]] = None,
                 project_name: Optional[pulumi.Input[builtins.str]] = None,
                 __props__=None):
        """
        用户管理密钥的集合，用户将相同类型或用途的密钥放在同一密钥环中以便于管理。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        kmskeyring_demo = bytepluscc.kms.KeyRing("kmskeyringDemo",
            description="this is a test update",
            keyring_name="ccapi-test",
            keyring_type="CustomKeyring",
            project_name="default")
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:kms/keyRing:KeyRing example "key_ring_id"
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] description: 密钥环描述，长度为 0   - 8192 个字符。
        :param pulumi.Input[builtins.str] keyring_name: 密钥环名称，长度为 2   - 31 个字符。合法字符：[a-zA-Z0-9-_]。
        :param pulumi.Input[builtins.str] keyring_type: 密钥环类型，取值：CustomKeyring。
        :param pulumi.Input[builtins.str] project_name: 项目名称，默认值：default。
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: KeyRingArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        用户管理密钥的集合，用户将相同类型或用途的密钥放在同一密钥环中以便于管理。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        kmskeyring_demo = bytepluscc.kms.KeyRing("kmskeyringDemo",
            description="this is a test update",
            keyring_name="ccapi-test",
            keyring_type="CustomKeyring",
            project_name="default")
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:kms/keyRing:KeyRing example "key_ring_id"
        ```

        :param str resource_name: The name of the resource.
        :param KeyRingArgs 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(KeyRingArgs, 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,
                 keyring_name: Optional[pulumi.Input[builtins.str]] = None,
                 keyring_type: Optional[pulumi.Input[builtins.str]] = None,
                 project_name: 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__ = KeyRingArgs.__new__(KeyRingArgs)

            __props__.__dict__["description"] = description
            if keyring_name is None and not opts.urn:
                raise TypeError("Missing required property 'keyring_name'")
            __props__.__dict__["keyring_name"] = keyring_name
            __props__.__dict__["keyring_type"] = keyring_type
            __props__.__dict__["project_name"] = project_name
            __props__.__dict__["create_date"] = None
            __props__.__dict__["key_count"] = None
            __props__.__dict__["key_ring_id"] = None
            __props__.__dict__["uid"] = None
            __props__.__dict__["update_date"] = None
        super(KeyRing, __self__).__init__(
            'bytepluscc:kms/keyRing:KeyRing',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            create_date: Optional[pulumi.Input[builtins.int]] = None,
            description: Optional[pulumi.Input[builtins.str]] = None,
            key_count: Optional[pulumi.Input[builtins.int]] = None,
            key_ring_id: Optional[pulumi.Input[builtins.str]] = None,
            keyring_name: Optional[pulumi.Input[builtins.str]] = None,
            keyring_type: Optional[pulumi.Input[builtins.str]] = None,
            project_name: Optional[pulumi.Input[builtins.str]] = None,
            uid: Optional[pulumi.Input[builtins.str]] = None,
            update_date: Optional[pulumi.Input[builtins.int]] = None) -> 'KeyRing':
        """
        Get an existing KeyRing 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.int] create_date: 密钥环创建日期。
        :param pulumi.Input[builtins.str] description: 密钥环描述，长度为 0   - 8192 个字符。
        :param pulumi.Input[builtins.int] key_count: 密钥环密钥次数。
        :param pulumi.Input[builtins.str] key_ring_id: 密钥环唯一标识符，UUID形式。
        :param pulumi.Input[builtins.str] keyring_name: 密钥环名称，长度为 2   - 31 个字符。合法字符：[a-zA-Z0-9-_]。
        :param pulumi.Input[builtins.str] keyring_type: 密钥环类型，取值：CustomKeyring。
        :param pulumi.Input[builtins.str] project_name: 项目名称，默认值：default。
        :param pulumi.Input[builtins.str] uid: 密钥环租户ID。
        :param pulumi.Input[builtins.int] update_date: 密钥环更新日期。
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _KeyRingState.__new__(_KeyRingState)

        __props__.__dict__["create_date"] = create_date
        __props__.__dict__["description"] = description
        __props__.__dict__["key_count"] = key_count
        __props__.__dict__["key_ring_id"] = key_ring_id
        __props__.__dict__["keyring_name"] = keyring_name
        __props__.__dict__["keyring_type"] = keyring_type
        __props__.__dict__["project_name"] = project_name
        __props__.__dict__["uid"] = uid
        __props__.__dict__["update_date"] = update_date
        return KeyRing(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="createDate")
    def create_date(self) -> pulumi.Output[builtins.int]:
        """
        密钥环创建日期。
        """
        return pulumi.get(self, "create_date")

    @property
    @pulumi.getter
    def description(self) -> pulumi.Output[builtins.str]:
        """
        密钥环描述，长度为 0   - 8192 个字符。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="keyCount")
    def key_count(self) -> pulumi.Output[builtins.int]:
        """
        密钥环密钥次数。
        """
        return pulumi.get(self, "key_count")

    @property
    @pulumi.getter(name="keyRingId")
    def key_ring_id(self) -> pulumi.Output[builtins.str]:
        """
        密钥环唯一标识符，UUID形式。
        """
        return pulumi.get(self, "key_ring_id")

    @property
    @pulumi.getter(name="keyringName")
    def keyring_name(self) -> pulumi.Output[builtins.str]:
        """
        密钥环名称，长度为 2   - 31 个字符。合法字符：[a-zA-Z0-9-_]。
        """
        return pulumi.get(self, "keyring_name")

    @property
    @pulumi.getter(name="keyringType")
    def keyring_type(self) -> pulumi.Output[builtins.str]:
        """
        密钥环类型，取值：CustomKeyring。
        """
        return pulumi.get(self, "keyring_type")

    @property
    @pulumi.getter(name="projectName")
    def project_name(self) -> pulumi.Output[builtins.str]:
        """
        项目名称，默认值：default。
        """
        return pulumi.get(self, "project_name")

    @property
    @pulumi.getter
    def uid(self) -> pulumi.Output[builtins.str]:
        """
        密钥环租户ID。
        """
        return pulumi.get(self, "uid")

    @property
    @pulumi.getter(name="updateDate")
    def update_date(self) -> pulumi.Output[builtins.int]:
        """
        密钥环更新日期。
        """
        return pulumi.get(self, "update_date")

