Object storage

AWS CLI custom S3 endpoint: profile, region and bucket commands

Use --endpoint-url to send an AWS CLI S3 request to your storage provider. Keep the credentials in a separate profile and pass the provider's signing region. Start by listing the assigned bucket; you do not need to upload or delete files to check basic access.

1. Create a named profile

Install AWS CLI v2 using its official instructions, then create a profile for the storage service. Enter the provider-issued access key and secret when prompted. You do not need an AWS account to use a compatible provider's keys.

The commands below use the name dotmoose and path-style addressing. This changes that named CLI profile only. Keep any existing AWS production profile separate. Do not paste secret keys into a support message or commit the credentials file.

aws configure --profile dotmoose
aws configure set s3.addressing_style path --profile dotmoose

Install AWS CLI

2. Copy the service connection details

Set the HTTPS endpoint, signing region and bucket exactly as supplied by your provider. These are placeholders, not working DotMoose service credentials. The bucket name goes in the bucket argument, not on the end of the endpoint.

The shell syntax shown is for macOS and Linux. Windows users can set the same values in PowerShell and pass them to the equivalent AWS CLI command.

# Replace these with the values supplied by your storage provider.
export S3_ENDPOINT_URL='https://storage.example.com'
export S3_REGION='provider-region'
export S3_BUCKET='your-assigned-bucket'

3. List a few objects without changing the bucket

Run this in a shell after setting the variables. The checks stop an empty endpoint or bucket from silently becoming a request to an unintended account. The command limits the page size and total result to five objects. It prints the number returned, not the total bucket size.

A result of zero is normal for an empty bucket. Listing the assigned bucket may work even when an account-wide list of all buckets is forbidden. No files are uploaded, deleted or made public.

: "${S3_ENDPOINT_URL:?Set the HTTPS storage endpoint}"
: "${S3_REGION:?Set the signing region}"
: "${S3_BUCKET:?Set the assigned bucket}"
case "$S3_ENDPOINT_URL" in
  https://*) ;;
  *) printf '%s\n' 'Use an HTTPS endpoint.' >&2; exit 1 ;;
esac

aws --profile dotmoose \
  --endpoint-url "$S3_ENDPOINT_URL" \
  --region "$S3_REGION" \
  s3api list-objects-v2 \
  --bucket "$S3_BUCKET" --page-size 5 --max-items 5 \
  --query 'length(Contents || `[]`)' --output json --no-cli-pager

AWS CLI endpoint options and precedence

4. Fix common connection errors

For SignatureDoesNotMatch, check the profile keys, region, endpoint and system clock. If a proxy rewrites the signed host or path, fix the proxy configuration.

AccessDenied can be a bucket-permission issue, not a bad password. A missing bucket or redirect often points to the wrong name, region or endpoint. TLS errors need a valid hostname and certificate chain; do not disable certificate validation as a permanent fix.

Make --endpoint-url and --profile part of saved commands. Without an explicit endpoint, other CLI settings or AWS defaults may send the request elsewhere.

5. Move on to your actual workload

A listing is only a connection check. Use a dedicated test prefix to verify small uploads, downloads and byte comparisons before starting a migration. Test multipart transfers and restores separately if a backup job depends on them. Avoid broad recursive deletes as a troubleshooting step.

For DotMoose, use the connection details from your Object Storage service and review its capacity and supported operations. The command-line example does not claim compatibility with every feature surrounding Amazon S3.

Compare DotMoose Object Storage plans | Use the endpoint from Python with boto3 | Plan a restore test

Related DotMoose serviceExplore DotMoose Object Storage

Keep reading

Related guides.

More object storage →