ListTagsForResource
Lists the tags for an AWS resource.
This is a paginated operation, which means that each response might contain only a subset of all the tags.
When the response contains only a subset of tags, it includes a NextToken
value. Use this value in a subsequent ListTagsForResource
request to get more tags.
When you receive a response with no NextToken (or an empty or null value), that means there are no more tags to get.
Cross-account use: This operation can't be used across different AWS accounts.
Related operations:
Request Syntax
{
"MaxResults": number
,
"NextToken": "string
",
"ResourceArn": "string
"
}
Request Parameters
The request accepts the following data in JSON format.
- MaxResults
-
Use this parameter to specify the maximum number of items to return. When this value is present, AWS Payment Cryptography does not return more than the specified number of items, but it might return fewer.
This value is optional. If you include a value, it must be between 1 and 100, inclusive. If you do not include a value, it defaults to 50.
Type: Integer
Valid Range: Minimum value of 1. Maximum value of 100.
Required: No
- NextToken
-
Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of
NextToken
from the truncated response you just received.Type: String
Length Constraints: Minimum length of 1. Maximum length of 8192.
Required: No
- ResourceArn
-
The
KeyARN
of the key whose tags you are getting.Type: String
Length Constraints: Minimum length of 70. Maximum length of 150.
Pattern:
arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}
Required: Yes
Response Syntax
{
"NextToken": "string",
"Tags": [
{
"Key": "string",
"Value": "string"
}
]
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- NextToken
-
The token for the next set of results, or an empty or null value if there are no more results.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 8192.
- Tags
-
The list of tags associated with a
ResourceArn
. Each tag will list the key-value pair contained within that tag.Type: Array of Tag objects
Array Members: Minimum number of 0 items. Maximum number of 200 items.
Errors
- AccessDeniedException
-
You do not have sufficient access to perform this action.
HTTP Status Code: 400
- InternalServerException
-
The request processing has failed because of an unknown error, exception, or failure.
HTTP Status Code: 500
- ResourceNotFoundException
-
The request was denied due to an invalid resource error.
HTTP Status Code: 400
- ServiceUnavailableException
-
The service cannot complete the request.
HTTP Status Code: 500
- ThrottlingException
-
The request was denied due to request throttling.
HTTP Status Code: 400
- ValidationException
-
The request was denied due to an invalid request error.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: