AWS CLI with WebShield S3
Configure the AWS CLI to work with WebShield S3-compatible object storage.
The official AWS CLI works with WebShield object storage — you only need to point it at the WebShield endpoint. See Object storage for how to obtain your keys and create buckets.
Prerequisites
Section titled “Prerequisites”- Endpoint:
https://s3.webshield.pro - Access Key ID and Secret Access Key from the S3 storage page in the control panel.
- The exact bucket name from the control panel (for example,
company-backups).
Install
Section titled “Install”# Debian/Ubuntusudo apt install awscli# macOSbrew install awscli# or the official bundle: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.htmlConfigure a profile
Section titled “Configure a profile”Store the credentials in a named profile so you don’t repeat them on every command:
aws configure set aws_access_key_id WSS... --profile webshieldaws configure set aws_secret_access_key <secret> --profile webshieldaws configure set region ru-1 --profile webshieldUse your bucket’s region: ru-1 or eu-1.
Everyday commands
Section titled “Everyday commands”Pass --endpoint-url and your profile on each call:
alias ws='aws --profile webshield --endpoint-url https://s3.webshield.pro'
ws s3 ls # list your bucketsws s3 ls s3://company-backups/ # list objects in a bucketws s3 cp ./dump.sql.gz s3://company-backups/db/# upload a filews s3 cp s3://company-backups/db/dump.sql.gz . # download a filews s3 sync ./media s3://company-backups/media # sync a directoryws s3 rm s3://company-backups/db/dump.sql.gz # delete an objectMultipart upload for large files is handled automatically by aws s3 cp/sync.
Low-level s3api
Section titled “Low-level s3api”The s3api subcommands work too, for operations s3 does not expose:
ws s3api head-object --bucket company-backups --key db/dump.sql.gzws s3api list-objects-v2 --bucket company-backups --prefix db/- Both path-style and virtual-hosted addressing (
https://<bucket>.s3.webshield.pro/<key>) are supported. To use virtual-hosted addressing, runaws configure set s3.addressing_style virtual --profile webshield; keep the same endpoint. - Creating and deleting buckets requires a key with bucket management permission; see Access keys.
- If the account balance goes negative, storage becomes read-only:
cp/syncuploads fail while downloads keep working. Top up the balance to restore writes.