AWS CLI Console client
AWS Command Line Interface (AWS CLI)
AWS CLI — is a command line interface for working with AWS services. For the general order of calling commands, see the official Amazon documentation.
To work with ColdStack using AWS CLI, you can use the following sets of commands:
s3api — commands corresponding to operations in the REST API. Please check the list of supported operations before use.
s3 — additional commands that simplify work with a large number of objects.
Preparation for work
Current status of the system is private alpha testing. To get an access key, you need to contact the admin in our telegram channel to get an access key. Please note that you cannot upload more than 10Tb during this test.
Installation
To install the AWS CLI, follow the instructions on the manufacturer's website.
Setting up
Use the aws configure command to configure the AWS CLI. The command will ask for values for the following parameters:
AWS Access Key ID— enter the key id that you received from our admin.AWS Secret Access Key— enter the secret key that you received from our admin.Default region name— enter valueus-east-1.Note To work with ColdStack, always specify the region
us-east-1. Other region values may result in an authorization error.Default output format- leave unchanged.Leave the rest of the parameters unchanged.
Config files
As a result of its work, the aws configure command will save the settings in files:
Static key in
.aws/credentialsin the following format:[default] aws_access_key_id = id aws_secret_access_key = secretKeyDefault region in
.aws/configin the following format:[default] region=us-east-1
Notes
When using AWS CLI to work with ColdStack, consider the following features of this tool:
AWS CLI treats Object Storage as a hierarchical file system and object keys are in the form of a file path.
When running the aws command to work with ColdStack, the
--endpointparameter is required, and the value should behttps://s3.coldstack.iosince by default the client is configured to work with Amazon servers.When working in macOS, in some cases it is required to launch the following:
export PYTHONPATH=/Library/Python/2.7/site-packages; aws --endpoint-url=https://s3.coldstack.io s3 ls
Examples
Create a bucket and list them
Lets check what buckets do you own:
aws --endpoint=https://s3.coldstack.io s3 lsIf you are a new user and have not created any bucket yet, then this command will not show any buckets. You have to create a bucket for yourself. Lets do it, just replace my-new-bucket with your desired name:
aws --endpoint=https://s3.coldstack.io s3 mb s3://my-new-bucketNow you created a bucket, lets list them one more time:
aws --endpoint=https://s3.coldstack.io s3 lsAt this moment you should see at least one bucket, that you just created:
2021-08-18 11:31:56 my-new-bucketUpload objects
You can load objects in different ways, for example:
Load all objects from local directory:
aws --endpoint=https://s3.coldstack.io \ s3 cp --recursive local_files/ s3://my-new-bucket/path_style_prefix/Load objects described in the
--includefilter and skip objects described in the--excludefilteraws --endpoint=https://s3.coldstack.io \ s3 cp --recursive --exclude "*" --include "*.log" \ local_files/ s3://my-new-bucket/path_style_prefix/Load objects one at a time by running a command of the following type for each object:
aws --endpoint=https://s3.coldstack.io \ s3 cp testfile.txt s3://my-new-bucket/path_style_prefix/textfile.txt
Get the list of objects
aws --endpoint=https://s3.coldstack.io \
s3 ls --recursive s3://my-new-bucketGet an object
aws --endpoint=https://s3.coldstack.io \
s3 cp s3://my-new-bucket/textfile.txt textfile.txtLast updated
Was this helpful?