A customer master key (CMK) can be in one of the following states: Enabled, Disabled, or PendingDeletion. A CMK with imported key material (Bring Your Own Key, or BYOK) can also be in the PendingImport state.
In most cases, a newly created CMK starts in the Enabled state.
A newly created BYOK-based CMK starts in the PendingImport state. To check whether a CMK uses imported key material, call DescribeKey and verify that
OriginisEXTERNAL.Only CMKs in the Enabled state can perform cryptographic operations (encrypt data, decrypt data, or generate data keys).
A CMK in the PendingDeletion state is permanently deleted after the scheduled waiting period elapses.
Each API call returns one of the following results:
| Result | HTTP status code |
|---|---|
Success | 200 |
Rejected.Enabled | 409 |
Rejected.Disabled | 409 |
Rejected.PendingDeletion | 409 |
Rejected.PendingImport | 409 |
Rejected.StateModifiedFailed | 409 |
Common API operations
| API operation | Enabled | Disabled | PendingDeletion | PendingImport |
|---|---|---|---|---|
CreateKey | Success | Success | Success | Success |
GenerateDataKey | Success | Rejected.Disabled | Rejected.PendingDeletion | Rejected.PendingImport |
GenerateDataKeyWithoutPlaintext | Success | Rejected.Disabled | Rejected.PendingDeletion | Rejected.PendingImport |
Encrypt | Success | Rejected.Disabled | Rejected.PendingDeletion | Rejected.PendingImport |
Decrypt | Success | Rejected.Disabled | Rejected.PendingDeletion | Rejected.PendingImport |
ListKeys | Success | Success | Success | Success |
DescribeKey | Success | Success | Success | Success |
UpdateKeyDescription | Success | Success | Rejected.PendingDeletion | Success |
EnableKey | Success | Success | Rejected.StateModifiedFailed | Rejected.StateModifiedFailed |
DisableKey | Success | Success | Rejected.StateModifiedFailed | Rejected.StateModifiedFailed |
ScheduleKeyDeletion | Success | Success | Rejected.StateModifiedFailed | Success |
CancelKeyDeletion | Rejected.StateModifiedFailed | Rejected.StateModifiedFailed | Success | Rejected.StateModifiedFailed |
CreateAlias | Success | Success | Rejected.StateModifiedFailed | Success |
DeleteAlias | Success | Success | Success | Success |
ListAliases | Success | Success | Success | Success |
TagResource | Success | Success | Rejected.PendingDeletion | Success |
UntagResource | Success | Success | Rejected.PendingDeletion | Success |
ListResourceTags | Success | Success | Success | Success |
DescribeKeyVersion | Success | Success | Success | Success |
ListKeyVersions | Success | Success | Success | Success |
UpdateRotationPolicy | Success | Rejected.Disabled | Rejected.PendingDeletion | Rejected.PendingImport |
Note: CancelKeyDeletion succeeds only when the CMK is in the PendingDeletion state, because cancellation is only valid for keys already scheduled for deletion.Special API operations
UpdateAlias — the result depends on the state of the destination CMK, not the source CMK.
| Destination CMK state | Result |
|---|---|
| Any state except PendingDeletion | Success |
| PendingDeletion | Rejected.PendingDeletion |
BYOK-specific API operations
These operations apply only to CMKs with imported key material (Origin = EXTERNAL).
| API operation | Enabled | Disabled | PendingDeletion | PendingImport |
|---|---|---|---|---|
GetParametersForImport | Success | Success | Success | Success |
ImportKeyMaterial | Success | Success | Rejected.StateModifiedFailed | Success |
DeleteKeyMaterial | Success | Success | Success | Success |