How to connect to your S3 storage (aws cli, S3cmd)

 

  •  

 

You can use any s3 compatible software with our s3 storages such as aws cli or S3cmd. 

 

AWS CLI 

Aws cli is a command-line interface for managing AWS services.

All the commands are described in the official Amazon documentation.

 

Install AWS CLI 

To install aws cli use this article.

To verify that installation was successfully completed, run aws --version command in the terminal:

$aws --version
aws-cli/1.16.194 Python/3.6.0 Windows/10 botocore/1.12.184

 

Configure storage

After installing aws cli, enter aws configure command. A configuration wizard will be launched.

The wizard will ask to enter the following data:

  • Access Key — enter the access key that you received when creating the storage in the personal account.
  • Secret Key  enter the secret key that you received when creating the storage in the personal account.
  • Default region name — enter the storage region, for example, s-dt2.
  • Leave the rest of the parameters unchanged.

To check that you have configured it right, run the following command:

aws s3 ls --endpoint-url=https://s-ed1.cloud.gcore.lu

Value for --endpoint-url= depends on the storage location and can be found here.

Since there are no buckets in the storage yet, the command won't list anything, but if there are no errors, you have configured the credentials correctly.

 

S3cmd

S3cmd is a command-line tool and client for managing data in Amazon S3 storage.

All the commands are described in the official S3cmd documentation

 

Install S3cmd

Open the Download section on the official website, download and install the appropriate version.

 

Configure storage 

Configure with a configuration wizard

After installing aws cli, enter s3cmd --configure command. A configuration wizard will be launched.

The wizard will ask to enter the following data:

  • Access Key — enter the access key that you received when creating the storage in the personal account.
  • Secret Key  enter the secret key that you received when creating the storage in the personal account.
  • S3 Endpoint — enter  the storage URL, e.g. s-dt2.cloud.gcore.lu 
  • DNS-style bucket+hostname:port template for accessing a bucket — enter  the storage URL, e.g. s-dt2.cloud.gcore.lu 
  • Leave the rest of the parameters unchanged.

S3cmd will try to connect to the storage.

If all the data is entered correctly, a message will appear:

Success. Your access key and secret key worked fine :-).

S3cmd will save the entered data in the ~ / .s3cfg file in the following format: 

[default] 
access_key = 09IDGHJ65K5... 
secret_key = E2ZlM4LqNpfahmKg... 
host_base= s-dt2.cloud.gcore.lu 
host_bucket = s-dt2.cloud.gcore.lu 

 

Configure without a configuration wizard

This method allows you to enter configuration data in a line,  without the configuration wizard.

Enter the command:

s3cmd --access_key ZA*****2NIGT --secret_key XA*****1E4X9F --host s-ed1.cloud.gcore.lu --host-bucket s-dt2.cloud.gcore.lu 
  • ZA*****2NIGT is the access key, that you received when creating the storage in the personal account.
  • XA*****1E4X9F is the secret key, that you received when creating the storage in the personal account.
  • s-ed1.cloud.gcore.lu is the storage URL 
Was this article helpful?
Recently viewed articles