Skip to main content

DisableKey

Disables a KMS key.

Description​

The `DisableKey` operation disables a KMS key. A disabled key cannot be used in cryptographic operations. This operation is part of the key lifecycle management.

note
  • After a key is disabled, the key state changes to `Disabled`.
  • You can re-enable the key using the `EnableKey` operation.
  • Disabling a KMS key does not delete it. You can still view its metadata and re-enable it.
  • This operation is not reversible for keys that are scheduled for deletion.

Request Syntax​

Headers​

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

Request Body​

NameDescriptionRequiredType
KeyIdThe identifier of the KMS key to disable. This can be the key ID or key ARN of the KMS key.Yesstring
POST / HTTP/1.1
Content-Type: application/x-amz-json-1.1
X-Amz-Target: TrentService.DisableKey
{ "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab" }
Values in italics indicate user input and should be replaced with actual values.

Examples​

Example 1: Disable a KMS key​

POST / HTTP/1.1
Content-Type: application/x-amz-json-1.1
X-Amz-Target: TrentService.DisableKey
{ "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab" }
Values in italics indicate user input and should be replaced with actual values.
HTTP/1.1 200 OK
Content-Type: application/x-amz-json-1.1
Values in italics indicate variable response values.

Response Elements​

This operation returns no response data.

Special Errors​

Error CodeDescription
DependencyTimeoutExceptionThe system timed out while trying to fulfill the request.
InvalidArnExceptionThe key ARN provided is 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 key was not found.

Permissions​

To use the `DisableKey` operation, you must have the following permissions:

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

Try It Out​

Test DisableKey

Disable a KMS key.

Coming Soon

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