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.
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.
Parameters:
-
queue_url
(String)
–
-
tags
(TagMap)
–
The list of tags to be added to the specified queue.
Raises:
-
InvalidAddress
–
The specified ID is invalid.
-
InvalidSecurity
–
The request was not made over HTTPS or did not use SigV4 for signing.
-
QueueDoesNotExist
–
Ensure that the QueueUrl is correct and that the queue has not been deleted.
-
RequestThrottled
–
The request was denied due to request throttling.
-
Exceeds the permitted request rate for the queue or for the recipient of the request.
-
Ensure that the request rate is within the Amazon SQS limits for sending messages. For more information, see Amazon SQS quotas in the Amazon SQS Developer Guide.
-
UnsupportedOperation
–
Error code 400. Unsupported operation.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_sqs/_services/sqs.py
| def tag_queue(
self,
queue_url: "capo_sqs.types.string.String",
tags: "capo_sqs.types.tag_map.TagMap",
*,
config_overrides: Optional[SQSClientConfig] = None,
) -> None:
"""<p>Add cost allocation tags to the specified Amazon SQS queue. For an overview, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html">Tagging Your Amazon SQS Queues</a> in the <i>Amazon SQS Developer Guide</i>.</p> <p>When you use queue tags, keep the following guidelines in mind:</p> <ul> <li> <p>Adding more than 50 tags to a queue isn't recommended.</p> </li> <li> <p>Tags don't have any semantic meaning. Amazon SQS interprets tags as character strings.</p> </li> <li> <p>Tags are case-sensitive.</p> </li> <li> <p>A new tag with a key identical to that of an existing tag overwrites the existing tag.</p> </li> </ul> <p>For a full list of tag restrictions, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-limits.html#limits-queues">Quotas related to queues</a> in the <i>Amazon SQS Developer Guide</i>.</p> <note> <p>Cross-account permissions don't apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant cross-account permissions to a role and a username</a> in the <i>Amazon SQS Developer Guide</i>.</p> </note>
Args:
queue_url: <p>The URL of the queue.</p>
tags: <p>The list of tags to be added to the specified queue.</p>
Raises:
capo_sqs.errors.invalid_address.InvalidAddress: <p>The specified ID is invalid.</p>
capo_sqs.errors.invalid_security.InvalidSecurity: <p>The request was not made over HTTPS or did not use SigV4 for signing.</p>
capo_sqs.errors.queue_does_not_exist.QueueDoesNotExist: <p>Ensure that the <code>QueueUrl</code> is correct and that the queue has not been deleted.</p>
capo_sqs.errors.request_throttled.RequestThrottled: <p>The request was denied due to request throttling.</p> <ul> <li> <p>Exceeds the permitted request rate for the queue or for the recipient of the request.</p> </li> <li> <p>Ensure that the request rate is within the Amazon SQS limits for sending messages. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-quotas.html#quotas-requests">Amazon SQS quotas</a> in the <i>Amazon SQS Developer Guide</i>.</p> </li> </ul>
capo_sqs.errors.unsupported_operation.UnsupportedOperation: <p>Error code 400. Unsupported operation.</p>
capo_sqs.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_sqs.types.tag_queue_request.TagQueueRequest]",
) -> OperationResponse[None]:
import capo_sqs._operations.amazon_sqs.tag_queue
output, http_response = capo_sqs._operations.amazon_sqs.tag_queue.tag_queue(
req.options, req.input
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("TagQueue")
)
input_: capo_sqs.types.tag_queue_request.TagQueueRequest = {
"queue_url": queue_url,
"tags": tags,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|