LinuxCommandLibrary

aws-sqs

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

TLDR

List all availables queues

$ aws sqs list-queues
copy


Display the URL of a specific queue
$ aws sqs get-queue-url --queue-name [queue_name]
copy


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.json]
copy


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.json]
copy


Delete the specified message from a queue
$ aws sqs delete-message --queue-url [https://queue_url] --receipt-handle [receipt_handle]
copy


Delete a specific queue
$ aws sqs delete-queue --queue-url https://sqs.[region].amazonaws.com/[queue_name]
copy


Delete all messages from the specified queue
$ aws sqs purge-queue --queue-url https://sqs.[region].amazonaws.com/[queue_name]
copy


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 SendMessage
copy

Copied to clipboard