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

Parameter Type Required Example Description
Action String No ListResourceTags

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

KeyId String No 1234abcd-12ab-34cd-56ef-12345678****

The globally unique ID of the CMK.

Response parameters

Parameter Type Example Description
RequestId String 4162a6af-bc99-40b3-a552-89dcc8aaf7c8

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

Tags Array of Tag

The tags of the CMK.

Tag
KeyId String 33caea95-c3e5-4b3e-a9c6-cec76e4e****

The globally unique ID of the CMK.

TagValue String Test

The tag value.

TagKey String Project

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 code Error code Error message Description
400 InvalidParameter The specified parameter is not valid. The error message returned because an invalid value is specified for the parameter.
404 InvalidAccessKeyId.NotFound The 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.