Key states of AWS KMS keys - AWS Key Management Service

Key states of AWS KMS keys

An AWS KMS key always has a key state. Operations on the KMS key and its environment can change that key state, either transiently, or until another operation changes its key state.

The table in this section shows how key states affect calls to AWS KMS API operations. As a result of its key state, an operation on a KMS key is expected to succeed (), fail (X), or succeed only under certain conditions (?). The result often differs for KMS keys with imported key material.

This table includes only the API operations that use an existing KMS key. Other operations, such as CreateKey and ListKeys, are omitted.

Key states and KMS key types

The type of the KMS key determines the key states it can have.

  • All KMS keys can be in the Enabled, Disabled, and PendingDeletion states.

  • Most KMS keys are created in the Enabled state. Keys with imported key material are created in the PendingImport state.

  • The PendingImport state applies only to KMS keys with imported key material.

  • The Unavailable state applies only to a KMS key in a custom key store. A KMS key in an AWS CloudHSM key store is Unavailable when the custom key store is intentionally disconnected from its AWS CloudHSM cluster. A KMS key in an external key store is Unavailable when the custom key store is intentionally disconnected from its external key store proxy. You can view and manage unavailable KMS keys, but you cannot use them in cryptographic operations.

    The key state of a KMS key in a custom key store is not affected by changes to its backing key. A KMS key in a AWS CloudHSM key store is not affected by changes to its associated key material in the AWS CloudHSM cluster. A KMS key in an external key store is not affected by changes to its external key in an external key manager. If the backing key is disabled or deleted, the KMS key state doesn't change, but cryptographic operations using the KMS key fail.

  • The Creating, Updating, and PendingReplicaDeletion key states apply only to multi-Region keys.

    • A multi-Region replica key is in the transient Creating key state while it is being created. This process might still be in progress when the ReplicateKey operation completes. When the replicate process completes, the replica key is in the Enabled or PendingImport state.

    • Multi-Region keys are in the transient Updating key state while the primary Region is being updated. This process might still be in progress when the UpdatePrimaryRegion operation completes. When the update process completes, the primary and replica keys resume the Enabled key state.

    • When you schedule deletion of a multi-Region primary key that has replica keys, the primary key is in the PendingReplicaDeletion state until all of its replica keys are deleted. Then its key state changes to PendingDeletion. For details, see Deleting multi-Region keys.

Key state table

The following table shows how the key state of a KMS key affects AWS KMS operations.

The descriptions of the numbered footnotes ([n]) are at the end of this topic.

Note

You might need to scroll horizontally or vertically to see all of the data in this table.

API Enabled Disabled

Pending deletion

Pending replica deletion

Pending import Unavailable Creating Updating
CancelKeyDeletion Disabled pending deleteion.

[4]

Disabled pending deleteion.

[4]

Successful. Disabled pending deleteion.

[4]

Disabled pending deleteion.

[4], [13]

Disabled pending deleteion.

[4]

Disabled pending deleteion.

[4]

CreateAlias Successful. Successful. Disabled pending deleteion.

[3]

Successful. Successful. Successful. Successful.
CreateGrant Successful. Disabled pending deleteion.

[1]

Disabled pending deleteion.

[2] or [3]

Disabled pending deleteion.

[5]

Successful. Disabled pending deleteion.

[14]

Successful.
Decrypt Successful. Disabled pending deleteion.

[1]

Disabled pending deleteion.

[2] or [3]

Disabled pending deleteion.

[5]

Disabled pending deleteion.

[11]

Disabled pending deleteion.

[14]

Successful.
DeleteAlias Successful. Successful. Successful. Successful. Successful. Successful. Successful.
DeleteImportedKeyMaterial Successful.

[9]

Successful.

[9]

Successful.

[9]

Successful.

(No effect)

N/A Disabled pending deleteion.

[14]

Disabled pending deleteion.

[15]

DescribeKey Successful. Successful. Successful. Successful. Successful. Successful. Successful.
DisableKey Successful. Successful. Disabled pending deleteion.

[3]

Disabled pending deleteion.

[5]

Successful.

[12]

Disabled pending deleteion.

[14]

Disabled pending deleteion.

[15]

DisableKeyRotation Question mark.

[7]

Disabled pending deleteion.

[1] or [7]

Disabled pending deleteion.

[3] or [7]

Disabled pending deleteion.

[6]

Disabled pending deleteion.

[7]

Disabled pending deleteion.

[14]

Question mark.

[7]

EnableKey Successful. Successful. Disabled pending deleteion.

[3]

Disabled pending deleteion.

[5]

Successful.

[12]

Disabled pending deleteion.

[14]

Disabled pending deleteion.

[15]

EnableKeyRotation Question mark.

[7]

Disabled pending deleteion.

[1] or [7]

Disabled pending deleteion.

[3] or [7]

Disabled pending deleteion.

[6]

Disabled pending deleteion.

[7]

Disabled pending deleteion.

[14]

Question mark.

[7]

Encrypt Successful. Disabled pending deleteion.

[1]

Disabled pending deleteion.

[2] or [3]

Disabled pending deleteion.

[5]

Disabled pending deleteion.

[11]

Disabled pending deleteion.

[14]

Successful.
GenerateDataKey Successful. Disabled pending deleteion.

[1]

Disabled pending deleteion.

[2] or [3]

Disabled pending deleteion.

[5]

Disabled pending deleteion.

[11]

Disabled pending deleteion.

[14]

Successful.
GenerateDataKeyPair Successful. Disabled pending deleteion.

[1]

Disabled pending deleteion.

[2] or [3]

Disabled pending deleteion.

[5]

Disabled pending deleteion.

[11]

Disabled pending deleteion.

[14]

Successful.
GenerateDataKeyPairWithoutPlaintext Successful. Disabled pending deleteion.

[1]

Disabled pending deleteion.

[2] or [3]

Disabled pending deleteion.

[5]

Disabled pending deleteion.

[11]

Disabled pending deleteion.

[14]

Successful.
GenerateDataKeyWithoutPlaintext Successful. Disabled pending deleteion.

[1]

Disabled pending deleteion.

[2] or [3]

Disabled pending deleteion.

[5]

Disabled pending deleteion.

[11]

Disabled pending deleteion.

[14]

Successful.
GenerateMac Successful. Disabled pending deleteion.

[1]

Disabled pending deleteion.

[2] or [3]

N/A N/A Disabled pending deleteion.

[14]

Successful.
GetKeyPolicy Successful. Successful. Successful. Successful. Successful. Successful. Successful.
GetKeyRotationStatus Question mark.

[7]

Question mark.

[7]

Question mark.

[7]

Disabled pending deleteion.

[6]

Disabled pending deleteion.

[7]

Question mark.

[7]

Question mark.

[7]

GetParametersForImport Question mark.

[9]

Question mark.

[9]

Disabled pending deleteion.

[8] or [9]

Successful. Disabled pending deleteion.

[9]

Disabled pending deleteion.

[14]

Disabled pending deleteion.

[15]

GetPublicKey Successful. Successful. Disabled pending deleteion.

[2] or [3]

N/A N/A Disabled pending deleteion.

[14]

Successful.
ImportKeyMaterial Question mark.

[9]

Question mark.

[9]

Disabled pending deleteion.

[8] or [9]

Successful. Disabled pending deleteion.

[9]

Disabled pending deleteion.

[14]

Successful.
ListAliases Successful. Successful. Successful. Successful. Successful. Successful. Successful.
ListGrants Successful. Successful. Successful. Successful. Successful. Successful. Successful.
ListKeyPolicies Successful. Successful. Successful. Successful. Successful. Successful. Successful.
ListKeyRotations Question mark.

[7]

Question mark.

[7]

Question mark.

[7]

Disabled pending deleteion.

[6]

Disabled pending deleteion.

[7]

Question mark.

[7]

Question mark.

[7]

ListResourceTags Successful. Successful. Successful. Successful. Successful. Successful. Successful.
PutKeyPolicy Successful. Successful. Successful. Successful. Successful. Successful. Successful.
ReEncrypt Successful. Disabled pending deleteion.

[1]

Disabled pending deleteion.

[2] or [3]

Disabled pending deleteion.

[5]

Disabled pending deleteion.

[11]

Disabled pending deleteion.

[14]

Successful.
ReplicateKey Successful. Disabled pending deleteion.

[1]

Disabled pending deleteion.

[2] or [3]

Disabled pending deleteion.

[5]

N/A Disabled pending deleteion.

[14]

Disabled pending deleteion.

[15]

RetireGrant Successful. Successful. Successful. Successful. Successful. Successful. Successful.
RevokeGrant Successful. Successful. Successful. Successful. Successful. Successful. Successful.
RotateKeyOnDemand Question mark.

[7]

Disabled pending deleteion.

[1] or [7]

Disabled pending deleteion.

[3] or [7]

Disabled pending deleteion.

[6]

Disabled pending deleteion.

[7]

Disabled pending deleteion.

[14]

Question mark.

[7]

ScheduleKeyDeletion Successful. Successful. Disabled pending deleteion.

[3]

Successful. Successful. Successful. Disabled pending deleteion.

[15]

Sign Successful. Disabled pending deleteion.

[1]

Disabled pending deleteion.

[2] or [3]

N/A N/A Disabled pending deleteion.

[14]

Successful.
TagResource Successful. Successful. Disabled pending deleteion.

[3]

Successful. Successful. Successful. Successful.
UntagResource Successful. Successful. Disabled pending deleteion.

[3]

Successful. Successful. Successful. Successful.
UpdateAlias Successful. Successful. Question mark.

[10]

Successful. Successful. Successful. Successful.
UpdateKeyDescription Successful. Successful. Disabled pending deleteion.

[3]

Successful. Successful. Successful. Successful.
UpdatePrimaryRegion Successful. Disabled pending deleteion.

[1]

Disabled pending deleteion.

[2] or [3]

Disabled pending deleteion.

[5]

N/A Disabled pending deleteion.

[14]

Successful.
Verify Successful. Disabled pending deleteion.

[1]

Disabled pending deleteion.

[2] or [3]

N/A N/A Disabled pending deleteion.

[14]

Successful.
VerifyMac Successful. Disabled pending deleteion.

[1]

Disabled pending deleteion.

[2] or [3]

N/A N/A Disabled pending deleteion.

[14]

Successful.

Table Details

  • [1] DisabledException: <key ARN> is disabled.

  • [2] DisabledException: <key ARN> is pending deletion (or pending replica deletion).

  • [3] KMSInvalidStateException: <key ARN> is pending deletion (or pending replica deletion).

  • [4] KMSInvalidStateException: <key ARN> is not pending deletion (or pending replica deletion).

  • [5] KMSInvalidStateException: <key ARN> is pending import.

  • [6] UnsupportedOperationException: <key ARN> origin is EXTERNAL which is not valid for this operation.

  • [7] If the KMS key has imported key material or is in a custom key store: UnsupportedOperationException.

  • [8] If the KMS key has imported key material: KMSInvalidStateException

  • [9] If the KMS key cannot or does not have imported key material: UnsupportedOperationException.

  • [10] If the source KMS key is pending deletion, the command succeeds. If the destination KMS key is pending deletion, the command fails with error: KMSInvalidStateException : <key ARN> is pending deletion.

  • [11] KMSInvalidStateException: <key ARN> is unavailable. You cannot perform this operation on an unavailable KMS key.

  • [12] The operation succeeds, but the key state of the KMS key does not change until it becomes available.

  • [13] While a KMS key in a custom key store is pending deletion, its key state remains PendingDeletion even if the KMS key becomes unavailable. This allows you to cancel deletion of the KMS key at any time during the waiting period.

  • [14] KMSInvalidStateException: <key ARN> is creating. AWS KMS throws this exception while it is replicating a multi-Region key (ReplicateKey).

  • [15] KMSInvalidStateException: <key ARN> is updating. AWS KMS throws this exception while it is updating the primary Region of a multi-Region key (UpdatePrimaryRegion).