Skip to main content

EnableKeyRotation

Enables automatic rotation of the key material for a KMS key.

Description

The `EnableKeyRotation` operation enables automatic rotation of the key material for a symmetric customer managed KMS key. You cannot enable automatic rotation of asymmetric KMS keys, KMS keys in custom key stores, or AWS managed keys.

note
  • When you enable key rotation, QKMS automatically creates new cryptographic material for the KMS key one year after enabling and every year thereafter.
  • The KMS key that you use for this operation must be in a compatible key state.
  • You cannot enable automatic rotation for AWS managed keys.

Request Syntax

Headers

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

Request Body

NameDescriptionRequiredType
KeyIdThe identifier of the KMS key whose key material will be rotated automatically. 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.EnableKeyRotation
{ "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab" }
Values in italics indicate user input and should be replaced with actual values.

Examples

Example 1: Enable automatic key rotation for a KMS key

POST / HTTP/1.1
Content-Type: application/x-amz-json-1.1
X-Amz-Target: TrentService.EnableKeyRotation
{ "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.
DisabledExceptionThe request was rejected because the specified KMS key is disabled.
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.
UnsupportedOperationExceptionThe request was rejected because a specified parameter is not supported or a specified resource is not valid for this operation.

Permissions

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

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

Try It Out

Test EnableKeyRotation

Enable automatic key rotation for a KMS key.

Coming Soon

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