Skip to main content

ScheduleKeyDeletion

Schedules a KMS key for deletion.

Description

The ScheduleKeyDeletion operation schedules the deletion of a KMS key. By default, QKMS waits 30 days before deleting the key to give you time to recover it if you change your mind. You can specify a waiting period between 7 and 30 days.

note
  • While the key is pending deletion, its key state is PendingDeletion.
  • During the waiting period, you can use CancelKeyDeletion to cancel the deletion of the KMS key.
  • After the waiting period ends, QKMS deletes the KMS key and all related key material.
  • Deleting a KMS key is irreversible. After a key is deleted, you can no longer decrypt data that was encrypted under that KMS key.
  • Cross-account use: No. You cannot schedule deletion of a KMS key in a different account.

Request Syntax

Headers

NameDescriptionRequiredType
Content-TypeMust be "application/x-amz-json-1.1"Yesstring
X-Amz-TargetMust be "TrentService.ScheduleKeyDeletion"Yesstring

Request Body

NameDescriptionRequiredType
KeyIdThe identifier of the KMS key to schedule for deletion. This can be the key ID or key ARN of the KMS key.Yesstring
PendingWindowInDaysThe waiting period, specified in number of days. After the waiting period ends, QKMS deletes the KMS key. The value must be between 7 and 30, inclusive. If you don't specify a value, QKMS uses 30.Nointeger
POST / HTTP/1.1
Content-Type: application/x-amz-json-1.1
X-Amz-Target: TrentService.ScheduleKeyDeletion
{ "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab", "PendingWindowInDays": 7 }
Values in italics indicate user input and should be replaced with actual values.

Response Elements

NameDescriptionRequiredType
KeyIdThe Amazon Resource Name (ARN) of the KMS key that is scheduled for deletion.NoString
DeletionDateThe date and time after which QKMS deletes the KMS key.NoString
KeyStateThe current state of the KMS key. When this value is `PendingDeletion`, you cannot use the KMS key for cryptographic operations.NoString
PendingWindowInDaysThe number of days remaining in the waiting period before QKMS deletes the KMS key.NoString

Special Errors

Error CodeDescription
DependencyTimeoutExceptionThe system timed out while trying to fulfill the request.
InvalidArnExceptionThe request was rejected because a specified ARN was not valid.
KMSInternalExceptionAn internal error occurred.
KMSInvalidStateExceptionThe request was rejected because the key state is not valid for this operation.
NotFoundExceptionThe request was rejected because the specified entity or resource could not be found.

Permissions

To use the ScheduleKeyDeletion operation, you must have the following permissions:

  • kms:ScheduleKeyDeletion on the KMS key (specified in the policy)

Try It Out

Test ScheduleKeyDeletion

Schedule a KMS key for deletion.

Coming Soon

This feature is currently under development and will be available soon.