Skip to content

Secrets

Any string value in a pipeline config can be a reference to a secret instead of a plaintext value. Bizon resolves every reference once, over the raw YAML, before the config is validated. Sources and destinations receive plain strings, so no connector needs to support secrets itself.

source:
name: hubspot
stream: contacts
authentication:
type: api_key
params:
token: gsm://hubspot-api-token
engine:
backend:
type: postgres
config:
host: db.internal
port: 5432
database: bizon
schema: public
username: bizon
password: env://PG_PASSWORD
ReferenceResolves to
gsm://<secret>Latest version of <secret> in the default project
gsm://<secret>/versions/<n>Version <n> of <secret> in the default project
gsm://projects/<project>/secrets/<secret>/versions/<n>That exact resource, used as-is
env://<VAR>The environment variable <VAR>
${gsm://...} / ${env://...}The same, embedded in a larger string
source:
name: notion
stream: pages
authentication:
type: api_key
params:
token: gsm://notion-api-token/versions/3

The full projects/... form names the project, so it needs no default project. The short forms use the default project. The secret payload is decoded as UTF-8.

password: env://PG_PASSWORD

A variable that is not set is an error, not an empty string. Variables can come from the shell or from a .env file loaded with --env-file.

Wrap a reference in ${...} to embed it in a larger string. A value can hold several:

destination:
name: bigquery
config:
project_id: ${env://GCP_PROJECT_ID}
dataset_id: raw_${env://ENVIRONMENT}
gcs_buffer_bucket: ${env://GCP_PROJECT_ID}-${env://ENVIRONMENT}-bizon-buffer

A whole value with any other scheme, such as https://... or postgresql://..., is left untouched. Inside ${...}, only gsm and env are accepted.

A whole value starting with BIZON_ENV_ is replaced by the environment variable of that name:

token: BIZON_ENV_HUBSPOT_TOKEN

It works only for whole values in mappings, not inline and not inside lists. env:// covers both cases.

The optional top-level secrets: block sets provider defaults. It accepts only gsm.project_id; any other key fails validation.

secrets:
gsm:
project_id: my-secrets-project

When secrets.gsm.project_id is not set, gsm:// references use the project of the Application Default Credentials, which also reads GOOGLE_CLOUD_PROJECT. If no project can be found, short references fail and name the three ways to set one.

Google Secret Manager is accessed with Application Default Credentials: workload identity on GKE or Cloud Run, GOOGLE_APPLICATION_CREDENTIALS, or gcloud auth application-default login locally. The identity needs secretmanager.versions.access on each secret, for example through the Secret Manager Secret Accessor role.

Install the client with the secretmanager extra:

Terminal window
pip install 'bizon[secretmanager]'

The client is only loaded when a gsm:// reference appears, so configs that use only env:// don’t need the extra. Without it, a gsm:// reference fails with a message naming the extra.

  1. Values starting with BIZON_ENV_ are replaced from the environment.
  2. gsm:// and env:// references, whole-value and inline, are resolved. Each distinct reference is fetched once per run.
  3. The resolved config is validated.

Because resolution comes before validation, a typed field (a port, a boolean) can hold a reference and still be checked against the resolved value. Resolution runs for bizon run, bizon config validate and bizon stream reset.

bizon secrets check dry-runs every reference in a config and prints its path with a masked result. It exits non-zero if any reference fails.

Terminal window
bizon secrets check config.yml --env-file .env
source.authentication.params.token gsm://hubspot-api-token ✓ (44 chars)
engine.backend.config.password env://PG_PASSWORD ✓ (24 chars)
All 2 reference(s) resolved.

To validate a config in CI without access to the secrets, use bizon config validate --skip-references. References are left unresolved and the fields that hold one are not type-checked.