Skip to main content

RetireGrant

Retires a grant for a KMS key.

Description

The RetireGrant operation retires a grant. To retire a grant, you can use either the grant token or both the grant ID and a KMS key identifier. After a grant is retired, the permissions that it allowed are no longer valid.

note
  • You should retire a grant when you're done using it to clean up the grant's permissions.
  • You must identify the grant to retire by its grant token or by both the grant ID and the KMS key identifier.
  • The operation doesn't return any output. If the request succeeds, the service sends back an HTTP 200 response with an empty HTTP body.
  • Cross-account use: Yes. You can retire a grant on 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.RetireGrant"Yesstring

Request Body

NameDescriptionRequiredType
GrantTokenIdentifies the grant to retire. You can use a grant token to identify a new grant even before it has achieved eventual consistency. Only one of `GrantToken` or `GrantId`/`KeyId` pair must be specified.Nostring
KeyIdThe identifier of the KMS key associated with the grant. This can be the key ID or key ARN of the KMS key. Required when you use `GrantId`.Nostring
GrantIdIdentifies the grant to retire. Required when you use `KeyId`.Nostring
POST / HTTP/1.1
Content-Type: application/x-amz-json-1.1
X-Amz-Target: TrentService.RetireGrant
{ "GrantToken": "AQpAM2RhZTk1MGMyNTk2ZmZmMzEyYWVhOWViN2I1MWM4Mzc0MWFiYjc0ZDE1ODkyNGFlNTIzODZhMzgyZjBlNDkxOAF4" }
Values in italics indicate user input and should be replaced with actual values.

Response Elements

This operation returns no response data.

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.
InvalidGrantIdExceptionThe request was rejected because the specified grant ID is not valid.
InvalidGrantTokenExceptionThe request was rejected because the specified grant token 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 entity or resource could not be found.

Permissions

To use the RetireGrant operation, you must have one of the following:

  • Be the retiring principal of the grant
  • Be the grantee principal of the grant
  • Have kms:RetireGrant permission on the KMS key (specified in the policy)

Try It Out

Test RetireGrant

Retire a grant for a KMS key.

Coming Soon

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