# 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

__all__ = [
    'GetKeyResult',
    'AwaitableGetKeyResult',
    'get_key',
    'get_key_output',
]

@pulumi.output_type
class GetKeyResult:
    """
    A collection of values returned by getKey.
    """
    def __init__(__self__, created_time=None, description=None, id=None, key_id=None, key_material_expire_time=None, key_name=None, key_spec=None, key_state=None, key_usage=None, keyring_name=None, last_rotation_time=None, multi_region=None, multi_region_configuration=None, origin=None, protection_level=None, rotate_state=None, schedule_delete_time=None, schedule_rotation_time=None, tags=None, trn=None, updated_time=None):
        if created_time and not isinstance(created_time, int):
            raise TypeError("Expected argument 'created_time' to be a int")
        pulumi.set(__self__, "created_time", created_time)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if key_id and not isinstance(key_id, str):
            raise TypeError("Expected argument 'key_id' to be a str")
        pulumi.set(__self__, "key_id", key_id)
        if key_material_expire_time and not isinstance(key_material_expire_time, str):
            raise TypeError("Expected argument 'key_material_expire_time' to be a str")
        pulumi.set(__self__, "key_material_expire_time", key_material_expire_time)
        if key_name and not isinstance(key_name, str):
            raise TypeError("Expected argument 'key_name' to be a str")
        pulumi.set(__self__, "key_name", key_name)
        if key_spec and not isinstance(key_spec, str):
            raise TypeError("Expected argument 'key_spec' to be a str")
        pulumi.set(__self__, "key_spec", key_spec)
        if key_state and not isinstance(key_state, str):
            raise TypeError("Expected argument 'key_state' to be a str")
        pulumi.set(__self__, "key_state", key_state)
        if key_usage and not isinstance(key_usage, str):
            raise TypeError("Expected argument 'key_usage' to be a str")
        pulumi.set(__self__, "key_usage", key_usage)
        if keyring_name and not isinstance(keyring_name, str):
            raise TypeError("Expected argument 'keyring_name' to be a str")
        pulumi.set(__self__, "keyring_name", keyring_name)
        if last_rotation_time and not isinstance(last_rotation_time, str):
            raise TypeError("Expected argument 'last_rotation_time' to be a str")
        pulumi.set(__self__, "last_rotation_time", last_rotation_time)
        if multi_region and not isinstance(multi_region, bool):
            raise TypeError("Expected argument 'multi_region' to be a bool")
        pulumi.set(__self__, "multi_region", multi_region)
        if multi_region_configuration and not isinstance(multi_region_configuration, dict):
            raise TypeError("Expected argument 'multi_region_configuration' to be a dict")
        pulumi.set(__self__, "multi_region_configuration", multi_region_configuration)
        if origin and not isinstance(origin, str):
            raise TypeError("Expected argument 'origin' to be a str")
        pulumi.set(__self__, "origin", origin)
        if protection_level and not isinstance(protection_level, str):
            raise TypeError("Expected argument 'protection_level' to be a str")
        pulumi.set(__self__, "protection_level", protection_level)
        if rotate_state and not isinstance(rotate_state, str):
            raise TypeError("Expected argument 'rotate_state' to be a str")
        pulumi.set(__self__, "rotate_state", rotate_state)
        if schedule_delete_time and not isinstance(schedule_delete_time, str):
            raise TypeError("Expected argument 'schedule_delete_time' to be a str")
        pulumi.set(__self__, "schedule_delete_time", schedule_delete_time)
        if schedule_rotation_time and not isinstance(schedule_rotation_time, str):
            raise TypeError("Expected argument 'schedule_rotation_time' to be a str")
        pulumi.set(__self__, "schedule_rotation_time", schedule_rotation_time)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        if trn and not isinstance(trn, str):
            raise TypeError("Expected argument 'trn' to be a str")
        pulumi.set(__self__, "trn", trn)
        if updated_time and not isinstance(updated_time, int):
            raise TypeError("Expected argument 'updated_time' to be a int")
        pulumi.set(__self__, "updated_time", updated_time)

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

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

    @property
    @pulumi.getter
    def id(self) -> builtins.str:
        """
        Uniquely identifies the resource.
        """
        return pulumi.get(self, "id")

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

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

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

    @property
    @pulumi.getter(name="keySpec")
    def key_spec(self) -> 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) -> builtins.str:
        """
        密钥状态：Enable，Disable，PendingDelete，Archived，PendingImport。
        """
        return pulumi.get(self, "key_state")

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

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

    @property
    @pulumi.getter(name="lastRotationTime")
    def last_rotation_time(self) -> builtins.str:
        """
        密钥最后轮转时间。
        """
        return pulumi.get(self, "last_rotation_time")

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

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

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

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

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

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

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

    @property
    @pulumi.getter
    def tags(self) -> Sequence['outputs.GetKeyTagResult']:
        """
        KMS密钥的标签信息
        """
        return pulumi.get(self, "tags")

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

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


class AwaitableGetKeyResult(GetKeyResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetKeyResult(
            created_time=self.created_time,
            description=self.description,
            id=self.id,
            key_id=self.key_id,
            key_material_expire_time=self.key_material_expire_time,
            key_name=self.key_name,
            key_spec=self.key_spec,
            key_state=self.key_state,
            key_usage=self.key_usage,
            keyring_name=self.keyring_name,
            last_rotation_time=self.last_rotation_time,
            multi_region=self.multi_region,
            multi_region_configuration=self.multi_region_configuration,
            origin=self.origin,
            protection_level=self.protection_level,
            rotate_state=self.rotate_state,
            schedule_delete_time=self.schedule_delete_time,
            schedule_rotation_time=self.schedule_rotation_time,
            tags=self.tags,
            trn=self.trn,
            updated_time=self.updated_time)


def get_key(id: Optional[builtins.str] = None,
            opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetKeyResult:
    """
    Data Source schema for Byteplus::KMS::Key


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('bytepluscc:kms/getKey:getKey', __args__, opts=opts, typ=GetKeyResult).value

    return AwaitableGetKeyResult(
        created_time=pulumi.get(__ret__, 'created_time'),
        description=pulumi.get(__ret__, 'description'),
        id=pulumi.get(__ret__, 'id'),
        key_id=pulumi.get(__ret__, 'key_id'),
        key_material_expire_time=pulumi.get(__ret__, 'key_material_expire_time'),
        key_name=pulumi.get(__ret__, 'key_name'),
        key_spec=pulumi.get(__ret__, 'key_spec'),
        key_state=pulumi.get(__ret__, 'key_state'),
        key_usage=pulumi.get(__ret__, 'key_usage'),
        keyring_name=pulumi.get(__ret__, 'keyring_name'),
        last_rotation_time=pulumi.get(__ret__, 'last_rotation_time'),
        multi_region=pulumi.get(__ret__, 'multi_region'),
        multi_region_configuration=pulumi.get(__ret__, 'multi_region_configuration'),
        origin=pulumi.get(__ret__, 'origin'),
        protection_level=pulumi.get(__ret__, 'protection_level'),
        rotate_state=pulumi.get(__ret__, 'rotate_state'),
        schedule_delete_time=pulumi.get(__ret__, 'schedule_delete_time'),
        schedule_rotation_time=pulumi.get(__ret__, 'schedule_rotation_time'),
        tags=pulumi.get(__ret__, 'tags'),
        trn=pulumi.get(__ret__, 'trn'),
        updated_time=pulumi.get(__ret__, 'updated_time'))
def get_key_output(id: Optional[pulumi.Input[builtins.str]] = None,
                   opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetKeyResult]:
    """
    Data Source schema for Byteplus::KMS::Key


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('bytepluscc:kms/getKey:getKey', __args__, opts=opts, typ=GetKeyResult)
    return __ret__.apply(lambda __response__: GetKeyResult(
        created_time=pulumi.get(__response__, 'created_time'),
        description=pulumi.get(__response__, 'description'),
        id=pulumi.get(__response__, 'id'),
        key_id=pulumi.get(__response__, 'key_id'),
        key_material_expire_time=pulumi.get(__response__, 'key_material_expire_time'),
        key_name=pulumi.get(__response__, 'key_name'),
        key_spec=pulumi.get(__response__, 'key_spec'),
        key_state=pulumi.get(__response__, 'key_state'),
        key_usage=pulumi.get(__response__, 'key_usage'),
        keyring_name=pulumi.get(__response__, 'keyring_name'),
        last_rotation_time=pulumi.get(__response__, 'last_rotation_time'),
        multi_region=pulumi.get(__response__, 'multi_region'),
        multi_region_configuration=pulumi.get(__response__, 'multi_region_configuration'),
        origin=pulumi.get(__response__, 'origin'),
        protection_level=pulumi.get(__response__, 'protection_level'),
        rotate_state=pulumi.get(__response__, 'rotate_state'),
        schedule_delete_time=pulumi.get(__response__, 'schedule_delete_time'),
        schedule_rotation_time=pulumi.get(__response__, 'schedule_rotation_time'),
        tags=pulumi.get(__response__, 'tags'),
        trn=pulumi.get(__response__, 'trn'),
        updated_time=pulumi.get(__response__, 'updated_time')))
