Queries the tags of a customer master key (CMK).

Request format: KeyId="string"

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

ParameterTypeRequiredExampleDescription
ActionStringYesListResourceTags

The operation that you want to perform. Set the value to ListResourceTags.

KeyIdStringYes1234abcd-12ab-34cd-56ef-12345678****

The globally unique ID of the CMK.

Response parameters

ParameterTypeExampleDescription
RequestIdString4162a6af-bc99-40b3-a552-89dcc8aaf7c8

The ID of the request, which is used to locate and troubleshoot issues.

TagsArray of Tag

The tags of the CMK.

Tag
KeyIdString33caea95-c3e5-4b3e-a9c6-cec76e4e****

The globally unique ID of the CMK.

TagValueStringTest

The tag value.

TagKeyStringProject

The tag key.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListResourceTags
&KeyId=1234abcd-12ab-34cd-56ef-12345678****
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListResourceTagsResponse>
    <RequestId>4162a6af-bc99-40b3-a552-89dcc8aaf7c8</RequestId>
    <Tags>
        <KeyId>33caea95-c3e5-4b3e-a9c6-cec76e4e****</KeyId>
        <TagValue>Test</TagValue>
        <TagKey>Project</TagKey>
    </Tags>
</ListResourceTagsResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "4162a6af-bc99-40b3-a552-89dcc8aaf7c8",
  "Tags" : [ {
    "KeyId" : "33caea95-c3e5-4b3e-a9c6-cec76e4e****",
    "TagValue" : "Test",
    "TagKey" : "Project"
  } ]
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameterThe specified parameter is not valid.The error message returned because an invalid value is specified for the parameter.
404InvalidAccessKeyId.NotFoundThe Access Key ID provided does not exist in our records.The error message returned because the specified AccessKey ID does not exist.

For a list of error codes, see Service error codes.