The AWS CLI can be used to manage your bucket's contents via the command line.

Please follow the steps below for instructions on how to install and configure this tool.

  1. To access the storage bucket using the CLI, enter the following command:
aws configure
  1. When asked, enter your Access Key and Secret Key. For the region, we are using us-east-1, as that is the region we selected for our bucket. This value may vary based on your region selection. The last setting you can leave blank.
  2. To access your bucket, in the command line, enter your bucket's endpoint URL.
    • In the command line, append the endpoint with aws s3 ls --endpoint-url=, followed by the endpoint URL:
aws s3 ls --endpoint-url=
  1. You now have access to your StackPath storage bucket through the AWS CLI tool.

Upload a File

To upload files to your bucket, use the following command:

aws s3 cp /path/to/your/file s3://YOUR_BUCKET_NAME/ --endpoint-url=

To upload a specific file to your bucket that has public access, even if the bucket is private, append --acl public-read to your command:

aws s3 cp /path/to/your/file s3://YOUR_BUCKET_NAME/ --endpoint-url= --acl public-read

Recursively Upload a Folder

To upload an entire folder or multiple files to a bucket, use the --recursive flag when cp'ing your files/folders:

aws s3 cp /path/to/your/file s3://YOUR_BUCKET_NAME/ --endpoint-url= --recursive

To learn more about the cp command, visit the AWS CLI Command Reference site.

Access Public Files in your Bucket

After you upload a public file to your bucket, you can use the following URL to access the uploaded content:

aws s3 rm s3://YOUR_BUCKET_NAME/path/to/your/file --endpoint-url=

To learn. more about the rm command, visit the AWS CLI Command Reference site.