Connecting Scaleway Queues to the AWS-CLI
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. With minimal configuration, you can start using the AWS-CLI with Scaleway Queues. This allows you to create, list and manage your queues, send messages and much more, all from your command line.
This guide shows you how to install the AWS-CLI and configure it to connect to Scaleway Queues.
Before you start
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 Scaleway Queues
How to install the AWS-CLI
To interact with Scaleway Queues, both aws-cli and awscli-plugin-endpoint need to be installed. The awscli-plugin-endpoint is a useful plugin to help people more easily access third-party providers such as Scaleway.
Install both aws-cli and awscli-plugin using pip.
pip3 install awscli
pip3 install awscli-plugin-endpointHow to configure the AWS-CLI
Now you have installed the AWS-CLI, you need to configure it for use with Scaleway Queues.
-
Create a file named
~/.aws/configby running the following command:aws configure set plugins.endpoint awscli_plugin_endpoint -
Open the
~/.aws/configfile you just created in a text editor and edit it as follows (the Queues (SQS) endpoint URL can be found in the console on the Settings page of the Queues product)[plugins] endpoint = awscli_plugin_endpoint [profile sns] region = fr-par [profile sqs] region = fr-par sqs = endpoint_url = https://sqs.mnq.fr-par.scaleway.comOptionally, you can also configure additional profiles by adding new blocks under
[sqs]. For example, you can add a profile for[sns]if you are also using Scaleway Topics and Events, or another profile,[profile aws], to connect to the AWS SQS/SNS service if you want:[plugins] endpoint = awscli_plugin_endpoint [profile sns] region = fr-par sns = endpoint_url = https://sns.mnq.fr-par.scaleway.com [profile sqs] region = fr-par sqs = endpoint_url = https://sqs.mnq.fr-par.scaleway.com [profile aws] region=eu-west-3 output=json -
Generate a credentials file using the following command:
aws configure -
Open the
~/.aws/credentialsfile you just created, and add the access key and secret key you saved when you generated your credentials:[queues] aws_access_key_id=<ACCESS_KEY_FOR_SQS> aws_secret_access_key=<SECRET_KEY_FOR_SQS>If you have other profiles, you can add a block to indicate their credentials too:
[topics_events] aws_access_key_id=<ACCESS_KEY_FOR_SNS> aws_secret_access_key=<SECRET_KEY_FOR_SNS> [aws] aws_access_key_id=<ACCESS_KEY> aws_secret_access_key=<SECRET_KEY> -
Test that everything is set up correctly with the following command:
aws queues list-queuesUse the
--profileoption if you want to test it using a different profile.