Is there a way to apply environment variables in the litestream.yml file? #123
-
I want to set the replica type in an environment variable, but I get an error. # AWS credentials
access-key-id: $AWS_ACCESS_KEY_ID
secret-access-key: $AWS_SECRET_ACCESS_KEY
dbs:
- path: $LITESTREAM_ROOT/DB/fruits.db # Database to replicate from
replicas:
- type: $REPLICA_TYPE
bucket: $BUKET_NAME # bucket name
path: $REPLICA_DB_PATH # File-based replication
region: $REPLICA_REGION # region of bucket Execution result of echo $ REPLICA_TYPE junkeinoMacBook-Pro:litestream junkei$ echo $REPLICA_TYPE
s3 Execution result of litestream replicate junkeinoMacBook-Pro:litestream junkei$ litestream replicate -config ./litestream/etc/litestream.yml
litestream v0.3.2
unknown replica type in config: "$REPLICA_TYPE" |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @junkei-okinawa. The config file doesn't currently allow for expanding environment variables. You don't need to set the As for the other settings, what's the use case you want to use them for? Why not just write the values in directly? Or you could use |
Beta Was this translation helpful? Give feedback.
Hi @junkei-okinawa. The config file doesn't currently allow for expanding environment variables. You don't need to set the
access-key-id
andsecret-access-key
though if you haveAWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
already set.As for the other settings, what's the use case you want to use them for? Why not just write the values in directly? Or you could use
envsubst
to expand the values from a template YAML file.