Backup files to Scaleway Object Storage using AWS-CLI

.tdi_3.td-a-rec{text-align:center}.tdi_3 .td-element-style{z-index:-1}.tdi_3.td-a-rec-img{text-align:left}.tdi_3.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_3.td-a-rec-img{text-align:center}}

Scaleway recently launched an Object Storage service with APIĀ  that is Amazon S3-compatible. This service is still inĀ Beta stage but you can request for free early access. Cloud Object Storage gives you a simple way to store and distribute your content no matter the amount of data – Scale to Petabytes.

You can use Object Storage to store anything from system logs, backups, web content, API, libraries e.t.c. In this guide, I’ll take you through the setup of a bucket on Scaleway and uploading files to it using AWS-CLI.

Setting up Scaleway Object Storage

Below are the steps you need to follow to have a working Scaleway object store ready for file uploads.

.tdi_2.td-a-rec{text-align:center}.tdi_2 .td-element-style{z-index:-1}.tdi_2.td-a-rec-img{text-align:left}.tdi_2.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_2.td-a-rec-img{text-align:center}}

Step 1: Signup to scaleway

Create a scaleway account using the linkĀ https://cloud.scaleway.com/#/signup. You’ll need to set a billing method – [ Card payment ] while setting up the account.

Step 2: Create API Token

Once the account is created, proceed to create API token to be used in AWS CLI configuration section. Login to Scaleway dashboard and open the linkĀ https://cloud.scaleway.com/#/credentials

Click the ā€œCreate new tokenā€ button

scaleway create token 01 min

The secret key will be shown only once. Be careful and save it!

Step 3: Create a bucket on scaleway

Once you have API token generated, create a bucket that will store your files. For this, use the linkĀ https://cloud.scaleway.com/#/buckets

scaleway create bucket 02 min

Give the bucket a name and click the ā€œCreate Bucketā€Ā button.

scaleway create bucket min

Step 4: InstallĀ AWS-CLI

The next step is to install aws-cli and awscli-plugin-endpoint used to interact with Scaleway Object Storage service. The awscli-plugin-endpoint is a great plugin to help people more easily access third-party S3 providers.

Use pythonpip module manager to install the packages.

sudo pip3 install awscli
sudo pip3 install awscli-plugin-endpoint

Step 5: Configure AWS-CLI

Create ~/.aws/Ā directory that will store access information

mkdirĀ ~/.aws/

Then create a configuration file ~/.aws/config with the following content

[plugins]
endpoint = awscli_plugin_endpoint

[default]
region = nl-ams
s3 =
  endpoint_url = https://s3.nl-ams.scw.cloud
  max_concurrent_requests = 100
  max_queue_size = 1000
s3api =
  endpoint_url = https://s3.nl-ams.scw.cloud

Get endpointĀ and regionĀ from the bucket name details page.

scaleway object bucket location min

Create the file~/.aws/credentials to store your Scaleway access credentials.

[default]
aws_access_key_id=<ACCESS_KEY>
aws_secret_access_key=<SECRET_KEY>

Set <ACCESS_KEY> and <SECRET_KEY> printed out inĀ Step 2

Test connection to the Object store with your

$ aws s3 ls
2018-09-28 17:02:43 zambiatek-backups

Try to upload a file

aws s3 cp zambiatek.tar.gz s3://zambiatek-backups/

Check the file to confirm it was uploaded.

$ aws s3 ls s3://zambiatek-backups
2018-09-28 18:33:05 1389731840 zambiatek.tar.gz

The files uploaded should be visible on Scaleway dashboard

scaleway bucket content min

I’ll prepare AWS S3 CLI cheat sheet for administeringĀ S3-compatible Object storage service. Until then, stay tuned and enjoy your time!

Also check Best secure Backup Application for Linux, macOS & Windows

.tdi_4.td-a-rec{text-align:center}.tdi_4 .td-element-style{z-index:-1}.tdi_4.td-a-rec-img{text-align:left}.tdi_4.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_4.td-a-rec-img{text-align:center}}

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button