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.
RS_REPLICATION_<ID>_MODEenabledReplication mode. Accepted values: enabled, paused, disabled (case-insensitive).

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

TLS verification for replication destinations is configured globally for the source instance with RS_REPLICATION_VERIFY_SSL and RS_REPLICATION_CA_PATH. These settings apply to all replication tasks created through provisioning, the HTTP API, SDKs, CLI, or the Web Console.

Lifecycle Provisioning

You can provision lifecycle policies by setting environment variables. Lifecycle policies run in the background and currently support deleting old records from a bucket.

NameDefaultDescription
RS_LIFECYCLE_<ID>_NAMEProvisioned lifecycle policy name (required)
RS_LIFECYCLE_<ID>_TYPEdeleteLifecycle action type. Currently only delete is supported.
RS_LIFECYCLE_<ID>_BUCKETBucket to apply the lifecycle policy to (required)
RS_LIFECYCLE_<ID>_MAX_AGEMaximum record age before deletion, for example 30d, 24h, or 3600s (required). Minimum value is 1h.
RS_LIFECYCLE_<ID>_INTERVAL3600sInterval between lifecycle runs, for example 10m, 1h, or 3600s. Minimum value is 10m.
RS_LIFECYCLE_<ID>_ENTRIESComma-separated list of entries to clean. If empty, all entries are matched. Prefix wildcards are supported.
RS_LIFECYCLE_<ID>_WHENJSON condition for records to delete. Uses the same condition syntax as queries, but #ext is not supported.
RS_LIFECYCLE_<ID>_MODEenabledPolicy mode: enabled, disabled, or dry_run.

Example:

RS_LIFECYCLE_A_NAME=purge-sensors-30d
RS_LIFECYCLE_A_TYPE=delete
RS_LIFECYCLE_A_BUCKET=telemetry
RS_LIFECYCLE_A_ENTRIES=sensors/*,env/temp,env/humidity
RS_LIFECYCLE_A_MAX_AGE=30d
RS_LIFECYCLE_A_INTERVAL=10m
RS_LIFECYCLE_A_WHEN={"$eq":["&label","true"]}
RS_LIFECYCLE_A_MODE=dry_run

Use dry_run mode to count matching records and write lifecycle audit events without deleting data. This is useful for validating max_age, entries, and when filters before switching the policy to enabled.

Provisioned lifecycle policies cannot be updated or removed through the API. Change their environment variables and restart ReductStore to update them. If RS_LIFECYCLE_<ID>_MODE is not set, ReductStore preserves the existing stored mode for an already provisioned lifecycle policy.

For more information about lifecycle policies, see the Lifecycle Policies Guide.