Uploading your first asset to a levv bucket #
With levv, you can create storage buckets to persist and retrieve unstructured data through the S3 protocol. You can upload documents, images, csv files, etc and access them from anywhere.
Buckets mananagement is performed via the levv buckets
command.
This guide walks you through creating a bucket and using s5cmd
S3 client to interact with it.
1. Create a bucket #
Run the following command to create a bucket and retrieve its credentials:
$ levv buckets create
The command will request the necessary information to create your bucket. Be aware that your bucket name needs to be unique across levv so that you can interact with it from a public endpoint. As such, opt for names like bucket.company.com
so that conflicts are very unlikely.
This command with print out the keys and the endpoint to get access to your bucket.
2. Install s5cmd #
Install s5cmd, a fast S3 and local filesystem execution tool.
3. Configure bucket credentials #
Add your bucket credentials to the .aws/config
file with the following format:
[default]
aws_access_key_id = <YOUR_BUCKET_ACCESS_KEY>
aws_secret_access_key = <YOUR_BUCKET_SECRET_KEY>
For more information on this file, please refer to the corresponding documentation.
4. Set the S3 endpoint URL #
Set the S3_ENDPOINT_URL
environment variable into levv’s S3 URL:
$ export S3_ENDPOINT_URL="https://s3.levv.io"
5. Interact with your bucket #
Once this is done you can start using s5cmd
commands to interact with your bucket:
- Upload a file:
$ s5cmd cp myfile.txt s3://bucket.company.com/
- List bucket contents:
$ s5cmd ls s3://bucket.company.com/
Make sure to replace bucket.company.com
with the appropiate bucket name that you recently created.
Check the s5cmd
examples to learn more about the interaction with your bucket.