Quickstart - AWS CLI and Hosted Gateway MT

Hosted S3 Compatible Multitenant Gateway

Storj now offers a hosted multitenant gateway that is backward compatible with S3. This means you’ll be able to integrate with the Storj network via HTTP, and you won’t have to run anything extra on your end.

By using hosted Gateway MT you are opting in to server-side encryption.

Using Gateway MT with AWS CLI is a 2-step process:

Generate Credentials to the Gateway MT

Navigate to the Access page within your project and then click on Create Access Grant +. A modal window will pop up and you can enter a name for this access grant.

Assign the permissions you want this access grant to have, then click on Continue in Browser:

Enter the Encryption Passphrase you used for your other access grants. If this isuour first access grant, we strongly encourage you to use a mnemonic phrase as your encryption passphrase. (The GUI automatically generates one on the client-side for you)

Click on the Generate S3 Gateway Credentials link and then click on the 'Generate Credentials' button.

Copy your Access Key, Secret Key, and Endpoint to a safe location.

Now you are ready to configure AWS CLI.

Configure AWS CLI with your credentials

To continue make sure you have the AWS CLI installed on your machine.

Verify your AWS CLI version by running aws --versionin your terminal. AWS CLI current version is version 2. If you are using AWS CLI v1, you will need to install a plugin to be able to define the endpoint. See how here.

2. Configure your AWS CLI with the gateway MT credentials from the previous step by running aws configure in your terminal:

~ % aws configure
AWS Access Key ID [****************e53q]: <<yourAccessKey>>
AWS Secret Access Key [****************bbxq]: <<yourSecretKey>>
Default region name [us-east-1]:
Default output format [None]:
~ %

3. Optional but strongly recommended: Set the multipart threshold to 64 MB.

You can now use AWS CLI. Some examples of use:

Make a bucket

~ % aws --endpoint-url=https://gateway.eu1.storjshare.io s3 mb s3://waterbear

Make sure to adjust the endpoint URL to the one you have been given when creating your credentials.

Display buckets

aws --endpoint-url=https://gateway.eu1.storjshare.io s3 ls

Copy a file

aws --endpoint-url=https://gateway.eu1.storjshare.io s3 cp /tmp/test.zip s3://waterbear

List files in a bucket

aws --endpoint-url=https://gateway.eu1.storjshare.io s3 ls s3://waterbear --endpoint-url=https://gateway.storj.io

Copy a file from a bucket

aws --endpoint-url=https://gateway.eu1.storjshare.io s3 cp s3://waterbear/test.zip /tmp/Archive.zip