Skip to content

Amazon S3 Configuration

The API can be configured to automatically download the contents of an S3 bucket before starting. This allows fetching the contents of a ledger to the local working directory of the container in lieue of mounting it directly. By default the entire contents of the S3 bucket will be downloaded to the working directory.

The API uses the boto3 Python package for connecting to S3. It can load authentication data from various sources, see the docsfor more details.

Configuration

To enable S3 integration set the following environment variable:

export BAPI_STORAGE="s3"

Additionally, you'll need to instruct the API which bucket to use:

export BAPI_S3__BUCKET="my-bucket"

Assuming authentication has been configured correctly, the API will automatically fetch the entire contents of the S3 bucket to the configured BAPI_WORK_DIR folder. Ensure that you update the entrypoint to the location of the main ledger file:

export BAPI_ENTRYPOINT="main.beancount"