AWS CLI

You can install and use the AWS Command Line Interface (CLI) with the MapR Object Store.

Installing the AWS CLI

To install the AWS CLI on Ubuntu, RedHat/CentOS, or Suse, run:

pip install awscli
To configure the AWS CLI, use the AWS configure command with the values shown in the following table:
Value Description
AWS Access Key ID Insert the accessKey from the tenants.json file
AWS Secret Access Key Insert the secretKey from the tenants.json file
Default region name Specify 'us-west-1'
Default output format Specify json

Using the AWS CLI

The following table provides several examples of commands that can help you manage buckets and files:
# Create a bucket and upload a file
aws s3 mb s3://mybucket/ --endpoint-url https://<ip-address>:9000 --ca-bundle /absolute/path/to/public.crt
        
echo "HelloS3World" > /tmp/helloS3world.txt
aws s3 cp /tmp/helloS3world.txt s3://mybucket/helloS3world.txt --endpoint-url https://<ip-address>:9000 --ca-bundle /absolute/path/to/public.crt
        
# Move an object from one bucket to another
aws s3 mv s3://firstbucket/helloS3world.txt s3://mybucket/helloS3world.txt --endpoint-url https://<ip-address>:9000 --ca-bundle /absolute/path/to/public.crt
        
# Delete an object from a bucket
aws s3 rm s3://mybucket/helloS3world.txt --endpoint-url https://<ip-address>:9000 --ca-bundle /absolute/path/to/public.crt
        
# Delete the bucket
aws s3 rb s3://mybucket/ --endpoint-url https://<ip-address>:9000 --ca-bundle /absolute/path/to/public.crt
        
# List all files in the bucket
aws s3 ls s3://mybucket/ --endpoint-url https://<ip-address>:9000 --ca-bundle /absolute/path/to/public.crt
        
# Show all files on the filesystem
ls -al /mapr/demo.mapr.com/apps/s3/$(hostname)/mybucket/
Note: The public SSL certificate is generated when installing the MapR Object Store at /opt/mapr/objectstore-client/objectstore-client-1.0.0/conf/certs/public.crt.
For a non-secure cluster, use http instead of https and do not use --ca-bundle /absolute/path/to/public.crt. For example:
# List all files in the bucket for secure cluster
aws s3 ls s3://mybucket/ --endpoint-url https://<ip-address>:9000 --ca-bundle /absolute/path/to/public.crt
         
# List all files in the bucket for non-secure cluster
aws s3 ls s3://mybucket/ --endpoint-url http://<ip-address>:9000