AWS CLI for S3 Gateway

You can install and use the AWS Command Line Interface (CLI) with the S3 gateway.

Installing the AWS CLI

NOTICE The S3 gateway is included in EEP 6.0.0 - EEP 8.0.0 repositories.

To install the AWS CLI on Ubuntu, RedHat/CentOS, or SLES, 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 for the user
AWS Secret Access Key Insert the secretKey for the user
Default region name Specify 'us-west-1'
Default output format Specify json

Using the AWS CLI

The following table provides examples of commands that can help you manage buckets and files.
NOTE The /opt/mapr/conf/ca/chain-ca.pem file is the public certificate for the node that is generated by Data Fabric.
# Create a bucket and upload a file
aws s3 mb s3://mybucket/ --endpoint-url https://<ip-address>:9000 --ca-bundle /opt/mapr/conf/ca/chain-ca.pem
        
echo "HelloS3World" > /tmp/helloS3world.txt
aws s3 cp /tmp/helloS3world.txt s3://mybucket/helloS3world.txt --endpoint-url https://<ip-address>:9000 --ca-bundle /opt/mapr/conf/ca/chain-ca.pem
        
# 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 /opt/mapr/conf/ca/chain-ca.pem
        
# Delete an object from a bucket
aws s3 rm s3://mybucket/helloS3world.txt --endpoint-url https://<ip-address>:9000 --ca-bundle /opt/mapr/conf/ca/chain-ca.pem
        
# Delete the bucket
aws s3 rb s3://mybucket/ --endpoint-url https://<ip-address>:9000 --ca-bundle /opt/mapr/conf/ca/chain-ca.pem
        
# List all files in the bucket

aws s3 ls s3://mybucket/ --endpoint-url https://<ip-address>:9000 --ca-bundle /opt/mapr/conf/ca/chain-ca.pem
        
# Show all files on the filesystem
ls -al /mapr/demo.mapr.com/apps/s3/$(hostname)/mybucket/

AWS CLI Limitations

If you list a folder in FS deployment mode and at least one of the files or buckets has permissions that deny access, an access-deny error is returned.