TagQueue
Add cost allocation tags to the specified Amazon SQS queue. For an overview, see Tagging Your Amazon SQS Queues in the Amazon SQS Developer Guide.
When you use queue tags, keep the following guidelines in mind:
-
Adding more than 50 tags to a queue isn't recommended.
-
Tags don't have any semantic meaning. Amazon SQS interprets tags as character strings.
-
Tags are case-sensitive.
-
A new tag with a key identical to that of an existing tag overwrites the existing tag.
For a full list of tag restrictions, see Quotas related to queues in the Amazon SQS Developer Guide.
Note
Cross-account permissions don't apply to this action. For more information, see Grant cross-account permissions to a role and a username in the Amazon SQS Developer Guide.
Request Syntax
{
"QueueUrl": "string
",
"Tags": {
"string
" : "string
"
}
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
Response Elements
If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.
Errors
For information about the errors that are common to all actions, see Common Errors.
- InvalidAddress
-
The specified ID is invalid.
HTTP Status Code: 400
- InvalidSecurity
-
The request was not made over HTTPS or did not use SigV4 for signing.
HTTP Status Code: 400
- QueueDoesNotExist
-
The specified queue doesn't exist. Ensure that the
QueueName
is correct and that the queue has not been deleted.HTTP Status Code: 400
- RequestThrottled
-
The request was denied due to request throttling.
-
The rate of requests per second exceeds the AWS KMS request quota for an account and Region.
-
A burst or sustained high rate of requests to change the state of the same KMS key. This condition is often known as a "hot key."
-
Requests for operations on KMS keys in a AWS CloudHSM key store might be throttled at a lower-than-expected rate when the AWS CloudHSM cluster associated with the AWS CloudHSM key store is processing numerous commands, including those unrelated to the AWS CloudHSM key store.
HTTP Status Code: 400
-
- UnsupportedOperation
-
Error code 400. Unsupported operation.
HTTP Status Code: 400
Examples
This example illustrates one usage of TagQueue
.
Example
Using AWS JSON protocol (Default)
Sample Request
POST / HTTP/1.1
Host: sqs.us-east-1.amazonaws.com
X-Amz-Target: AmazonSQS.TagQueue
X-Amz-Date: <Date>
Content-Type: application/x-amz-json-1.0
Authorization: <AuthParams>
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
{
"QueueUrl": "https://sqs.us-east-1.amazonaws.com/177715257436/MyQueue/",
"Tags": {
"QueueType": "Production"
}
}
Sample Response
HTTP/1.1 200 OK
x-amzn-RequestId: <requestId>
Content-Length: 0
Date: <Date>
Content-Type: application/x-amz-json-1.0
Example
Using AWS query protocol
Sample Request
POST /177715257436/MyQueue/ HTTP/1.1
Host: sqs.us-east-1.amazonaws.com
X-Amz-Date: <Date>
Content-Type: application/x-www-form-urlencoded
Authorization: <AuthParams>
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
Action=TagQueue
&Tag.Key=QueueType
&Tag.Value=Production
Sample Response
HTTP/1.1 200 OK
<?xml version="1.0"?>
<TagQueueResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/">
<ResponseMetadata>
<RequestId>4bc96290-c3b5-5248-aace-3ee0056359b4</RequestId>
</ResponseMetadata>
</TagQueueResponse>
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: