NavigationContentFooter
Jump toSuggest an edit
Was this page helpful?

Using Scaleway Queues with the AWS-CLI

Reviewed on 02 April 2025Published on 02 April 2025

The AWS-CLI is an open-source tool built on top of the AWS SDK for Python (Boto) that provides commands for interacting with AWS services. Once you have connected Scaleway Queues to the AWS-CLI, you can start creating, listing and managing your queues, sending messages and much more, all from your command line.

Before you startLink to this anchor

To complete the actions presented below, you must have:

  • A Scaleway account logged into the console
  • Owner status or IAM permissions allowing you to perform actions in the intended Organization
  • Valid credentials for Queues
  • Connected Queues to the AWS-CLI
  • jq installed on your machine

Getting started with Scaleway QueuesLink to this anchor

  1. Use the following command to create a queue:

    aws sqs create-queue --queue-name MyQueue | tee my-queue.json
  2. Use the following command to list existing queues:

    aws sqs list-queues
  3. Use the following command to send messages to a queue:

    aws sqs send-message --queue-url $(jq -r .QueueUrl my-queue.json) --message-body "Hello world!"
    aws sqs send-message --queue-url $(jq -r .QueueUrl my-queue.json) --message-body "Second Message."
  4. Use the following command to receive messages:

    aws sqs receive-message --queue-url $(jq -r .QueueUrl my-queue.json) | tee message1.json
    aws sqs receive-message --queue-url $(jq -r .QueueUrl my-queue.json) | tee message2.json
  5. Use the following command to delete messages. This is necessary as once a message has been processed on your consumer side (typically by a worker), it will be re-queued unless it is explicitly deleted.

    aws sqs delete-message --queue-url $(jq -r .QueueUrl my-queue.json) --receipt-handle $(jq -r .Messages[0].ReceiptHandle message1.json)
    aws sqs delete-message --queue-url $(jq -r .QueueUrl my-queue.json) --receipt-handle $(jq -r .Messages[0].ReceiptHandle message2.json)
  6. Use the following command to delete the queue itself:

    aws sqs delete-queue --queue-url $(jq -r .QueueUrl my-queue.json)
Was this page helpful?
API DocsScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCareers
© 2023-2025 – Scaleway