Managing queue labels
Written by
Updated at March 31, 2025
Labels are key-value pairs for logical tagging of queues.
Adding labels when creating a queue
AWS CLI
-
Install and configure the AWS CLI.
-
When creating a queue, specify the labels you need:
aws sqs create-queue \ --queue-name <queue_name> \ --endpoint <endpoint> --tags <labels>Where:
--queue-name: Name of the new queue, e.g.,sample-queue.--endpoint: Endpoint in thehttps://message-queue.api.cloud.yandex.net/value.--tags: List of queue labels, e.g.,key1=string,key2=string.
Result:
{ "QueueUrl": "https://message-queue.api.cloud.yandex.net/aoeaql9r10cd********/000000000000********/sample-queue" }
Adding or updating labels of an existing queue
AWS CLI
-
Install and configure the AWS CLI.
-
Create a message queue.
-
Add labels:
aws sqs tag-queue \ --queue-url <queue_URL> \ --endpoint <endpoint> --tags <labels>Where:
--queue-url: URL of the queue to add or update labels for.--endpoint: Endpoint in thehttps://message-queue.api.cloud.yandex.net/value.--tags: List of queue labels, e.g.,key1=string,key2=string.
Deleting queue labels
AWS CLI
-
Delete the labels of an existing queue:
aws sqs untag-queue \ --queue-url <queue_URL> \ --endpoint <endpoint> --tag-keys <label_keys>Where:
--queue-url: URL of the queue whose labels you need to delete.--endpoint: Endpoint in thehttps://message-queue.api.cloud.yandex.net/value.--tag-keys: List of queue label keys, e.g.,key1 key2.
Viewing queue labels
AWS CLI
-
To view the labels of an existing queue, run this command:
aws sqs list-queue-tags \ --queue-url <queue_URL> \ --endpoint <endpoint>Where:
--queue-url: URL of the queue whose labels you need to get.--endpoint: Endpoint in thehttps://message-queue.api.cloud.yandex.net/value.
Result:
{ "Tags": { "key1": "value1" } }