EnableKey
Enables a KMS key.
Description
The `EnableKey` operation enables a KMS key. After the key is enabled, you can use it for cryptographic operations. This operation is part of the key lifecycle management.
note
- After a key is enabled, the key state changes to `Enabled`.
- You can disable the key again using the `DisableKey` operation.
- Enabling a KMS key that is scheduled for deletion does not cancel its deletion.
- The KMS key that you use for this operation must be in a compatible key state.
Request Syntax
Headers
Name | Description | Required | Type |
---|---|---|---|
Content-Type | Must be "application/x-amz-json-1.1" | Yes | string |
X-Amz-Target | Must be "TrentService.EnableKey" | Yes | string |
Request Body
Name | Description | Required | Type |
---|---|---|---|
KeyId | The identifier of the KMS key to enable. This can be the key ID or key ARN of the KMS key. | Yes | string |
POST / HTTP/1.1
Content-Type: application/x-amz-json-1.1
X-Amz-Target: TrentService.EnableKey
{
"KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
}
Values in italics indicate user input and should be replaced with actual values.
Examples
Example 1: Enable a KMS key
POST / HTTP/1.1
Content-Type: application/x-amz-json-1.1
X-Amz-Target: TrentService.EnableKey
{
"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 Code | Description |
---|---|
DependencyTimeoutException | The system timed out while trying to fulfill the request. |
InvalidArnException | The key ARN provided is not valid. |
KMSInternalException | An internal error occurred. |
KMSInvalidStateException | The request was rejected because the key state is not valid for this operation. |
LimitExceededException | The request was rejected because a quota was exceeded. |
NotFoundException | The request was rejected because the specified key was not found. |
Permissions
To use the `EnableKey` operation, you must have the following permissions:
- `kms:EnableKey` on the KMS key (specified in the policy)
Try It Out
Test EnableKey
Enable a KMS key.
Coming Soon
This feature is currently under development and will be available soon.