| title | Using Object Storage with the AWS-CLI | ||||
|---|---|---|---|---|---|
| description | Integrate AWS CLI with Scaleway Object Storage for seamless operations. | ||||
| tags | object storage object-storage aws-cli aws cli | ||||
| dates |
|
import Requirements from '@macros/iam/requirements.mdx'
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.
- 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
-
Follow the official AWS CLI installation instructions to download and install the tool according to your environment.
-
Create the file
~/.aws/configby 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,pl-waw,it-mil) jsonas the default output format
-
Open the
~/.aws/configfile in a code editor and edit it as follows:Set the `endpoint_url` and `region` corresponding to the geographical region of your bucket (`fr-par`, `nl-ams`, `pl-waw`, `it-mil`).[default] region = nl-ams output = json services = scw-nl-ams s3 = 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 [services scw-nl-ams] s3 = 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/credentialsfile and create other profiles by adding a block to indicate their credentials as follows:The profile names from the configuration file (here, `[profile two]`) and from the credentials file (here, `[two]`) must be identical.[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 lsA list of your buckets in the region specified in your profile displays.
Use the `--profile` option if you want to test it using a different profile. Remember to replace `two` with the name of your profile. ``` aws --profile two s3 ls ```
Refer to the official documentation for more information on how to configure and manage your AWS CLI v2 settings and credentials.