Link Search Menu Expand Document

Add Data

In this section we’ll review how to copy files into lakeFS using the AWS CLI.

  1. If you don’t have the AWS CLI installed, follow the instructions here.
  2. Configure a new connection profile using the credentials we generated earlier:

    aws configure --profile local
    # output:
    # AWS Secret Access Key [None]: ****************************************
    # Default region name [None]:
    # Default output format [None]:
  3. Let’s test to see that it works. We’ll do that by calling s3 ls which should list our repositories for us:

    aws --endpoint-url= --profile local s3 ls
    # output:
    # 2021-06-15 13:43:03 example-repo

    Note: We’re using - a special DNS record which always resolves to localhost, subdomains included.
    Since S3’s API uses subdomains for bucket addressing, simply using localhost:8000 as an endpoint URL will not work.

  4. Great, now let’s copy some files. We’ll write to the main branch. This is done by prefixing our path with the name of the branch we’d like to read/write from:

    aws --endpoint-url= --profile local s3 cp ./foo.txt s3://example-repo/main/
    # output:
    # upload: ./foo.txt to s3://example-repo/main/foo.txt
  5. Back in the lakeFS UI, we should be able to see our file added to the main branch!

    Object Added

Next steps

Now that your repository contains some data, what about using the lakeFS CLI for committing, branching and viewing the history?