NavigationContentFooter
Jump toSuggest an edit

Connecting Queues or Topics and Events to the AWS-CLI

Reviewed on 18 October 2024Published on 04 January 2023

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 or Scaleway Topics and Events. This allows you to create, list and manage your queues and topics, 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 or Scaleway Topics and Events.

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 Queues and/or Topics and Events
Note

This page assumes you will use the AWS-CLI v1.

How to install the AWS-CLI

To interact with Scaleway Queues and Scaleway Topics and Events, 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-endpoint

How to configure the AWS-CLI

Now you have installed the AWS-CLI, you need to configure it for use with Scaleway Queues / Topics and Events.

  1. Create a file named ~/.aws/config by running the following command:

    aws configure set plugins.endpoint awscli_plugin_endpoint
    Tip

    With the most recent versions of awscli (1.29.0 or 2.13.0), the use of a plugin is not necessary. If you are using one of those versions and wish to skip this step, you can do so. Note that this will also affect your configuration file in the next step.

  2. Open the ~/.aws/config file you just created in a text editor and edit it as follows (the Queues (SQS) or Topics and Events (SNS) endpoint URLs can be found in the console on the Settings page for the relevant product)

    [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

    Optionally, you can also configure additional profiles by adding new blocks under [sqs] and [sns]. For example, you can add a third 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
    Important

    If you are using the AWS-CLI v2, you must include the path to the plugin in your configuration file. Add cli_legacy_plugin_path = <path-to-plugin> to the [plugins] section, replacing <path-to-plugin> with the corresponding path.

    Tip

    If you are using aws 1.29.0 or 2.13.0 without the plugin, your configuration file should be as follows:

    [profile sns]
    region = fr-par
    endpoint_url = https://sns.mnq.fr-par.scaleway.com
    [profile sqs]
    region = fr-par
    endpoint_url = https://sqs.mnq.fr-par.scaleway.com
  3. Generate a credentials file using the following command:

    aws configure

** 4. Open the ~/.aws/credentials file you just created, and for each product (out of Queues and Topics and Events) you want to use, add the access key and secret key you saved when you generated your credentials:

[topics_events]
aws_access_key_id=<ACCESS_KEY_FOR_SNS>
aws_secret_access_key=<SECRET_KEY_FOR_SNS>
[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:

[aws]
aws_access_key_id=<ACCESS_KEY>
aws_secret_access_key=<SECRET_KEY>
  1. Test that everything is set up correctly with the following command:

    aws queues list-queues

    Use the --profile option if you want to test it using a different profile.

Tip

Check out our dedicated documentation to find more common commands for getting started with the AWS CLI:

  • The Queues guide walks you through creating and listing queues, sending messages to queues, and more.
  • The Topics and Events guide shows you how to create and list topics and subscriptions, send messages to topics, and more.
Was this page helpful?
API DocsScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCareers
© 2023-2025 – Scaleway