CmdID

CmdID / Commands

aws-sqs

Create, delete, and send messages to queues for the AWS SQS service. tldr-pages

On several platforms

Opens CmdID with your command. It is read in your browser and sent nowhere.

Several platforms

from tldr-pages, CC BY 4.0

List all available queues

aws sqs list-queuesIdentify

Display the URL of a specific queue

aws sqs get-queue-url --queue-name queue_nameIdentify
--queue-name(Required) The name of the queue for which you want to fetch the URL. AWS CLI reference

Create a queue with specific attributes from a file in JSON format

aws sqs create-queue --queue-name queue_name --attributes file://path/to/attributes_file.jsonIdentify
--queue-nameThe name of the new queue. AWS CLI reference
--attributesA map of attributes with their corresponding values. AWS CLI reference

Send a specific message to a queue

aws sqs send-message --queue-url https://sqs.region.amazonaws.com/queue_name --message-body "message_body" --delay-seconds delay --message-attributes file://path/to/attributes_file.jsonIdentify
--queue-urlThe URL of the Amazon SQS queue to which a message is sent. AWS CLI reference
--message-bodyThe message to send. AWS CLI reference
--delay-secondsThe length of time, in seconds, for which to delay a specific message. AWS CLI reference
--message-attributesEach message attribute consists of a Name, Type, and Value. AWS CLI reference

Delete the specified message from a queue

aws sqs delete-message --queue-url https://queue_url --receipt-handle receipt_handleIdentify
--queue-urlThe URL of the Amazon SQS queue from which messages are deleted. AWS CLI reference
--receipt-handleThe receipt handle associated with the message to delete. AWS CLI reference

Delete a specific queue

aws sqs delete-queue --queue-url https://sqs.region.amazonaws.com/queue_nameIdentify
--queue-urlThe URL of the Amazon SQS queue to delete. AWS CLI reference

Delete all messages from the specified queue

aws sqs purge-queue --queue-url https://sqs.region.amazonaws.com/queue_nameIdentify
--queue-urlThe URL of the queue from which the PurgeQueue action deletes messages. AWS CLI reference

Enable a specific AWS account to send messages to queue

aws sqs add-permission --queue-url https://sqs.region.amazonaws.com/queue_name --label permission_name --aws-account-ids account_id --actions SendMessageIdentify
--queue-urlThe URL of the Amazon SQS queue to which permissions are added. AWS CLI reference
--labelThe unique identification of the permission you're setting (for example, AliceSendMessage). AWS CLI reference
--aws-account-idsThe Amazon Web Services account numbers of the principals who are to receive permission. AWS CLI reference
--actionsThe action the client wants to allow for the specified principal. AWS CLI reference