How To Use the AWS Client to Access the S3 API

You will need EC2 credentials for this guide. You can learn how to create them here.

It is recommended to activate a virtual environment with source .venv/bin/activate

First, install the AWS client with pip install awscli awscli-plugin-endpoint

Now create the directory ~/.aws We need to create two files in this directory, ~/.aws/credentials and ~/.aws/config These are defined as follows.

$ cat ~/.aws/credentials [default] aws_access_key_id = <access_key> aws_secret_access_key = <secret_key> $ cat ~/.aws/config [plugins] endpoint = awscli_plugin_endpoint [profile default] region = iad3 s3 = endpoint_url = https://us-east-1.moonqube.com:6780 signature_version = s3v4 s3api = endpoint_url = https://us-east-1.moonqube.com:6780

Now you can test that you can access the S3 API with aws —profile default s3 ls

This command will list any existing buckets.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us