Aws cli is a comfortable command line to manage the object storage s3. In this manual will be considered particular tool’s installation and configuration.
Installation and configuration
Installation (CentOS 7)
For the aws-cli installation we will use pip3, which is python packet manager. We use this way of solution because it is more convenient in our opinion.
Other options of installation of aws-cli can be found in the official documentation of command line
1) Let’s install packet manager pip3
$ sudo yum install python3-pip -y $ pip3 --version pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)
2) Next step is aws-cli installation
$ sudo pip3 install awscli $ aws --version aws-cli/1.18.87 Python/3.6.8 Linux/3.10.0-1127.10.1.el7.x86_64 botocore/1.17.10
Command line allows to use several configuration profiles. The data of profiles is stored in the ~/.aws/credentials directory
1) Let’s create new profile
$ aws configure --profile my_user AWS Access Key ID [None]: MB4Q7BBBCD1QZBZCUWAG AWS Secret Access Key [None]: acfhovIkJ1qlgZ7DBdIzYKPPZrUI8cMEzrmbofoi Default region name [None]: us-east-1 Default output format [None]:
It is necessary to input following S3 account data: Access Key ID, Secret Access Key. For the region we insert us-east-1
Access Key ID и Secret Key can be found in the bucket description of the object storage control panel.
2) To check if configurations are correct let’s try to display the list of buckets for this particular account.
NB! Since we use our private s3compitable cloud, not the AWS platform, with the command it is necessary to indicate the endpoint or URL entry point to the s3 storage.
$ aws s3 ls --profile=my_user --endpoint=https://s3.pilw.io 2022-03-04 16:03:46 example 2022-03-14 14:55:10 gallery 2022-03-14 16:18:51 temporary
If the list of buckets is on the display, then installation and configuration are finished.
We also suggest you this article: Basic use of aws-cli command line
There we will go through the following topics: working with command line, file uploading and downloading, synchronization of local directory with a cloud, bucket creation and removal and many more