# 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 warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities

__all__ = ['KeyArgs', 'Key']

@pulumi.input_type
class KeyArgs:
    def __init__(__self__, *,
                 automatic_rotation: Optional[pulumi.Input[str]] = None,
                 deletion_window_in_days: Optional[pulumi.Input[int]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 is_enabled: Optional[pulumi.Input[bool]] = None,
                 key_spec: Optional[pulumi.Input[str]] = None,
                 key_state: Optional[pulumi.Input[str]] = None,
                 key_usage: Optional[pulumi.Input[str]] = None,
                 origin: Optional[pulumi.Input[str]] = None,
                 pending_window_in_days: Optional[pulumi.Input[int]] = None,
                 protection_level: Optional[pulumi.Input[str]] = None,
                 rotation_interval: Optional[pulumi.Input[str]] = None,
                 status: Optional[pulumi.Input[str]] = None):
        """
        The set of arguments for constructing a Key resource.
        :param pulumi.Input[str] automatic_rotation: Specifies whether to enable automatic key rotation. Valid values: 
               - Enabled
               - Disabled (default value)
               **NOTE**: If you set the origin parameter to EXTERNAL or the key_spec parameter to an asymmetric CMK type, automatic key rotation is unavailable.
        :param pulumi.Input[int] deletion_window_in_days: Field `deletion_window_in_days` has been deprecated from provider version 1.85.0. New field `pending_window_in_days` instead.
        :param pulumi.Input[str] description: The description of the CMK. The description can be 0 to 8,192 characters in length.
        :param pulumi.Input[bool] is_enabled: Field `is_enabled` has been deprecated from provider version 1.85.0. New field `key_state` instead.
        :param pulumi.Input[str] key_spec: The type of the CMK. Valid values: 
               "Aliyun_AES_256", "Aliyun_AES_128", "Aliyun_AES_192", "Aliyun_SM4", "RSA_2048", "RSA_3072", "EC_P256", "EC_P256K", "EC_SM2".
               Note: The default type of the CMK is Aliyun_AES_256. Only Dedicated KMS supports Aliyun_AES_128 and Aliyun_AES_192.
        :param pulumi.Input[str] key_state: Field `key_state` has been deprecated from provider version 1.123.1. New field `status` instead.
        :param pulumi.Input[str] key_usage: The usage of the CMK. Valid values:
               - ENCRYPT/DECRYPT(default value): encrypts or decrypts data.
               - SIGN/VERIFY: generates or verifies a digital signature.
        :param pulumi.Input[str] origin: The source of key material. Valid values: 
               - Aliyun_KMS (default value)
               - EXTERNAL
               **NOTE**: The value of this parameter is case-sensitive. If you set the `key_spec` to an asymmetric CMK type,
               you are not allowed to set the `origin` to EXTERNAL. If you set the `origin` to EXTERNAL, you must import key material.
               For more information, see [import key material](https://www.alibabacloud.com/help/en/doc-detail/68523.htm).
        :param pulumi.Input[int] pending_window_in_days: The number of days before the CMK is deleted. 
               During this period, the CMK is in the PendingDeletion state.
               After this period ends, you cannot cancel the deletion. Valid values: 7 to 30. Unit: days.
        :param pulumi.Input[str] protection_level: The protection level of the CMK. Valid values:
               - SOFTWARE (default value)
               - HSM
               **NOTE**: The value of this parameter is case-sensitive. Assume that you set this parameter to HSM.
               If you set the origin parameter to Aliyun_KMS, the CMK is created in a managed hardware security module (HSM).
               If you set the origin parameter to EXTERNA, you can import an external key to the managed HSM.
        :param pulumi.Input[str] rotation_interval: The interval for automatic key rotation. Specify the value in the integer[unit] format.
               The following units are supported: d (day), h (hour), m (minute), and s (second).
               For example, you can use either 7d or 604800s to specify a seven-day interval.
               The interval can range from 7 days to 730 days.
               **NOTE**: It is Required when `automatic_rotation = "Enabled"`
        :param pulumi.Input[str] status: The status of CMK. Valid Values: 
               - Disabled
               - Enabled (default value)
               - PendingDeletion
        """
        if automatic_rotation is not None:
            pulumi.set(__self__, "automatic_rotation", automatic_rotation)
        if deletion_window_in_days is not None:
            warnings.warn("""Field 'deletion_window_in_days' has been deprecated from provider version 1.85.0. New field 'pending_window_in_days' instead.""", DeprecationWarning)
            pulumi.log.warn("""deletion_window_in_days is deprecated: Field 'deletion_window_in_days' has been deprecated from provider version 1.85.0. New field 'pending_window_in_days' instead.""")
        if deletion_window_in_days is not None:
            pulumi.set(__self__, "deletion_window_in_days", deletion_window_in_days)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if is_enabled is not None:
            warnings.warn("""Field 'is_enabled' has been deprecated from provider version 1.85.0. New field 'key_state' instead.""", DeprecationWarning)
            pulumi.log.warn("""is_enabled is deprecated: Field 'is_enabled' has been deprecated from provider version 1.85.0. New field 'key_state' instead.""")
        if is_enabled is not None:
            pulumi.set(__self__, "is_enabled", is_enabled)
        if key_spec is not None:
            pulumi.set(__self__, "key_spec", key_spec)
        if key_state is not None:
            warnings.warn("""Field 'key_state' has been deprecated from provider version 1.123.1. New field 'status' instead.""", DeprecationWarning)
            pulumi.log.warn("""key_state is deprecated: Field 'key_state' has been deprecated from provider version 1.123.1. New field 'status' instead.""")
        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 origin is not None:
            pulumi.set(__self__, "origin", origin)
        if pending_window_in_days is not None:
            pulumi.set(__self__, "pending_window_in_days", pending_window_in_days)
        if protection_level is not None:
            pulumi.set(__self__, "protection_level", protection_level)
        if rotation_interval is not None:
            pulumi.set(__self__, "rotation_interval", rotation_interval)
        if status is not None:
            pulumi.set(__self__, "status", status)

    @property
    @pulumi.getter(name="automaticRotation")
    def automatic_rotation(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies whether to enable automatic key rotation. Valid values: 
        - Enabled
        - Disabled (default value)
        **NOTE**: If you set the origin parameter to EXTERNAL or the key_spec parameter to an asymmetric CMK type, automatic key rotation is unavailable.
        """
        return pulumi.get(self, "automatic_rotation")

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

    @property
    @pulumi.getter(name="deletionWindowInDays")
    def deletion_window_in_days(self) -> Optional[pulumi.Input[int]]:
        """
        Field `deletion_window_in_days` has been deprecated from provider version 1.85.0. New field `pending_window_in_days` instead.
        """
        return pulumi.get(self, "deletion_window_in_days")

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

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[str]]:
        """
        The description of the CMK. The description can be 0 to 8,192 characters in length.
        """
        return pulumi.get(self, "description")

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

    @property
    @pulumi.getter(name="isEnabled")
    def is_enabled(self) -> Optional[pulumi.Input[bool]]:
        """
        Field `is_enabled` has been deprecated from provider version 1.85.0. New field `key_state` instead.
        """
        return pulumi.get(self, "is_enabled")

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

    @property
    @pulumi.getter(name="keySpec")
    def key_spec(self) -> Optional[pulumi.Input[str]]:
        """
        The type of the CMK. Valid values: 
        "Aliyun_AES_256", "Aliyun_AES_128", "Aliyun_AES_192", "Aliyun_SM4", "RSA_2048", "RSA_3072", "EC_P256", "EC_P256K", "EC_SM2".
        Note: The default type of the CMK is Aliyun_AES_256. Only Dedicated KMS supports Aliyun_AES_128 and Aliyun_AES_192.
        """
        return pulumi.get(self, "key_spec")

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

    @property
    @pulumi.getter(name="keyState")
    def key_state(self) -> Optional[pulumi.Input[str]]:
        """
        Field `key_state` has been deprecated from provider version 1.123.1. New field `status` instead.
        """
        return pulumi.get(self, "key_state")

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

    @property
    @pulumi.getter(name="keyUsage")
    def key_usage(self) -> Optional[pulumi.Input[str]]:
        """
        The usage of the CMK. Valid values:
        - ENCRYPT/DECRYPT(default value): encrypts or decrypts data.
        - SIGN/VERIFY: generates or verifies a digital signature.
        """
        return pulumi.get(self, "key_usage")

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

    @property
    @pulumi.getter
    def origin(self) -> Optional[pulumi.Input[str]]:
        """
        The source of key material. Valid values: 
        - Aliyun_KMS (default value)
        - EXTERNAL
        **NOTE**: The value of this parameter is case-sensitive. If you set the `key_spec` to an asymmetric CMK type,
        you are not allowed to set the `origin` to EXTERNAL. If you set the `origin` to EXTERNAL, you must import key material.
        For more information, see [import key material](https://www.alibabacloud.com/help/en/doc-detail/68523.htm).
        """
        return pulumi.get(self, "origin")

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

    @property
    @pulumi.getter(name="pendingWindowInDays")
    def pending_window_in_days(self) -> Optional[pulumi.Input[int]]:
        """
        The number of days before the CMK is deleted. 
        During this period, the CMK is in the PendingDeletion state.
        After this period ends, you cannot cancel the deletion. Valid values: 7 to 30. Unit: days.
        """
        return pulumi.get(self, "pending_window_in_days")

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

    @property
    @pulumi.getter(name="protectionLevel")
    def protection_level(self) -> Optional[pulumi.Input[str]]:
        """
        The protection level of the CMK. Valid values:
        - SOFTWARE (default value)
        - HSM
        **NOTE**: The value of this parameter is case-sensitive. Assume that you set this parameter to HSM.
        If you set the origin parameter to Aliyun_KMS, the CMK is created in a managed hardware security module (HSM).
        If you set the origin parameter to EXTERNA, you can import an external key to the managed HSM.
        """
        return pulumi.get(self, "protection_level")

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

    @property
    @pulumi.getter(name="rotationInterval")
    def rotation_interval(self) -> Optional[pulumi.Input[str]]:
        """
        The interval for automatic key rotation. Specify the value in the integer[unit] format.
        The following units are supported: d (day), h (hour), m (minute), and s (second).
        For example, you can use either 7d or 604800s to specify a seven-day interval.
        The interval can range from 7 days to 730 days.
        **NOTE**: It is Required when `automatic_rotation = "Enabled"`
        """
        return pulumi.get(self, "rotation_interval")

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

    @property
    @pulumi.getter
    def status(self) -> Optional[pulumi.Input[str]]:
        """
        The status of CMK. Valid Values: 
        - Disabled
        - Enabled (default value)
        - PendingDeletion
        """
        return pulumi.get(self, "status")

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


@pulumi.input_type
class _KeyState:
    def __init__(__self__, *,
                 arn: Optional[pulumi.Input[str]] = None,
                 automatic_rotation: Optional[pulumi.Input[str]] = None,
                 creation_date: Optional[pulumi.Input[str]] = None,
                 creator: Optional[pulumi.Input[str]] = None,
                 delete_date: Optional[pulumi.Input[str]] = None,
                 deletion_window_in_days: Optional[pulumi.Input[int]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 is_enabled: Optional[pulumi.Input[bool]] = None,
                 key_spec: Optional[pulumi.Input[str]] = None,
                 key_state: Optional[pulumi.Input[str]] = None,
                 key_usage: Optional[pulumi.Input[str]] = None,
                 last_rotation_date: Optional[pulumi.Input[str]] = None,
                 material_expire_time: Optional[pulumi.Input[str]] = None,
                 next_rotation_date: Optional[pulumi.Input[str]] = None,
                 origin: Optional[pulumi.Input[str]] = None,
                 pending_window_in_days: Optional[pulumi.Input[int]] = None,
                 primary_key_version: Optional[pulumi.Input[str]] = None,
                 protection_level: Optional[pulumi.Input[str]] = None,
                 rotation_interval: Optional[pulumi.Input[str]] = None,
                 status: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering Key resources.
        :param pulumi.Input[str] arn: The Alicloud Resource Name (ARN) of the key.
               * `creation_date` -The date and time when the CMK was created. The time is displayed in UTC.
               * `creator` -The creator of the CMK.
               * `delete_date` -The scheduled date to delete CMK. The time is displayed in UTC. This value is returned only when the KeyState value is PendingDeletion.
        :param pulumi.Input[str] automatic_rotation: Specifies whether to enable automatic key rotation. Valid values: 
               - Enabled
               - Disabled (default value)
               **NOTE**: If you set the origin parameter to EXTERNAL or the key_spec parameter to an asymmetric CMK type, automatic key rotation is unavailable.
        :param pulumi.Input[int] deletion_window_in_days: Field `deletion_window_in_days` has been deprecated from provider version 1.85.0. New field `pending_window_in_days` instead.
        :param pulumi.Input[str] description: The description of the CMK. The description can be 0 to 8,192 characters in length.
        :param pulumi.Input[bool] is_enabled: Field `is_enabled` has been deprecated from provider version 1.85.0. New field `key_state` instead.
        :param pulumi.Input[str] key_spec: The type of the CMK. Valid values: 
               "Aliyun_AES_256", "Aliyun_AES_128", "Aliyun_AES_192", "Aliyun_SM4", "RSA_2048", "RSA_3072", "EC_P256", "EC_P256K", "EC_SM2".
               Note: The default type of the CMK is Aliyun_AES_256. Only Dedicated KMS supports Aliyun_AES_128 and Aliyun_AES_192.
        :param pulumi.Input[str] key_state: Field `key_state` has been deprecated from provider version 1.123.1. New field `status` instead.
        :param pulumi.Input[str] key_usage: The usage of the CMK. Valid values:
               - ENCRYPT/DECRYPT(default value): encrypts or decrypts data.
               - SIGN/VERIFY: generates or verifies a digital signature.
        :param pulumi.Input[str] last_rotation_date: The date and time the last rotation was performed. The time is displayed in UTC.
        :param pulumi.Input[str] material_expire_time: The time and date the key material for the CMK expires. The time is displayed in UTC. If the value is empty, the key material for the CMK does not expire.
        :param pulumi.Input[str] next_rotation_date: The time the next rotation is scheduled for execution.
        :param pulumi.Input[str] origin: The source of key material. Valid values: 
               - Aliyun_KMS (default value)
               - EXTERNAL
               **NOTE**: The value of this parameter is case-sensitive. If you set the `key_spec` to an asymmetric CMK type,
               you are not allowed to set the `origin` to EXTERNAL. If you set the `origin` to EXTERNAL, you must import key material.
               For more information, see [import key material](https://www.alibabacloud.com/help/en/doc-detail/68523.htm).
        :param pulumi.Input[int] pending_window_in_days: The number of days before the CMK is deleted. 
               During this period, the CMK is in the PendingDeletion state.
               After this period ends, you cannot cancel the deletion. Valid values: 7 to 30. Unit: days.
        :param pulumi.Input[str] primary_key_version: The ID of the current primary key version of the symmetric CMK.
        :param pulumi.Input[str] protection_level: The protection level of the CMK. Valid values:
               - SOFTWARE (default value)
               - HSM
               **NOTE**: The value of this parameter is case-sensitive. Assume that you set this parameter to HSM.
               If you set the origin parameter to Aliyun_KMS, the CMK is created in a managed hardware security module (HSM).
               If you set the origin parameter to EXTERNA, you can import an external key to the managed HSM.
        :param pulumi.Input[str] rotation_interval: The interval for automatic key rotation. Specify the value in the integer[unit] format.
               The following units are supported: d (day), h (hour), m (minute), and s (second).
               For example, you can use either 7d or 604800s to specify a seven-day interval.
               The interval can range from 7 days to 730 days.
               **NOTE**: It is Required when `automatic_rotation = "Enabled"`
        :param pulumi.Input[str] status: The status of CMK. Valid Values: 
               - Disabled
               - Enabled (default value)
               - PendingDeletion
        """
        if arn is not None:
            pulumi.set(__self__, "arn", arn)
        if automatic_rotation is not None:
            pulumi.set(__self__, "automatic_rotation", automatic_rotation)
        if creation_date is not None:
            pulumi.set(__self__, "creation_date", creation_date)
        if creator is not None:
            pulumi.set(__self__, "creator", creator)
        if delete_date is not None:
            pulumi.set(__self__, "delete_date", delete_date)
        if deletion_window_in_days is not None:
            warnings.warn("""Field 'deletion_window_in_days' has been deprecated from provider version 1.85.0. New field 'pending_window_in_days' instead.""", DeprecationWarning)
            pulumi.log.warn("""deletion_window_in_days is deprecated: Field 'deletion_window_in_days' has been deprecated from provider version 1.85.0. New field 'pending_window_in_days' instead.""")
        if deletion_window_in_days is not None:
            pulumi.set(__self__, "deletion_window_in_days", deletion_window_in_days)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if is_enabled is not None:
            warnings.warn("""Field 'is_enabled' has been deprecated from provider version 1.85.0. New field 'key_state' instead.""", DeprecationWarning)
            pulumi.log.warn("""is_enabled is deprecated: Field 'is_enabled' has been deprecated from provider version 1.85.0. New field 'key_state' instead.""")
        if is_enabled is not None:
            pulumi.set(__self__, "is_enabled", is_enabled)
        if key_spec is not None:
            pulumi.set(__self__, "key_spec", key_spec)
        if key_state is not None:
            warnings.warn("""Field 'key_state' has been deprecated from provider version 1.123.1. New field 'status' instead.""", DeprecationWarning)
            pulumi.log.warn("""key_state is deprecated: Field 'key_state' has been deprecated from provider version 1.123.1. New field 'status' instead.""")
        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 last_rotation_date is not None:
            pulumi.set(__self__, "last_rotation_date", last_rotation_date)
        if material_expire_time is not None:
            pulumi.set(__self__, "material_expire_time", material_expire_time)
        if next_rotation_date is not None:
            pulumi.set(__self__, "next_rotation_date", next_rotation_date)
        if origin is not None:
            pulumi.set(__self__, "origin", origin)
        if pending_window_in_days is not None:
            pulumi.set(__self__, "pending_window_in_days", pending_window_in_days)
        if primary_key_version is not None:
            pulumi.set(__self__, "primary_key_version", primary_key_version)
        if protection_level is not None:
            pulumi.set(__self__, "protection_level", protection_level)
        if rotation_interval is not None:
            pulumi.set(__self__, "rotation_interval", rotation_interval)
        if status is not None:
            pulumi.set(__self__, "status", status)

    @property
    @pulumi.getter
    def arn(self) -> Optional[pulumi.Input[str]]:
        """
        The Alicloud Resource Name (ARN) of the key.
        * `creation_date` -The date and time when the CMK was created. The time is displayed in UTC.
        * `creator` -The creator of the CMK.
        * `delete_date` -The scheduled date to delete CMK. The time is displayed in UTC. This value is returned only when the KeyState value is PendingDeletion.
        """
        return pulumi.get(self, "arn")

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

    @property
    @pulumi.getter(name="automaticRotation")
    def automatic_rotation(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies whether to enable automatic key rotation. Valid values: 
        - Enabled
        - Disabled (default value)
        **NOTE**: If you set the origin parameter to EXTERNAL or the key_spec parameter to an asymmetric CMK type, automatic key rotation is unavailable.
        """
        return pulumi.get(self, "automatic_rotation")

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

    @property
    @pulumi.getter(name="creationDate")
    def creation_date(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "creation_date")

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

    @property
    @pulumi.getter
    def creator(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "creator")

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

    @property
    @pulumi.getter(name="deleteDate")
    def delete_date(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "delete_date")

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

    @property
    @pulumi.getter(name="deletionWindowInDays")
    def deletion_window_in_days(self) -> Optional[pulumi.Input[int]]:
        """
        Field `deletion_window_in_days` has been deprecated from provider version 1.85.0. New field `pending_window_in_days` instead.
        """
        return pulumi.get(self, "deletion_window_in_days")

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

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[str]]:
        """
        The description of the CMK. The description can be 0 to 8,192 characters in length.
        """
        return pulumi.get(self, "description")

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

    @property
    @pulumi.getter(name="isEnabled")
    def is_enabled(self) -> Optional[pulumi.Input[bool]]:
        """
        Field `is_enabled` has been deprecated from provider version 1.85.0. New field `key_state` instead.
        """
        return pulumi.get(self, "is_enabled")

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

    @property
    @pulumi.getter(name="keySpec")
    def key_spec(self) -> Optional[pulumi.Input[str]]:
        """
        The type of the CMK. Valid values: 
        "Aliyun_AES_256", "Aliyun_AES_128", "Aliyun_AES_192", "Aliyun_SM4", "RSA_2048", "RSA_3072", "EC_P256", "EC_P256K", "EC_SM2".
        Note: The default type of the CMK is Aliyun_AES_256. Only Dedicated KMS supports Aliyun_AES_128 and Aliyun_AES_192.
        """
        return pulumi.get(self, "key_spec")

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

    @property
    @pulumi.getter(name="keyState")
    def key_state(self) -> Optional[pulumi.Input[str]]:
        """
        Field `key_state` has been deprecated from provider version 1.123.1. New field `status` instead.
        """
        return pulumi.get(self, "key_state")

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

    @property
    @pulumi.getter(name="keyUsage")
    def key_usage(self) -> Optional[pulumi.Input[str]]:
        """
        The usage of the CMK. Valid values:
        - ENCRYPT/DECRYPT(default value): encrypts or decrypts data.
        - SIGN/VERIFY: generates or verifies a digital signature.
        """
        return pulumi.get(self, "key_usage")

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

    @property
    @pulumi.getter(name="lastRotationDate")
    def last_rotation_date(self) -> Optional[pulumi.Input[str]]:
        """
        The date and time the last rotation was performed. The time is displayed in UTC.
        """
        return pulumi.get(self, "last_rotation_date")

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

    @property
    @pulumi.getter(name="materialExpireTime")
    def material_expire_time(self) -> Optional[pulumi.Input[str]]:
        """
        The time and date the key material for the CMK expires. The time is displayed in UTC. If the value is empty, the key material for the CMK does not expire.
        """
        return pulumi.get(self, "material_expire_time")

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

    @property
    @pulumi.getter(name="nextRotationDate")
    def next_rotation_date(self) -> Optional[pulumi.Input[str]]:
        """
        The time the next rotation is scheduled for execution.
        """
        return pulumi.get(self, "next_rotation_date")

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

    @property
    @pulumi.getter
    def origin(self) -> Optional[pulumi.Input[str]]:
        """
        The source of key material. Valid values: 
        - Aliyun_KMS (default value)
        - EXTERNAL
        **NOTE**: The value of this parameter is case-sensitive. If you set the `key_spec` to an asymmetric CMK type,
        you are not allowed to set the `origin` to EXTERNAL. If you set the `origin` to EXTERNAL, you must import key material.
        For more information, see [import key material](https://www.alibabacloud.com/help/en/doc-detail/68523.htm).
        """
        return pulumi.get(self, "origin")

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

    @property
    @pulumi.getter(name="pendingWindowInDays")
    def pending_window_in_days(self) -> Optional[pulumi.Input[int]]:
        """
        The number of days before the CMK is deleted. 
        During this period, the CMK is in the PendingDeletion state.
        After this period ends, you cannot cancel the deletion. Valid values: 7 to 30. Unit: days.
        """
        return pulumi.get(self, "pending_window_in_days")

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

    @property
    @pulumi.getter(name="primaryKeyVersion")
    def primary_key_version(self) -> Optional[pulumi.Input[str]]:
        """
        The ID of the current primary key version of the symmetric CMK.
        """
        return pulumi.get(self, "primary_key_version")

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

    @property
    @pulumi.getter(name="protectionLevel")
    def protection_level(self) -> Optional[pulumi.Input[str]]:
        """
        The protection level of the CMK. Valid values:
        - SOFTWARE (default value)
        - HSM
        **NOTE**: The value of this parameter is case-sensitive. Assume that you set this parameter to HSM.
        If you set the origin parameter to Aliyun_KMS, the CMK is created in a managed hardware security module (HSM).
        If you set the origin parameter to EXTERNA, you can import an external key to the managed HSM.
        """
        return pulumi.get(self, "protection_level")

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

    @property
    @pulumi.getter(name="rotationInterval")
    def rotation_interval(self) -> Optional[pulumi.Input[str]]:
        """
        The interval for automatic key rotation. Specify the value in the integer[unit] format.
        The following units are supported: d (day), h (hour), m (minute), and s (second).
        For example, you can use either 7d or 604800s to specify a seven-day interval.
        The interval can range from 7 days to 730 days.
        **NOTE**: It is Required when `automatic_rotation = "Enabled"`
        """
        return pulumi.get(self, "rotation_interval")

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

    @property
    @pulumi.getter
    def status(self) -> Optional[pulumi.Input[str]]:
        """
        The status of CMK. Valid Values: 
        - Disabled
        - Enabled (default value)
        - PendingDeletion
        """
        return pulumi.get(self, "status")

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


class Key(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 automatic_rotation: Optional[pulumi.Input[str]] = None,
                 deletion_window_in_days: Optional[pulumi.Input[int]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 is_enabled: Optional[pulumi.Input[bool]] = None,
                 key_spec: Optional[pulumi.Input[str]] = None,
                 key_state: Optional[pulumi.Input[str]] = None,
                 key_usage: Optional[pulumi.Input[str]] = None,
                 origin: Optional[pulumi.Input[str]] = None,
                 pending_window_in_days: Optional[pulumi.Input[int]] = None,
                 protection_level: Optional[pulumi.Input[str]] = None,
                 rotation_interval: Optional[pulumi.Input[str]] = None,
                 status: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        A kms key can help user to protect data security in the transmission process. For information about Alikms Key and how to use it, see [What is Resource Alikms Key](https://www.alibabacloud.com/help/doc-detail/28947.htm).

        > **NOTE:** Available in v1.85.0+.

        ## Example Usage

        Basic Usage

        ```python
        import pulumi
        import pulumi_alicloud as alicloud

        key = alicloud.kms.Key("key",
            description="Hello KMS",
            pending_window_in_days=7,
            status="Enabled")
        ```

        ## Import

        Alikms key can be imported using the id, e.g.

        ```sh
         $ pulumi import alicloud:kms/key:Key example abc123456
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] automatic_rotation: Specifies whether to enable automatic key rotation. Valid values: 
               - Enabled
               - Disabled (default value)
               **NOTE**: If you set the origin parameter to EXTERNAL or the key_spec parameter to an asymmetric CMK type, automatic key rotation is unavailable.
        :param pulumi.Input[int] deletion_window_in_days: Field `deletion_window_in_days` has been deprecated from provider version 1.85.0. New field `pending_window_in_days` instead.
        :param pulumi.Input[str] description: The description of the CMK. The description can be 0 to 8,192 characters in length.
        :param pulumi.Input[bool] is_enabled: Field `is_enabled` has been deprecated from provider version 1.85.0. New field `key_state` instead.
        :param pulumi.Input[str] key_spec: The type of the CMK. Valid values: 
               "Aliyun_AES_256", "Aliyun_AES_128", "Aliyun_AES_192", "Aliyun_SM4", "RSA_2048", "RSA_3072", "EC_P256", "EC_P256K", "EC_SM2".
               Note: The default type of the CMK is Aliyun_AES_256. Only Dedicated KMS supports Aliyun_AES_128 and Aliyun_AES_192.
        :param pulumi.Input[str] key_state: Field `key_state` has been deprecated from provider version 1.123.1. New field `status` instead.
        :param pulumi.Input[str] key_usage: The usage of the CMK. Valid values:
               - ENCRYPT/DECRYPT(default value): encrypts or decrypts data.
               - SIGN/VERIFY: generates or verifies a digital signature.
        :param pulumi.Input[str] origin: The source of key material. Valid values: 
               - Aliyun_KMS (default value)
               - EXTERNAL
               **NOTE**: The value of this parameter is case-sensitive. If you set the `key_spec` to an asymmetric CMK type,
               you are not allowed to set the `origin` to EXTERNAL. If you set the `origin` to EXTERNAL, you must import key material.
               For more information, see [import key material](https://www.alibabacloud.com/help/en/doc-detail/68523.htm).
        :param pulumi.Input[int] pending_window_in_days: The number of days before the CMK is deleted. 
               During this period, the CMK is in the PendingDeletion state.
               After this period ends, you cannot cancel the deletion. Valid values: 7 to 30. Unit: days.
        :param pulumi.Input[str] protection_level: The protection level of the CMK. Valid values:
               - SOFTWARE (default value)
               - HSM
               **NOTE**: The value of this parameter is case-sensitive. Assume that you set this parameter to HSM.
               If you set the origin parameter to Aliyun_KMS, the CMK is created in a managed hardware security module (HSM).
               If you set the origin parameter to EXTERNA, you can import an external key to the managed HSM.
        :param pulumi.Input[str] rotation_interval: The interval for automatic key rotation. Specify the value in the integer[unit] format.
               The following units are supported: d (day), h (hour), m (minute), and s (second).
               For example, you can use either 7d or 604800s to specify a seven-day interval.
               The interval can range from 7 days to 730 days.
               **NOTE**: It is Required when `automatic_rotation = "Enabled"`
        :param pulumi.Input[str] status: The status of CMK. Valid Values: 
               - Disabled
               - Enabled (default value)
               - PendingDeletion
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: Optional[KeyArgs] = None,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        A kms key can help user to protect data security in the transmission process. For information about Alikms Key and how to use it, see [What is Resource Alikms Key](https://www.alibabacloud.com/help/doc-detail/28947.htm).

        > **NOTE:** Available in v1.85.0+.

        ## Example Usage

        Basic Usage

        ```python
        import pulumi
        import pulumi_alicloud as alicloud

        key = alicloud.kms.Key("key",
            description="Hello KMS",
            pending_window_in_days=7,
            status="Enabled")
        ```

        ## Import

        Alikms key can be imported using the id, e.g.

        ```sh
         $ pulumi import alicloud:kms/key:Key example abc123456
        ```

        :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,
                 automatic_rotation: Optional[pulumi.Input[str]] = None,
                 deletion_window_in_days: Optional[pulumi.Input[int]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 is_enabled: Optional[pulumi.Input[bool]] = None,
                 key_spec: Optional[pulumi.Input[str]] = None,
                 key_state: Optional[pulumi.Input[str]] = None,
                 key_usage: Optional[pulumi.Input[str]] = None,
                 origin: Optional[pulumi.Input[str]] = None,
                 pending_window_in_days: Optional[pulumi.Input[int]] = None,
                 protection_level: Optional[pulumi.Input[str]] = None,
                 rotation_interval: Optional[pulumi.Input[str]] = None,
                 status: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = _utilities.get_version()
        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__["automatic_rotation"] = automatic_rotation
            if deletion_window_in_days is not None and not opts.urn:
                warnings.warn("""Field 'deletion_window_in_days' has been deprecated from provider version 1.85.0. New field 'pending_window_in_days' instead.""", DeprecationWarning)
                pulumi.log.warn("""deletion_window_in_days is deprecated: Field 'deletion_window_in_days' has been deprecated from provider version 1.85.0. New field 'pending_window_in_days' instead.""")
            __props__.__dict__["deletion_window_in_days"] = deletion_window_in_days
            __props__.__dict__["description"] = description
            if is_enabled is not None and not opts.urn:
                warnings.warn("""Field 'is_enabled' has been deprecated from provider version 1.85.0. New field 'key_state' instead.""", DeprecationWarning)
                pulumi.log.warn("""is_enabled is deprecated: Field 'is_enabled' has been deprecated from provider version 1.85.0. New field 'key_state' instead.""")
            __props__.__dict__["is_enabled"] = is_enabled
            __props__.__dict__["key_spec"] = key_spec
            if key_state is not None and not opts.urn:
                warnings.warn("""Field 'key_state' has been deprecated from provider version 1.123.1. New field 'status' instead.""", DeprecationWarning)
                pulumi.log.warn("""key_state is deprecated: Field 'key_state' has been deprecated from provider version 1.123.1. New field 'status' instead.""")
            __props__.__dict__["key_state"] = key_state
            __props__.__dict__["key_usage"] = key_usage
            __props__.__dict__["origin"] = origin
            __props__.__dict__["pending_window_in_days"] = pending_window_in_days
            __props__.__dict__["protection_level"] = protection_level
            __props__.__dict__["rotation_interval"] = rotation_interval
            __props__.__dict__["status"] = status
            __props__.__dict__["arn"] = None
            __props__.__dict__["creation_date"] = None
            __props__.__dict__["creator"] = None
            __props__.__dict__["delete_date"] = None
            __props__.__dict__["last_rotation_date"] = None
            __props__.__dict__["material_expire_time"] = None
            __props__.__dict__["next_rotation_date"] = None
            __props__.__dict__["primary_key_version"] = None
        super(Key, __self__).__init__(
            'alicloud:kms/key:Key',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            arn: Optional[pulumi.Input[str]] = None,
            automatic_rotation: Optional[pulumi.Input[str]] = None,
            creation_date: Optional[pulumi.Input[str]] = None,
            creator: Optional[pulumi.Input[str]] = None,
            delete_date: Optional[pulumi.Input[str]] = None,
            deletion_window_in_days: Optional[pulumi.Input[int]] = None,
            description: Optional[pulumi.Input[str]] = None,
            is_enabled: Optional[pulumi.Input[bool]] = None,
            key_spec: Optional[pulumi.Input[str]] = None,
            key_state: Optional[pulumi.Input[str]] = None,
            key_usage: Optional[pulumi.Input[str]] = None,
            last_rotation_date: Optional[pulumi.Input[str]] = None,
            material_expire_time: Optional[pulumi.Input[str]] = None,
            next_rotation_date: Optional[pulumi.Input[str]] = None,
            origin: Optional[pulumi.Input[str]] = None,
            pending_window_in_days: Optional[pulumi.Input[int]] = None,
            primary_key_version: Optional[pulumi.Input[str]] = None,
            protection_level: Optional[pulumi.Input[str]] = None,
            rotation_interval: Optional[pulumi.Input[str]] = None,
            status: Optional[pulumi.Input[str]] = 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[str] arn: The Alicloud Resource Name (ARN) of the key.
               * `creation_date` -The date and time when the CMK was created. The time is displayed in UTC.
               * `creator` -The creator of the CMK.
               * `delete_date` -The scheduled date to delete CMK. The time is displayed in UTC. This value is returned only when the KeyState value is PendingDeletion.
        :param pulumi.Input[str] automatic_rotation: Specifies whether to enable automatic key rotation. Valid values: 
               - Enabled
               - Disabled (default value)
               **NOTE**: If you set the origin parameter to EXTERNAL or the key_spec parameter to an asymmetric CMK type, automatic key rotation is unavailable.
        :param pulumi.Input[int] deletion_window_in_days: Field `deletion_window_in_days` has been deprecated from provider version 1.85.0. New field `pending_window_in_days` instead.
        :param pulumi.Input[str] description: The description of the CMK. The description can be 0 to 8,192 characters in length.
        :param pulumi.Input[bool] is_enabled: Field `is_enabled` has been deprecated from provider version 1.85.0. New field `key_state` instead.
        :param pulumi.Input[str] key_spec: The type of the CMK. Valid values: 
               "Aliyun_AES_256", "Aliyun_AES_128", "Aliyun_AES_192", "Aliyun_SM4", "RSA_2048", "RSA_3072", "EC_P256", "EC_P256K", "EC_SM2".
               Note: The default type of the CMK is Aliyun_AES_256. Only Dedicated KMS supports Aliyun_AES_128 and Aliyun_AES_192.
        :param pulumi.Input[str] key_state: Field `key_state` has been deprecated from provider version 1.123.1. New field `status` instead.
        :param pulumi.Input[str] key_usage: The usage of the CMK. Valid values:
               - ENCRYPT/DECRYPT(default value): encrypts or decrypts data.
               - SIGN/VERIFY: generates or verifies a digital signature.
        :param pulumi.Input[str] last_rotation_date: The date and time the last rotation was performed. The time is displayed in UTC.
        :param pulumi.Input[str] material_expire_time: The time and date the key material for the CMK expires. The time is displayed in UTC. If the value is empty, the key material for the CMK does not expire.
        :param pulumi.Input[str] next_rotation_date: The time the next rotation is scheduled for execution.
        :param pulumi.Input[str] origin: The source of key material. Valid values: 
               - Aliyun_KMS (default value)
               - EXTERNAL
               **NOTE**: The value of this parameter is case-sensitive. If you set the `key_spec` to an asymmetric CMK type,
               you are not allowed to set the `origin` to EXTERNAL. If you set the `origin` to EXTERNAL, you must import key material.
               For more information, see [import key material](https://www.alibabacloud.com/help/en/doc-detail/68523.htm).
        :param pulumi.Input[int] pending_window_in_days: The number of days before the CMK is deleted. 
               During this period, the CMK is in the PendingDeletion state.
               After this period ends, you cannot cancel the deletion. Valid values: 7 to 30. Unit: days.
        :param pulumi.Input[str] primary_key_version: The ID of the current primary key version of the symmetric CMK.
        :param pulumi.Input[str] protection_level: The protection level of the CMK. Valid values:
               - SOFTWARE (default value)
               - HSM
               **NOTE**: The value of this parameter is case-sensitive. Assume that you set this parameter to HSM.
               If you set the origin parameter to Aliyun_KMS, the CMK is created in a managed hardware security module (HSM).
               If you set the origin parameter to EXTERNA, you can import an external key to the managed HSM.
        :param pulumi.Input[str] rotation_interval: The interval for automatic key rotation. Specify the value in the integer[unit] format.
               The following units are supported: d (day), h (hour), m (minute), and s (second).
               For example, you can use either 7d or 604800s to specify a seven-day interval.
               The interval can range from 7 days to 730 days.
               **NOTE**: It is Required when `automatic_rotation = "Enabled"`
        :param pulumi.Input[str] status: The status of CMK. Valid Values: 
               - Disabled
               - Enabled (default value)
               - PendingDeletion
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _KeyState.__new__(_KeyState)

        __props__.__dict__["arn"] = arn
        __props__.__dict__["automatic_rotation"] = automatic_rotation
        __props__.__dict__["creation_date"] = creation_date
        __props__.__dict__["creator"] = creator
        __props__.__dict__["delete_date"] = delete_date
        __props__.__dict__["deletion_window_in_days"] = deletion_window_in_days
        __props__.__dict__["description"] = description
        __props__.__dict__["is_enabled"] = is_enabled
        __props__.__dict__["key_spec"] = key_spec
        __props__.__dict__["key_state"] = key_state
        __props__.__dict__["key_usage"] = key_usage
        __props__.__dict__["last_rotation_date"] = last_rotation_date
        __props__.__dict__["material_expire_time"] = material_expire_time
        __props__.__dict__["next_rotation_date"] = next_rotation_date
        __props__.__dict__["origin"] = origin
        __props__.__dict__["pending_window_in_days"] = pending_window_in_days
        __props__.__dict__["primary_key_version"] = primary_key_version
        __props__.__dict__["protection_level"] = protection_level
        __props__.__dict__["rotation_interval"] = rotation_interval
        __props__.__dict__["status"] = status
        return Key(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def arn(self) -> pulumi.Output[str]:
        """
        The Alicloud Resource Name (ARN) of the key.
        * `creation_date` -The date and time when the CMK was created. The time is displayed in UTC.
        * `creator` -The creator of the CMK.
        * `delete_date` -The scheduled date to delete CMK. The time is displayed in UTC. This value is returned only when the KeyState value is PendingDeletion.
        """
        return pulumi.get(self, "arn")

    @property
    @pulumi.getter(name="automaticRotation")
    def automatic_rotation(self) -> pulumi.Output[Optional[str]]:
        """
        Specifies whether to enable automatic key rotation. Valid values: 
        - Enabled
        - Disabled (default value)
        **NOTE**: If you set the origin parameter to EXTERNAL or the key_spec parameter to an asymmetric CMK type, automatic key rotation is unavailable.
        """
        return pulumi.get(self, "automatic_rotation")

    @property
    @pulumi.getter(name="creationDate")
    def creation_date(self) -> pulumi.Output[str]:
        return pulumi.get(self, "creation_date")

    @property
    @pulumi.getter
    def creator(self) -> pulumi.Output[str]:
        return pulumi.get(self, "creator")

    @property
    @pulumi.getter(name="deleteDate")
    def delete_date(self) -> pulumi.Output[str]:
        return pulumi.get(self, "delete_date")

    @property
    @pulumi.getter(name="deletionWindowInDays")
    def deletion_window_in_days(self) -> pulumi.Output[int]:
        """
        Field `deletion_window_in_days` has been deprecated from provider version 1.85.0. New field `pending_window_in_days` instead.
        """
        return pulumi.get(self, "deletion_window_in_days")

    @property
    @pulumi.getter
    def description(self) -> pulumi.Output[Optional[str]]:
        """
        The description of the CMK. The description can be 0 to 8,192 characters in length.
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="isEnabled")
    def is_enabled(self) -> pulumi.Output[Optional[bool]]:
        """
        Field `is_enabled` has been deprecated from provider version 1.85.0. New field `key_state` instead.
        """
        return pulumi.get(self, "is_enabled")

    @property
    @pulumi.getter(name="keySpec")
    def key_spec(self) -> pulumi.Output[str]:
        """
        The type of the CMK. Valid values: 
        "Aliyun_AES_256", "Aliyun_AES_128", "Aliyun_AES_192", "Aliyun_SM4", "RSA_2048", "RSA_3072", "EC_P256", "EC_P256K", "EC_SM2".
        Note: The default type of the CMK is Aliyun_AES_256. Only Dedicated KMS supports Aliyun_AES_128 and Aliyun_AES_192.
        """
        return pulumi.get(self, "key_spec")

    @property
    @pulumi.getter(name="keyState")
    def key_state(self) -> pulumi.Output[str]:
        """
        Field `key_state` has been deprecated from provider version 1.123.1. New field `status` instead.
        """
        return pulumi.get(self, "key_state")

    @property
    @pulumi.getter(name="keyUsage")
    def key_usage(self) -> pulumi.Output[Optional[str]]:
        """
        The usage of the CMK. Valid values:
        - ENCRYPT/DECRYPT(default value): encrypts or decrypts data.
        - SIGN/VERIFY: generates or verifies a digital signature.
        """
        return pulumi.get(self, "key_usage")

    @property
    @pulumi.getter(name="lastRotationDate")
    def last_rotation_date(self) -> pulumi.Output[str]:
        """
        The date and time the last rotation was performed. The time is displayed in UTC.
        """
        return pulumi.get(self, "last_rotation_date")

    @property
    @pulumi.getter(name="materialExpireTime")
    def material_expire_time(self) -> pulumi.Output[str]:
        """
        The time and date the key material for the CMK expires. The time is displayed in UTC. If the value is empty, the key material for the CMK does not expire.
        """
        return pulumi.get(self, "material_expire_time")

    @property
    @pulumi.getter(name="nextRotationDate")
    def next_rotation_date(self) -> pulumi.Output[str]:
        """
        The time the next rotation is scheduled for execution.
        """
        return pulumi.get(self, "next_rotation_date")

    @property
    @pulumi.getter
    def origin(self) -> pulumi.Output[Optional[str]]:
        """
        The source of key material. Valid values: 
        - Aliyun_KMS (default value)
        - EXTERNAL
        **NOTE**: The value of this parameter is case-sensitive. If you set the `key_spec` to an asymmetric CMK type,
        you are not allowed to set the `origin` to EXTERNAL. If you set the `origin` to EXTERNAL, you must import key material.
        For more information, see [import key material](https://www.alibabacloud.com/help/en/doc-detail/68523.htm).
        """
        return pulumi.get(self, "origin")

    @property
    @pulumi.getter(name="pendingWindowInDays")
    def pending_window_in_days(self) -> pulumi.Output[int]:
        """
        The number of days before the CMK is deleted. 
        During this period, the CMK is in the PendingDeletion state.
        After this period ends, you cannot cancel the deletion. Valid values: 7 to 30. Unit: days.
        """
        return pulumi.get(self, "pending_window_in_days")

    @property
    @pulumi.getter(name="primaryKeyVersion")
    def primary_key_version(self) -> pulumi.Output[str]:
        """
        The ID of the current primary key version of the symmetric CMK.
        """
        return pulumi.get(self, "primary_key_version")

    @property
    @pulumi.getter(name="protectionLevel")
    def protection_level(self) -> pulumi.Output[Optional[str]]:
        """
        The protection level of the CMK. Valid values:
        - SOFTWARE (default value)
        - HSM
        **NOTE**: The value of this parameter is case-sensitive. Assume that you set this parameter to HSM.
        If you set the origin parameter to Aliyun_KMS, the CMK is created in a managed hardware security module (HSM).
        If you set the origin parameter to EXTERNA, you can import an external key to the managed HSM.
        """
        return pulumi.get(self, "protection_level")

    @property
    @pulumi.getter(name="rotationInterval")
    def rotation_interval(self) -> pulumi.Output[Optional[str]]:
        """
        The interval for automatic key rotation. Specify the value in the integer[unit] format.
        The following units are supported: d (day), h (hour), m (minute), and s (second).
        For example, you can use either 7d or 604800s to specify a seven-day interval.
        The interval can range from 7 days to 730 days.
        **NOTE**: It is Required when `automatic_rotation = "Enabled"`
        """
        return pulumi.get(self, "rotation_interval")

    @property
    @pulumi.getter
    def status(self) -> pulumi.Output[str]:
        """
        The status of CMK. Valid Values: 
        - Disabled
        - Enabled (default value)
        - PendingDeletion
        """
        return pulumi.get(self, "status")

