Now liveSwiss S3. No CLOUD Act. Start your free trial now.

Developer tools

AWS CLI v2 with --endpoint-url

Updated on 24 October 2026Reading time approx. 3 minutes

The AWS CLI v2 is the command-line tool from AWS. With a custom endpoint it also works with S3-compatible storage. On this page you set it up for chili.

Manufacturer statement and test with chili

  • Manufacturer statement (as of 19 October 2026): According to the AWS documentation, you can specify a custom endpoint per command (--endpoint-url), per profile (endpoint_url) or through an environment variable (AWS_ENDPOINT_URL, AWS_ENDPOINT_URL_S3). You set retention and Object Lock with the s3api commands.
  • Test with chili: no. We have not tested the AWS CLI individually with chili. Please check your workflows in the Free Trial (20 days, 1 TB).
  • We make no commitments on throughput or transfer times.

What you need

  • a bucket (article "Create a bucket")
  • an access key with access key ID and secret (article "Create an access key")
  • your chili endpoint and the region. The console shows both together with the bucket.
  • the AWS CLI v2 on your computer, installed following the AWS instructions

Set up a profile

  1. Start aws configure --profile chili.
  2. Enter the access key ID and secret. Enter the region as the console shows it. You can leave the output format empty.
  3. Open the file ~/.aws/config and add the endpoint to the profile:

[profile chili]
region = YOUR_REGION
endpoint_url = YOUR_CHILI_ENDPOINT

If the console requires a specific addressing style, set it in the same profile:

s3 =
addressing_style = path

Keep the secret in ~/.aws/credentials, as aws configure does. Never in a script or repository.

Check the connection

aws s3 ls --profile chili

The command lists your buckets. If you prefer to specify the endpoint per command, use --endpoint-url:

aws s3 ls --endpoint-url YOUR_CHILI_ENDPOINT --profile chili

For single sessions, the environment variable AWS_ENDPOINT_URL_S3 is enough; it sets the endpoint for S3 only.

Upload and download

aws s3 cp ./report.pdf s3://YOUR-BUCKET/report.pdf --profile chili
aws s3 cp s3://YOUR-BUCKET/report.pdf ./report-copy.pdf --profile chili
aws s3 ls s3://YOUR-BUCKET/ --profile chili

Set retention with s3api

For this, create the bucket in the console with Object Lock (article "Versioning and Object Lock"). Object Lock and Versioning are add-ons and cost CHF 3.00 per TB and month (excl. VAT), with a minimum of 1 TB per feature and month. There is no minimum in the trial.

The commands:

  • aws s3api put-object-retention sets the mode (GOVERNANCE or COMPLIANCE) and the expiry date for an object.
  • aws s3api put-object-lock-configuration sets the default retention of the bucket.

Example for one object in governance mode, with a date of your choice:

aws s3api put-object-retention --bucket YOUR-BUCKET --key report.pdf --retention Mode=GOVERNANCE,RetainUntilDate=2026-12-31T00:00:00Z --profile chili

Whether aws s3 cp itself can set retention is not evidenced in the manufacturer statement. Use s3api for this.

The Free Trial offers governance mode only, with retention until the end of the trial at most. Compliance mode at chili requires a retention agreement: you contact us before activation, and the retention period is stated in the agreement. You still set up your account, buckets and Object Lock yourself. If backup software such as Veeam writes to the bucket, do not set a default retention.

If it does not work

Check endpoint, region, bucket name and key for typing errors, and check that the key is active. Personal support is available as an option through the support packages.

Still have questions?

Our support team in Switzerland is happy to help you personally.

Open a support ticket