AWS CLI Console client

AWS Command Line Interface (AWS CLI)

AWS CLIarrow-up-right — is a command line interface for working with AWS services. For the general order of calling commandsarrow-up-right, see the official Amazon documentation.

To work with Petabox using AWS CLI, you can use the following sets of commands:

Installation

To install the AWS CLI, follow the instructionsarrow-up-right 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:

  1. AWS Access Key ID — enter the key id that you received from our admin.

  2. AWS Secret Access Key — enter the secret key that you received from our admin.

  3. Default region name — enter value us-east-1.

    Note To work with Petabox, always specify the region us-east-1. Other region values may result in an authorization error.

  4. Default output format - leave unchanged.

  5. 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/credentials in the following format:

  • Default region in .aws/config in the following format:

Notes

When using AWS CLI to work with Petabox, 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 Petabox, the --endpoint parameter is required, and the value should be https://s3.petabox.io since 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:

Examples

Create a bucket and list them

Lets check what buckets do you own:

If 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:

Now you created a bucket, lets list them one more time:

At this moment you should see at least one bucket, that you just created:

Upload objects

You can load objects in different ways, for example:

  • Load all objects from local directory:

  • Load objects described in the --include filter and skip objects described in the --exclude filter

  • Load objects one at a time by running a command of the following type for each object:

Get the list of objects

Get an object

Last updated