Getting Started with S3 Cloud4U Using the AWS CLI

1) Install AWS CLI

- On Windows, download the AWSCLI-64 or AWSCLI-32 bit installer for Windows and set it as the default.

- On Mac and Linux

Requires Python 2.6.5 or later, and the Python Package Installer. 

Then set it up with one command.

pip install awscli

After installation, use the aws --version command in the console to check the installed version.

2) Profile setting

You can access the administration panel of the service at https://cmc.objstor.cloud4u.com:8443 using the login details received from Cloud4U technical support after purchasing the service or from your S3 administrator.

In the Administration panel, in the Security Credentials find and remember ACCESS KEY ID, SECRET KEY

To work, we need to configure our profile, we can use it as a global profile, then use the aws configure command or a dedicated command.

In the example below, we will create an additional one named demo-s3. Type the command

aws configure --profile demo-s3

and enter the data requested by the system:

  • AWS Access Key ID: (7683ed31dcXXXXXXXXX)
  • AWS Secret Access Key: (oUiK3XXXXXXXXXXXXXXXXXXX)
  • Default region name: K41
  • Default output format: json

 

The output parameters can be of the following types:

  • json
  • text
  • table

 

In the example we chose json.

We can set the created profile as the default, which we will do:

setx AWS_DEFAULT_PROFILE demo-s3

You will need to restart the console for the changes to take effect.

The profile configuration files themselves are located on the Windows system in the folder: C:\Users\ИМЯ_ПОЛЬЗОВАТЕЛЯ\.aws.

 

3) Start working with S3

To connect, we need to specify the connection point, endpoint-url, it can take the following values:

  • S3 ENDPOINT (HTTP): http://s3.objstor.cloud4u.com:80/.
  • S3 ENDPOINT (HTTPS): https://s3.objstor.cloud4u.com:443/.

3.1 Get the list of buckets with the list-buckets.

a) Specifying a specific profile:

aws s3api list-buckets -endpoint-url https://s3.objstor.cloud4u.com:443/ --profile demo-s3

b) With default profile:

aws s3api list-buckets -endpoint-url https://s3.objstor.cloud4u.com:443/.

We created a profile with JSON, but we can change this by specifying additionally --output, for example:

aws s3api list-buckets --endpoint-url https://s3.objstor.cloud4u.com:443/ --output text

If you get an error when running the command: Unable to locate credentials. You can configure credentials by running "aws configure" then you should check your profile settings and the correctness of the data entered.

3.2 Let's create a bucket using the create-bucket.

aws s3api create-bucket -endpoint-url https://s3.objstor.cloud4u.com:443/ --bucket demo-s3-bucket --acl public-read

The access rights list (acl) can have values such as:

  • private
  • public-read
  • public-read-write
  • authenticated-read

Please note that to access the bucket, you must use the URI http://s3.objstor.cloud4u.com/demo-s3-bucket, NOT the FQDN http://demo-s3-bucket.s3.objstor.cloud4u.com.

3.3 Let's upload the file to the created bucket using the put-object command. 

aws s3api put-object -endpoint-url https://s3.objstor.cloud4y.ru:443/ --bucket demo-s3-bucket --key my-video-file.mp4 --body C:\Upload\my-video-file.mp4 

After downloading, we will get this result:

All these actions can also be performed/checked in the control panel

We work similarly with other commands, see the detailed information.

Have you tried Cloud4U cloud services? Not yet?

Go to the Main Website

Try for free

  • S3, Объектноехранилище, objectstores3, storage, object storage, cloudian, cloud storage, cloud
  • 141 Users Found This Useful
Was this answer helpful?

Related Articles

7. Billing in S3 Object Storage

  Billing in S3 includes the following parameters The amount of space used Number of...

4.Способы работы с объектным хранилищем через различное программное обеспечение

Подготовка идентификационных данных 1. Авторизуйтесь в объектном хранилище Cloud4Y:...

3.Storage and data access management in S3 Object Storage

1.Organization of data storage in S3 object storageS3 is not a hierarchical file system, but...

Access to S3 from the VCD cloud dashboard

The VMware vCloud Director® Object Storage Extension™ plug-in enables Cloud4U users to access...

How to work with S3 using the AWS SDK client in php

 0. Install php 1. INSTALL composer Go to the directory from which we will work with...