Skip to main content
Version: Next

ReductStore Provisioning

ReductStore provides an HTTP API to create and configure resources such as buckets, access tokens or replication tasks. However, if you are following an Infrastructure as Code (IaC) approach, you may want to provision resources at the deployment stage and ensure that they can't be modified or deleted using the HTTP API.

Example

Here is an example of provisioning two buckets and a token to access them:

RS_BUCKET_A_NAME=bucket-1
RS_BUCKET_A_QUOTA_TYPE=FIFO
RS_BUCKET_A_QUOTA_SIZE=1Tb

RS_BUCKET_B_NAME=bucket-2

RS_TOKEN_A_NAME=token
RS_TOKEN_A_VALUE=somesecret
RS_TOKEN_A_READ=bucket-1,bucket-2

As you can see, each resource has a type and an ID. The type is BUCKET for buckets and TOKEN for tokens. The ID is a unique identifier for the resource. You can use any string value for the ID. It is only used to group resources of the same type.

Below you will find the available settings for each resource type.

Bucket Provisioning

You can provision buckets by setting environment variables. The following table lists the available settings:

NameDefaultDescription
RS_BUCKET_<ID>_NAMEProvisioned bucket name (required)
RS_BUCKET_<ID>_QUOTA_TYPENONEIt can be NONE, FIFO or HARD.
RS_BUCKET_<ID>_QUOTA_SIZE0Size of quota to start removing old data e.g. 1 KB, 10.4 MB etc.
RS_BUCKET_<ID>_MAX_BLOCK_SIZE64MbMaximal block size for batched records
RS_BUCKET_<ID>_MAX_BLOCK_RECORDS1024Maximal number of batched records in a block

For more information about the bucket settings, see the Buckets Guide.

Token Provisioning

You can provision tokens by setting environment variables. The following table lists the available settings:

NameDefaultDescription
RS_TOKEN_<ID>_NAMEProvisioned token name (required)
RS_TOKEN_<ID>_VALUEProvisioned value of token (required)
RS_TOKEN_<ID>_FULL_ACCESSfalseFull access permission
RS_TOKEN_<ID>_READList of buckets for reading separated by a comma.
RS_TOKEN_<ID>_WRITEList of buckets for writing separated by a comma.

For more information about the token settings, see the Access Control Guide.

Replication Provisioning

You can provision replication tasks by setting environment variables. The following table lists the available settings:

NameDefaultDescription
RS_REPLICATION_<ID>_NAMEProvisioned replication task name (required)
RS_REPLICATION_<ID>_SRC_BUCKETSource bucket name (required)
RS_REPLICATION_<ID>_DST_BUCKETRemote bucket name (required). It must be created before replication
RS_REPLICATION_<ID>_DST_HOSTURL of destination instance (required). For example, https://play.reduct.store or http://localhost:8383
RS_REPLICATION_<ID>_DST_TOKENToken for destination instance
RS_REPLICATION_<ID>_ENTRIESList of entries to replicate. Separate entries with a comma. If the list is empty, all entries will be replicated.
RS_REPLICATION_<ID>_WHENCondition for replication. If not set, all entries will be replicated.

For more information about the replication settings, see the Data Replication Guide.