Using Object Storage with 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 all the functionalities provided by the AWS Management.
You may need certain IAM permissions to carry out some actions described on this page. This means:
- you are the Owner of the Scaleway Organization in which the actions will be carried out, or
- you are an IAM user of the Organization, with a policy granting you the necessary permission sets
- You have an account and are logged into the Scaleway console
- You have configured your API keys
This page uses AWS-CLI v1. If you want to follow the installation procedure for v2, see the AWS-CLI documentation page.
How to install 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 all the functionality provided by the AWS Management.
To interact with Object Storage, aws-cli
and awscli-plugin-endpoint
need to be installed. The awscli-plugin-endpoint
is a great plugin to help people more easily access third-party S3 providers.
-
Install
aws-cli
andawscli-plugin
usingpip
.pip3 install awsclipip3 install awscli-plugin-endpoint -
Create the file
~/.aws/config
by running the following command:aws configure set plugins.endpoint awscli_plugin_endpoint -
Open
~/.aws/config
in a text editor and edit it as follows:[plugins]endpoint = awscli_plugin_endpoint[default]region = nl-amss3 =endpoint_url = https://s3.nl-ams.scw.cloudsignature_version = s3v4max_concurrent_requests = 100max_queue_size = 1000multipart_threshold = 50 MB# Edit the multipart_chunksize value according to the file sizes that you# want to upload. The present configuration allows to upload files up to# 10 GB (1000 requests * 10 MB). For example setting it to 5 GB allows you# to upload files up to 5 TB.multipart_chunksize = 10 MBs3api =endpoint_url = https://s3.nl-ams.scw.cloudYou can also configure additional profiles by adding new blocks under
[default]
. For example, you can add a second profile,[profile two]
, to set a different region and endpoint from your default one:[plugins]endpoint = awscli_plugin_endpoint[default]region = nl-amss3 =endpoint_url = https://s3.nl-ams.scw.clouds3api =endpoint_url = https://s3.nl-ams.scw.cloud[profile two]region = fr-pars3 =endpoint_url = https://s3.fr-par.scw.clouds3api =endpoint_url = https://s3.fr-par.scw.cloudImportant: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.Note:Set the
endpoint_url
andregion
corresponding to the geographical region of your bucket. It can either befr-par
(Paris, France),nl-ams
(Amsterdam, The Netherlands) orpl-waw
(Warsaw, Poland). -
Generate a credentials file using the command:
aws configure -
Open the
~/.aws/credentials
file and configure your API key as follows:[default]aws_access_key_id=<ACCESS_KEY>aws_secret_access_key=<SECRET_KEY>If you have other profiles, add a block to indicate their credentials.
[two]aws_access_key_id=<ACCESS_KEY>aws_secret_access_key=<SECRET_KEY> -
Test your cluster.
aws s3 lsUse the
--profile
option if you want to test it using a different profile. Remember to replacetwo
with the name of your profile.aws --profile two s3 ls