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 AWS Management.
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
- A valid API key
How to install the AWS-CLI
-
Follow the official AWS CLI installation instructions to download and install the tool according to your environment.
-
Create the file
~/.aws/config
by running the following command:aws configure
-
When prompted, enter the following elements:
- your API access key
- your API secret key
- your preferred default Object Storage region (
fr-par
,nl-ams
, orpl-waw
) json
as the default output format
-
Open the
~/.aws/config
file in a code editor and edit it as follows:[default] region = nl-ams output = json services = scw-nl-ams [services scw-nl-ams] s3 = endpoint_url = https://s3.nl-ams.scw.cloud max_concurrent_requests = 100 max_queue_size = 1000 multipart_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 MB s3api = endpoint_url = https://s3.nl-ams.scw.cloud
-
Optionally, you 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 services from your default one:[default] region = nl-ams services = scw-nl-ams [profile two] region = fr-par services = scw-fr-par
-
Configure additional services by adding a new block after
[service scw-nl-ams]
. For example, you can create a second services block called[services scw-fr-par]
, as shown below:[services scw-fr-par] s3 = endpoint_url = https://s3.fr-par.scw.cloud max_concurrent_requests = 100 max_queue_size = 1000 multipart_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 MB s3api = endpoint_url = https://s3.fr-par.scw.cloud
-
Open the
~/.aws/credentials
file and create other profiles by adding a block to indicate their credentials as follows:[default] aws_access_key_id=<ACCESS_KEY> aws_secret_access_key=<SECRET_KEY> [two] aws_access_key_id=<ACCESS_KEY> aws_secret_access_key=<SECRET_KEY>
-
Run the following command to test your AWS CLI installation:
aws s3 ls
A list of your buckets in the region specified in your profile displays.
Refer to the official documentation for more information on how to configure and manage your AWS CLI v2 settings and credentials.