Skip to main content

UntagResource

Removes tags from a KMS key.

Description

Removes the specified tags from the specified KMS key. When you specify a tag key, the operation removes both the tag key and its associated tag value. To remove multiple tags from multiple KMS keys, use one call to UntagResource for each KMS key.

To identify which tags to remove, specify the tag key. The tag key is case sensitive. If you specify a tag key that does not exist on the KMS key, the operation succeeds, but it does not remove a tag.

Request Syntax

Headers

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

Request Body

NameDescriptionRequiredType
KeyIdIdentifies the KMS key from which you are removing tags. Specify the key ID or key ARN of the KMS key.Yesstring
TagKeysOne or more tag keys. Specify only the tag keys, not the tag values.Yesarray
POST / HTTP/1.1
Content-Type: application/x-amz-json-1.1
X-Amz-Target: TrentService.UntagResource
{ "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab", "TagKeys": [ "Purpose", "Environment" ] }
Values in italics indicate user input and should be replaced with actual values.

Response Elements

This operation has no response elements.

Special Errors

Error CodeDescription
InvalidArnExceptionThe request was rejected because a specified ARN, or an ARN in a key policy, is not valid.
KMSInvalidStateExceptionThe request was rejected because the state of the specified resource is not valid for this request.
KMSNotFoundExceptionThe request was rejected because the specified entity or resource could not be found.
TagExceptionThe request was rejected because one or more tags are not valid.

Permissions

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

  • kms:UntagResource on the KMS key

Try It Out

Test UntagResource

Remove tags from a KMS key.

Coming Soon

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