Buckets

Naming and creating buckets

Examples use the AWS CLI profile from Connecting.

Naming

Bucket names must start with your organization’s prefix followed by a dot:

<prefix>.<bucket-name>

Find your prefix in the Elastx Cloud Console. Names without the prefix are rejected.

Create a bucket

aws --profile <profile> s3 mb s3://<prefix>.<bucket-name>

With object locking (immutability):

aws --profile <profile> s3api create-bucket --bucket <prefix>.<bucket-name> --object-lock-enabled-for-bucket

Note: Object locking can only be enabled when the bucket is created. It also enables versioning, which cannot be turned off. See Object locking.

Upload and download

aws --profile <profile> s3 cp ./file.tar.gz s3://<prefix>.<bucket-name>/
aws --profile <profile> s3 cp s3://<prefix>.<bucket-name>/file.tar.gz ./
aws --profile <profile> s3 ls s3://<prefix>.<bucket-name>/

MinIO Client (mc)

mc mb <alias>/<prefix>.<bucket-name>
mc mb --with-lock <alias>/<prefix>.<bucket-name>
mc cp ./file.tar.gz <alias>/<prefix>.<bucket-name>/
mc cp <alias>/<prefix>.<bucket-name>/file.tar.gz ./
mc ls <alias>/<prefix>.<bucket-name>