Environment variables
The Vizzly query engine can be configured by setting runtime environment variables. These will allow you to do things such as;
- Change the log level to be more or less verbose.
- Change the base path for all routes on the query engine.
- Change where the Vizzly config is located on the docker image.
The variables
PORT
The default port the query engine runs on is port 8000
. You can change this using the PORT
environment variable.
VIZZLY_BASE_PATH
This changes the base path of the Vizzly query engine. For example, you might have a routing layer that matches requests for /vizzly-query-engine/*
, and forwards them to the
query engine. In which case, you'd set this value to /vizzly-query-engine
so the requests match the path matchers in the query engine.
If you need to support dynamic base paths, this is supported by using path matchers and indexes starting at 1. For example, a base path of;
/:1/:2/:3
will match requests sent to all of the following;
/blue/green/red/status
/duck/dog/chicken/status
This environment variable is not required and defaults to ''
.
VIZZLY_CONFIG_FILE
Changes the path at which the config file resides inside the running container.
This environment variable is not required, and defaults to /etc/vizzly/vizzly.config.json
.
LOG_LEVEL
Change the log level from the default warning
level. Valid logging levels are "debug"
, "info"
, "warning"
and "error"
.
VIZZLY_PUBLIC_KEYS
Provide your Vizzly public key through an environment variable, rather than the publicKeyCertificates
field of the Vizzly config.
The value should be formatted as a JSON array. For example, if you had the following public key;
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQJqQ1P+MyW4E/32pXvkxQiOVT0IW
1CwdEzN2D5+KtIK1qyUpMFiH2oBc8BIo8w3AvID0cOrD5+KEKXSIbw9Nig==
-----END PUBLIC KEY-----
then it would be exported in this format as an environment variable.
export VIZZLY_PUBLIC_KEYS='["-----BEGIN PUBLIC KEY-----\r\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQJqQ1P+MyW4E/32pXvkxQiOVT0IW\r\n1CwdEzN2D5+KtIK1qyUpMFiH2oBc8BIo8w3AvID0cOrD5+KEKXSIbw9Nig==\r\n-----END PUBLIC KEY-----\r\n"]'
The Vizzly CLI command vizzly format-public-pem-for-env
will convert your public PEM file into the format required for the VIZZLY_PUBLIC_KEYS
environment variable.
VIZZLY_AWS_SECRETS_MANAGER_SECRET_ID
Load secret environment variables from AWS Secrets Manager (opens in a new tab).
Provide the ID of the secret stored within the same region as the running Vizzly Query Engine, to load secret environment variables at runtime.
The secret should be in a JSON-formatted string, for example, a secret storing a postgres database password will be;
{"VIZZLY_POSTGRES_PASSWORD":"<< YOUR PASSWORD >>"}
Be certain that the container has permission to fetch the secret from AWS Secrets Manager.