# 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__ = ['KeyArgs', 'Key']

@pulumi.input_type
class KeyArgs:
    def __init__(__self__, *,
                 key_name: pulumi.Input[builtins.str],
                 keyring_name: pulumi.Input[builtins.str],
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 key_spec: Optional[pulumi.Input[builtins.str]] = None,
                 key_usage: Optional[pulumi.Input[builtins.str]] = None,
                 multi_region: Optional[pulumi.Input[builtins.bool]] = None,
                 origin: Optional[pulumi.Input[builtins.str]] = None,
                 protection_level: Optional[pulumi.Input[builtins.str]] = None,
                 rotate_state: Optional[pulumi.Input[builtins.str]] = None,
                 tags: Optional[pulumi.Input[Sequence[pulumi.Input['KeyTagArgs']]]] = None):
        """
        The set of arguments for constructing a Key resource.
        :param pulumi.Input[builtins.str] key_name: 主密钥名称，长度为 2   - 31 个字符，合法字符：[a-zA-Z0-9-_]。
        :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] key_spec: 对称密钥：SYMMETRIC*256，SYMMETRIC*128，非对称密钥：RSA*2048，RSA*3072，RSA*4096，EC*P256，EC*P256K，EC*P384，EC*P521，EC*SM2。
        :param pulumi.Input[builtins.str] key_usage: 密钥用途，取值：ENCRYPT*DECRYPT，SIGN*VERIFY，GENERATE*VERIFY*MAC。
        :param pulumi.Input[builtins.bool] multi_region: 是否为 Multi-region 类型的主密钥。
        :param pulumi.Input[builtins.str] origin: 密钥来源，取值：CloudKMS，External，ExternalKeyStore。
        :param pulumi.Input[builtins.str] protection_level: 密钥保护级别，取值：SOFTWARE，HSM。
        :param pulumi.Input[builtins.str] rotate_state: 密钥轮转状态，取值：Enable，Disable。
        """
        pulumi.set(__self__, "key_name", key_name)
        pulumi.set(__self__, "keyring_name", keyring_name)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if key_spec is not None:
            pulumi.set(__self__, "key_spec", key_spec)
        if key_usage is not None:
            pulumi.set(__self__, "key_usage", key_usage)
        if multi_region is not None:
            pulumi.set(__self__, "multi_region", multi_region)
        if origin is not None:
            pulumi.set(__self__, "origin", origin)
        if protection_level is not None:
            pulumi.set(__self__, "protection_level", protection_level)
        if rotate_state is not None:
            pulumi.set(__self__, "rotate_state", rotate_state)
        if tags is not None:
            pulumi.set(__self__, "tags", tags)

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

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

    @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="keySpec")
    def key_spec(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        对称密钥：SYMMETRIC*256，SYMMETRIC*128，非对称密钥：RSA*2048，RSA*3072，RSA*4096，EC*P256，EC*P256K，EC*P384，EC*P521，EC*SM2。
        """
        return pulumi.get(self, "key_spec")

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

    @property
    @pulumi.getter(name="keyUsage")
    def key_usage(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥用途，取值：ENCRYPT*DECRYPT，SIGN*VERIFY，GENERATE*VERIFY*MAC。
        """
        return pulumi.get(self, "key_usage")

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

    @property
    @pulumi.getter(name="multiRegion")
    def multi_region(self) -> Optional[pulumi.Input[builtins.bool]]:
        """
        是否为 Multi-region 类型的主密钥。
        """
        return pulumi.get(self, "multi_region")

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

    @property
    @pulumi.getter
    def origin(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥来源，取值：CloudKMS，External，ExternalKeyStore。
        """
        return pulumi.get(self, "origin")

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

    @property
    @pulumi.getter(name="protectionLevel")
    def protection_level(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥保护级别，取值：SOFTWARE，HSM。
        """
        return pulumi.get(self, "protection_level")

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

    @property
    @pulumi.getter(name="rotateState")
    def rotate_state(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥轮转状态，取值：Enable，Disable。
        """
        return pulumi.get(self, "rotate_state")

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

    @property
    @pulumi.getter
    def tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['KeyTagArgs']]]]:
        return pulumi.get(self, "tags")

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


@pulumi.input_type
class _KeyState:
    def __init__(__self__, *,
                 created_time: Optional[pulumi.Input[builtins.int]] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 key_id: Optional[pulumi.Input[builtins.str]] = None,
                 key_material_expire_time: Optional[pulumi.Input[builtins.str]] = None,
                 key_name: Optional[pulumi.Input[builtins.str]] = None,
                 key_spec: Optional[pulumi.Input[builtins.str]] = None,
                 key_state: Optional[pulumi.Input[builtins.str]] = None,
                 key_usage: Optional[pulumi.Input[builtins.str]] = None,
                 keyring_name: Optional[pulumi.Input[builtins.str]] = None,
                 last_rotation_time: Optional[pulumi.Input[builtins.str]] = None,
                 multi_region: Optional[pulumi.Input[builtins.bool]] = None,
                 multi_region_configuration: Optional[pulumi.Input['KeyMultiRegionConfigurationArgs']] = None,
                 origin: Optional[pulumi.Input[builtins.str]] = None,
                 protection_level: Optional[pulumi.Input[builtins.str]] = None,
                 rotate_state: Optional[pulumi.Input[builtins.str]] = None,
                 schedule_delete_time: Optional[pulumi.Input[builtins.str]] = None,
                 schedule_rotation_time: Optional[pulumi.Input[builtins.str]] = None,
                 tags: Optional[pulumi.Input[Sequence[pulumi.Input['KeyTagArgs']]]] = None,
                 trn: Optional[pulumi.Input[builtins.str]] = None,
                 updated_time: Optional[pulumi.Input[builtins.int]] = None):
        """
        Input properties used for looking up and filtering Key resources.
        :param pulumi.Input[builtins.int] created_time: 密钥创建时间。
        :param pulumi.Input[builtins.str] description: 密钥描述:长度为 0   - 8192 个字符。
        :param pulumi.Input[builtins.str] key_id: 密钥唯一标识符，UUID形式。
        :param pulumi.Input[builtins.str] key_material_expire_time: 密钥材料过期时间，当值为空时表示不会过期。
        :param pulumi.Input[builtins.str] key_name: 主密钥名称，长度为 2   - 31 个字符，合法字符：[a-zA-Z0-9-_]。
        :param pulumi.Input[builtins.str] key_spec: 对称密钥：SYMMETRIC*256，SYMMETRIC*128，非对称密钥：RSA*2048，RSA*3072，RSA*4096，EC*P256，EC*P256K，EC*P384，EC*P521，EC*SM2。
        :param pulumi.Input[builtins.str] key_state: 密钥状态：Enable，Disable，PendingDelete，Archived，PendingImport。
        :param pulumi.Input[builtins.str] key_usage: 密钥用途，取值：ENCRYPT*DECRYPT，SIGN*VERIFY，GENERATE*VERIFY*MAC。
        :param pulumi.Input[builtins.str] keyring_name: 密钥环名称，长度为 2   - 31 个字符，合法字符：[a-zA-Z0-9-_]。
        :param pulumi.Input[builtins.str] last_rotation_time: 密钥最后轮转时间。
        :param pulumi.Input[builtins.bool] multi_region: 是否为 Multi-region 类型的主密钥。
        :param pulumi.Input['KeyMultiRegionConfigurationArgs'] multi_region_configuration: Multi-region key 配置信息。
        :param pulumi.Input[builtins.str] origin: 密钥来源，取值：CloudKMS，External，ExternalKeyStore。
        :param pulumi.Input[builtins.str] protection_level: 密钥保护级别，取值：SOFTWARE，HSM。
        :param pulumi.Input[builtins.str] rotate_state: 密钥轮转状态，取值：Enable，Disable。
        :param pulumi.Input[builtins.str] schedule_delete_time: 密钥删除时间。
        :param pulumi.Input[builtins.str] schedule_rotation_time: 密钥轮转时间。
        :param pulumi.Input[builtins.str] trn: 资源名称，格式应为 trn:${Service}:${Region}:${AccountID}:${ResourcePath}。
        :param pulumi.Input[builtins.int] updated_time: 密钥更新时间。
        """
        if created_time is not None:
            pulumi.set(__self__, "created_time", created_time)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if key_id is not None:
            pulumi.set(__self__, "key_id", key_id)
        if key_material_expire_time is not None:
            pulumi.set(__self__, "key_material_expire_time", key_material_expire_time)
        if key_name is not None:
            pulumi.set(__self__, "key_name", key_name)
        if key_spec is not None:
            pulumi.set(__self__, "key_spec", key_spec)
        if key_state is not None:
            pulumi.set(__self__, "key_state", key_state)
        if key_usage is not None:
            pulumi.set(__self__, "key_usage", key_usage)
        if keyring_name is not None:
            pulumi.set(__self__, "keyring_name", keyring_name)
        if last_rotation_time is not None:
            pulumi.set(__self__, "last_rotation_time", last_rotation_time)
        if multi_region is not None:
            pulumi.set(__self__, "multi_region", multi_region)
        if multi_region_configuration is not None:
            pulumi.set(__self__, "multi_region_configuration", multi_region_configuration)
        if origin is not None:
            pulumi.set(__self__, "origin", origin)
        if protection_level is not None:
            pulumi.set(__self__, "protection_level", protection_level)
        if rotate_state is not None:
            pulumi.set(__self__, "rotate_state", rotate_state)
        if schedule_delete_time is not None:
            pulumi.set(__self__, "schedule_delete_time", schedule_delete_time)
        if schedule_rotation_time is not None:
            pulumi.set(__self__, "schedule_rotation_time", schedule_rotation_time)
        if tags is not None:
            pulumi.set(__self__, "tags", tags)
        if trn is not None:
            pulumi.set(__self__, "trn", trn)
        if updated_time is not None:
            pulumi.set(__self__, "updated_time", updated_time)

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        密钥创建时间。
        """
        return pulumi.get(self, "created_time")

    @created_time.setter
    def created_time(self, value: Optional[pulumi.Input[builtins.int]]):
        pulumi.set(self, "created_time", 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="keyId")
    def key_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥唯一标识符，UUID形式。
        """
        return pulumi.get(self, "key_id")

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

    @property
    @pulumi.getter(name="keyMaterialExpireTime")
    def key_material_expire_time(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥材料过期时间，当值为空时表示不会过期。
        """
        return pulumi.get(self, "key_material_expire_time")

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

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

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

    @property
    @pulumi.getter(name="keySpec")
    def key_spec(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        对称密钥：SYMMETRIC*256，SYMMETRIC*128，非对称密钥：RSA*2048，RSA*3072，RSA*4096，EC*P256，EC*P256K，EC*P384，EC*P521，EC*SM2。
        """
        return pulumi.get(self, "key_spec")

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

    @property
    @pulumi.getter(name="keyState")
    def key_state(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥状态：Enable，Disable，PendingDelete，Archived，PendingImport。
        """
        return pulumi.get(self, "key_state")

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

    @property
    @pulumi.getter(name="keyUsage")
    def key_usage(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥用途，取值：ENCRYPT*DECRYPT，SIGN*VERIFY，GENERATE*VERIFY*MAC。
        """
        return pulumi.get(self, "key_usage")

    @key_usage.setter
    def key_usage(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "key_usage", 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="lastRotationTime")
    def last_rotation_time(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥最后轮转时间。
        """
        return pulumi.get(self, "last_rotation_time")

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

    @property
    @pulumi.getter(name="multiRegion")
    def multi_region(self) -> Optional[pulumi.Input[builtins.bool]]:
        """
        是否为 Multi-region 类型的主密钥。
        """
        return pulumi.get(self, "multi_region")

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

    @property
    @pulumi.getter(name="multiRegionConfiguration")
    def multi_region_configuration(self) -> Optional[pulumi.Input['KeyMultiRegionConfigurationArgs']]:
        """
        Multi-region key 配置信息。
        """
        return pulumi.get(self, "multi_region_configuration")

    @multi_region_configuration.setter
    def multi_region_configuration(self, value: Optional[pulumi.Input['KeyMultiRegionConfigurationArgs']]):
        pulumi.set(self, "multi_region_configuration", value)

    @property
    @pulumi.getter
    def origin(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥来源，取值：CloudKMS，External，ExternalKeyStore。
        """
        return pulumi.get(self, "origin")

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

    @property
    @pulumi.getter(name="protectionLevel")
    def protection_level(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥保护级别，取值：SOFTWARE，HSM。
        """
        return pulumi.get(self, "protection_level")

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

    @property
    @pulumi.getter(name="rotateState")
    def rotate_state(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥轮转状态，取值：Enable，Disable。
        """
        return pulumi.get(self, "rotate_state")

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

    @property
    @pulumi.getter(name="scheduleDeleteTime")
    def schedule_delete_time(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥删除时间。
        """
        return pulumi.get(self, "schedule_delete_time")

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

    @property
    @pulumi.getter(name="scheduleRotationTime")
    def schedule_rotation_time(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        密钥轮转时间。
        """
        return pulumi.get(self, "schedule_rotation_time")

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

    @property
    @pulumi.getter
    def tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['KeyTagArgs']]]]:
        return pulumi.get(self, "tags")

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

    @property
    @pulumi.getter
    def trn(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        资源名称，格式应为 trn:${Service}:${Region}:${AccountID}:${ResourcePath}。
        """
        return pulumi.get(self, "trn")

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

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        密钥更新时间。
        """
        return pulumi.get(self, "updated_time")

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


@pulumi.type_token("bytepluscc:kms/key:Key")
class Key(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 key_name: Optional[pulumi.Input[builtins.str]] = None,
                 key_spec: Optional[pulumi.Input[builtins.str]] = None,
                 key_usage: Optional[pulumi.Input[builtins.str]] = None,
                 keyring_name: Optional[pulumi.Input[builtins.str]] = None,
                 multi_region: Optional[pulumi.Input[builtins.bool]] = None,
                 origin: Optional[pulumi.Input[builtins.str]] = None,
                 protection_level: Optional[pulumi.Input[builtins.str]] = None,
                 rotate_state: Optional[pulumi.Input[builtins.str]] = None,
                 tags: Optional[pulumi.Input[Sequence[pulumi.Input[Union['KeyTagArgs', 'KeyTagArgsDict']]]]] = None,
                 __props__=None):
        """
        密钥管理服务（Key Management Service）是火山引擎上一站式的密钥管理和数据加密服务平台。提供简单易用的加密接口，KMS 帮助用户轻松管理密钥、保护云上核心数据的安全。同时极大降低用户自行部署密码基础设施的采购、研发成本。帮助业务轻松满足监管和合规需求。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        k_ms_key_demo = bytepluscc.kms.Key("KMSKeyDemo",
            keyring_name="KMSKeyDemo",
            key_name="KMSKeyDemoKeyName",
            key_spec="SYMMETRIC_256",
            description="description KMSKeyDemo",
            key_usage="ENCRYPT_DECRYPT",
            protection_level="HSM",
            rotate_state="Enable",
            origin="CloudKMS",
            multi_region=False,
            tags=[{
                "key": "env",
                "value": "test",
            }])
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:kms/key:Key example "keyring_name|key_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] key_name: 主密钥名称，长度为 2   - 31 个字符，合法字符：[a-zA-Z0-9-_]。
        :param pulumi.Input[builtins.str] key_spec: 对称密钥：SYMMETRIC*256，SYMMETRIC*128，非对称密钥：RSA*2048，RSA*3072，RSA*4096，EC*P256，EC*P256K，EC*P384，EC*P521，EC*SM2。
        :param pulumi.Input[builtins.str] key_usage: 密钥用途，取值：ENCRYPT*DECRYPT，SIGN*VERIFY，GENERATE*VERIFY*MAC。
        :param pulumi.Input[builtins.str] keyring_name: 密钥环名称，长度为 2   - 31 个字符，合法字符：[a-zA-Z0-9-_]。
        :param pulumi.Input[builtins.bool] multi_region: 是否为 Multi-region 类型的主密钥。
        :param pulumi.Input[builtins.str] origin: 密钥来源，取值：CloudKMS，External，ExternalKeyStore。
        :param pulumi.Input[builtins.str] protection_level: 密钥保护级别，取值：SOFTWARE，HSM。
        :param pulumi.Input[builtins.str] rotate_state: 密钥轮转状态，取值：Enable，Disable。
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: KeyArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        密钥管理服务（Key Management Service）是火山引擎上一站式的密钥管理和数据加密服务平台。提供简单易用的加密接口，KMS 帮助用户轻松管理密钥、保护云上核心数据的安全。同时极大降低用户自行部署密码基础设施的采购、研发成本。帮助业务轻松满足监管和合规需求。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        k_ms_key_demo = bytepluscc.kms.Key("KMSKeyDemo",
            keyring_name="KMSKeyDemo",
            key_name="KMSKeyDemoKeyName",
            key_spec="SYMMETRIC_256",
            description="description KMSKeyDemo",
            key_usage="ENCRYPT_DECRYPT",
            protection_level="HSM",
            rotate_state="Enable",
            origin="CloudKMS",
            multi_region=False,
            tags=[{
                "key": "env",
                "value": "test",
            }])
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:kms/key:Key example "keyring_name|key_id"
        ```

        :param str resource_name: The name of the resource.
        :param KeyArgs 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(KeyArgs, 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,
                 key_name: Optional[pulumi.Input[builtins.str]] = None,
                 key_spec: Optional[pulumi.Input[builtins.str]] = None,
                 key_usage: Optional[pulumi.Input[builtins.str]] = None,
                 keyring_name: Optional[pulumi.Input[builtins.str]] = None,
                 multi_region: Optional[pulumi.Input[builtins.bool]] = None,
                 origin: Optional[pulumi.Input[builtins.str]] = None,
                 protection_level: Optional[pulumi.Input[builtins.str]] = None,
                 rotate_state: Optional[pulumi.Input[builtins.str]] = None,
                 tags: Optional[pulumi.Input[Sequence[pulumi.Input[Union['KeyTagArgs', 'KeyTagArgsDict']]]]] = 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__ = KeyArgs.__new__(KeyArgs)

            __props__.__dict__["description"] = description
            if key_name is None and not opts.urn:
                raise TypeError("Missing required property 'key_name'")
            __props__.__dict__["key_name"] = key_name
            __props__.__dict__["key_spec"] = key_spec
            __props__.__dict__["key_usage"] = key_usage
            if keyring_name is None and not opts.urn:
                raise TypeError("Missing required property 'keyring_name'")
            __props__.__dict__["keyring_name"] = keyring_name
            __props__.__dict__["multi_region"] = multi_region
            __props__.__dict__["origin"] = origin
            __props__.__dict__["protection_level"] = protection_level
            __props__.__dict__["rotate_state"] = rotate_state
            __props__.__dict__["tags"] = tags
            __props__.__dict__["created_time"] = None
            __props__.__dict__["key_id"] = None
            __props__.__dict__["key_material_expire_time"] = None
            __props__.__dict__["key_state"] = None
            __props__.__dict__["last_rotation_time"] = None
            __props__.__dict__["multi_region_configuration"] = None
            __props__.__dict__["schedule_delete_time"] = None
            __props__.__dict__["schedule_rotation_time"] = None
            __props__.__dict__["trn"] = None
            __props__.__dict__["updated_time"] = None
        super(Key, __self__).__init__(
            'bytepluscc:kms/key:Key',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            created_time: Optional[pulumi.Input[builtins.int]] = None,
            description: Optional[pulumi.Input[builtins.str]] = None,
            key_id: Optional[pulumi.Input[builtins.str]] = None,
            key_material_expire_time: Optional[pulumi.Input[builtins.str]] = None,
            key_name: Optional[pulumi.Input[builtins.str]] = None,
            key_spec: Optional[pulumi.Input[builtins.str]] = None,
            key_state: Optional[pulumi.Input[builtins.str]] = None,
            key_usage: Optional[pulumi.Input[builtins.str]] = None,
            keyring_name: Optional[pulumi.Input[builtins.str]] = None,
            last_rotation_time: Optional[pulumi.Input[builtins.str]] = None,
            multi_region: Optional[pulumi.Input[builtins.bool]] = None,
            multi_region_configuration: Optional[pulumi.Input[Union['KeyMultiRegionConfigurationArgs', 'KeyMultiRegionConfigurationArgsDict']]] = None,
            origin: Optional[pulumi.Input[builtins.str]] = None,
            protection_level: Optional[pulumi.Input[builtins.str]] = None,
            rotate_state: Optional[pulumi.Input[builtins.str]] = None,
            schedule_delete_time: Optional[pulumi.Input[builtins.str]] = None,
            schedule_rotation_time: Optional[pulumi.Input[builtins.str]] = None,
            tags: Optional[pulumi.Input[Sequence[pulumi.Input[Union['KeyTagArgs', 'KeyTagArgsDict']]]]] = None,
            trn: Optional[pulumi.Input[builtins.str]] = None,
            updated_time: Optional[pulumi.Input[builtins.int]] = None) -> 'Key':
        """
        Get an existing Key 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] created_time: 密钥创建时间。
        :param pulumi.Input[builtins.str] description: 密钥描述:长度为 0   - 8192 个字符。
        :param pulumi.Input[builtins.str] key_id: 密钥唯一标识符，UUID形式。
        :param pulumi.Input[builtins.str] key_material_expire_time: 密钥材料过期时间，当值为空时表示不会过期。
        :param pulumi.Input[builtins.str] key_name: 主密钥名称，长度为 2   - 31 个字符，合法字符：[a-zA-Z0-9-_]。
        :param pulumi.Input[builtins.str] key_spec: 对称密钥：SYMMETRIC*256，SYMMETRIC*128，非对称密钥：RSA*2048，RSA*3072，RSA*4096，EC*P256，EC*P256K，EC*P384，EC*P521，EC*SM2。
        :param pulumi.Input[builtins.str] key_state: 密钥状态：Enable，Disable，PendingDelete，Archived，PendingImport。
        :param pulumi.Input[builtins.str] key_usage: 密钥用途，取值：ENCRYPT*DECRYPT，SIGN*VERIFY，GENERATE*VERIFY*MAC。
        :param pulumi.Input[builtins.str] keyring_name: 密钥环名称，长度为 2   - 31 个字符，合法字符：[a-zA-Z0-9-_]。
        :param pulumi.Input[builtins.str] last_rotation_time: 密钥最后轮转时间。
        :param pulumi.Input[builtins.bool] multi_region: 是否为 Multi-region 类型的主密钥。
        :param pulumi.Input[Union['KeyMultiRegionConfigurationArgs', 'KeyMultiRegionConfigurationArgsDict']] multi_region_configuration: Multi-region key 配置信息。
        :param pulumi.Input[builtins.str] origin: 密钥来源，取值：CloudKMS，External，ExternalKeyStore。
        :param pulumi.Input[builtins.str] protection_level: 密钥保护级别，取值：SOFTWARE，HSM。
        :param pulumi.Input[builtins.str] rotate_state: 密钥轮转状态，取值：Enable，Disable。
        :param pulumi.Input[builtins.str] schedule_delete_time: 密钥删除时间。
        :param pulumi.Input[builtins.str] schedule_rotation_time: 密钥轮转时间。
        :param pulumi.Input[builtins.str] trn: 资源名称，格式应为 trn:${Service}:${Region}:${AccountID}:${ResourcePath}。
        :param pulumi.Input[builtins.int] updated_time: 密钥更新时间。
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _KeyState.__new__(_KeyState)

        __props__.__dict__["created_time"] = created_time
        __props__.__dict__["description"] = description
        __props__.__dict__["key_id"] = key_id
        __props__.__dict__["key_material_expire_time"] = key_material_expire_time
        __props__.__dict__["key_name"] = key_name
        __props__.__dict__["key_spec"] = key_spec
        __props__.__dict__["key_state"] = key_state
        __props__.__dict__["key_usage"] = key_usage
        __props__.__dict__["keyring_name"] = keyring_name
        __props__.__dict__["last_rotation_time"] = last_rotation_time
        __props__.__dict__["multi_region"] = multi_region
        __props__.__dict__["multi_region_configuration"] = multi_region_configuration
        __props__.__dict__["origin"] = origin
        __props__.__dict__["protection_level"] = protection_level
        __props__.__dict__["rotate_state"] = rotate_state
        __props__.__dict__["schedule_delete_time"] = schedule_delete_time
        __props__.__dict__["schedule_rotation_time"] = schedule_rotation_time
        __props__.__dict__["tags"] = tags
        __props__.__dict__["trn"] = trn
        __props__.__dict__["updated_time"] = updated_time
        return Key(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> pulumi.Output[builtins.int]:
        """
        密钥创建时间。
        """
        return pulumi.get(self, "created_time")

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

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

    @property
    @pulumi.getter(name="keyMaterialExpireTime")
    def key_material_expire_time(self) -> pulumi.Output[builtins.str]:
        """
        密钥材料过期时间，当值为空时表示不会过期。
        """
        return pulumi.get(self, "key_material_expire_time")

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

    @property
    @pulumi.getter(name="keySpec")
    def key_spec(self) -> pulumi.Output[builtins.str]:
        """
        对称密钥：SYMMETRIC*256，SYMMETRIC*128，非对称密钥：RSA*2048，RSA*3072，RSA*4096，EC*P256，EC*P256K，EC*P384，EC*P521，EC*SM2。
        """
        return pulumi.get(self, "key_spec")

    @property
    @pulumi.getter(name="keyState")
    def key_state(self) -> pulumi.Output[builtins.str]:
        """
        密钥状态：Enable，Disable，PendingDelete，Archived，PendingImport。
        """
        return pulumi.get(self, "key_state")

    @property
    @pulumi.getter(name="keyUsage")
    def key_usage(self) -> pulumi.Output[builtins.str]:
        """
        密钥用途，取值：ENCRYPT*DECRYPT，SIGN*VERIFY，GENERATE*VERIFY*MAC。
        """
        return pulumi.get(self, "key_usage")

    @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="lastRotationTime")
    def last_rotation_time(self) -> pulumi.Output[builtins.str]:
        """
        密钥最后轮转时间。
        """
        return pulumi.get(self, "last_rotation_time")

    @property
    @pulumi.getter(name="multiRegion")
    def multi_region(self) -> pulumi.Output[builtins.bool]:
        """
        是否为 Multi-region 类型的主密钥。
        """
        return pulumi.get(self, "multi_region")

    @property
    @pulumi.getter(name="multiRegionConfiguration")
    def multi_region_configuration(self) -> pulumi.Output['outputs.KeyMultiRegionConfiguration']:
        """
        Multi-region key 配置信息。
        """
        return pulumi.get(self, "multi_region_configuration")

    @property
    @pulumi.getter
    def origin(self) -> pulumi.Output[builtins.str]:
        """
        密钥来源，取值：CloudKMS，External，ExternalKeyStore。
        """
        return pulumi.get(self, "origin")

    @property
    @pulumi.getter(name="protectionLevel")
    def protection_level(self) -> pulumi.Output[builtins.str]:
        """
        密钥保护级别，取值：SOFTWARE，HSM。
        """
        return pulumi.get(self, "protection_level")

    @property
    @pulumi.getter(name="rotateState")
    def rotate_state(self) -> pulumi.Output[builtins.str]:
        """
        密钥轮转状态，取值：Enable，Disable。
        """
        return pulumi.get(self, "rotate_state")

    @property
    @pulumi.getter(name="scheduleDeleteTime")
    def schedule_delete_time(self) -> pulumi.Output[builtins.str]:
        """
        密钥删除时间。
        """
        return pulumi.get(self, "schedule_delete_time")

    @property
    @pulumi.getter(name="scheduleRotationTime")
    def schedule_rotation_time(self) -> pulumi.Output[builtins.str]:
        """
        密钥轮转时间。
        """
        return pulumi.get(self, "schedule_rotation_time")

    @property
    @pulumi.getter
    def tags(self) -> pulumi.Output[Sequence['outputs.KeyTag']]:
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter
    def trn(self) -> pulumi.Output[builtins.str]:
        """
        资源名称，格式应为 trn:${Service}:${Region}:${AccountID}:${ResourcePath}。
        """
        return pulumi.get(self, "trn")

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> pulumi.Output[builtins.int]:
        """
        密钥更新时间。
        """
        return pulumi.get(self, "updated_time")

