SDKs
chili speaks the S3 API, so you use the official AWS SDKs and only set the endpoint. Path-style addressing (forcePathStyle) is recommended.
Python (boto3)
import boto3
s3 = boto3.client(
"s3",
endpoint_url="https://<ENDPOINT>",
aws_access_key_id="AKIA...",
aws_secret_access_key="...",
)
s3.put_object(Bucket="my-bucket", Key="backup.tar", Body=open("backup.tar", "rb"))Node.js (AWS SDK v3)
import { S3Client, PutObjectCommand } from '@aws-sdk/client-s3';
const s3 = new S3Client({
endpoint: 'https://<ENDPOINT>',
region: 'ch-east',
credentials: { accessKeyId: 'AKIA...', secretAccessKey: '...' },
forcePathStyle: true,
});
await s3.send(new PutObjectCommand({ Bucket: 'my-bucket', Key: 'backup.tar', Body: data }));Go (aws-sdk-go-v2)
cfg, _ := config.LoadDefaultConfig(context.TODO(),
config.WithRegion("ch-east"),
)
client := s3.NewFromConfig(cfg, func(o *s3.Options) {
o.BaseEndpoint = aws.String("https://<ENDPOINT>")
o.UsePathStyle = true
})The region identifier (ch-east / ch-west) is finalized with the platform; most SDKs simply require a non-empty value.