Consume
Consume Secret in other DataOS Resources.
Users can consume a Secret in DataOS by referencing it to the Resource that requires access to data sources. The most common patterns are through a Depot, directly in Nilus, and in Vulcan repository sync configuration.
Consume Secret in Depot
Depot uses spec.secrets to attach one or more Secret Resources.
name: snowflakedepot
version: v2alpha
type: depot
layer: user
spec:
type: snowflake
spec:
warehouse: COMPUTE_WH
url: abc12345.snowflakecomputing.com
database: ANALYTICS
account: abc12345
schema: PUBLIC
secrets:
- id: engineering:snowflake-secret-r
purpose: scan
- id: engineering:snowflake-secret-rw
purpose: rwConsume Secret in Nilus
Nilus supports three Secret resolution patterns. Choose the pattern based on how the source, sink, or repo is defined.
How Nilus resolves Secrets?
Use explicit projection for connectors configured directly in the URI.
Use automatic inference for
dataos://source and sink addresses.Use repo Secret inference for
stackSpec.repo.secretId.
Use this rule:
dataos://means depot credentials are inferred.{ENV_VAR}means you must project the value explicitly.repo.secretIdmeans git-sync credentials are inferred.
Pattern 1: Explicit projection for non-depot connectors
Use this when the connector is configured directly in the address. This applies when the address contains placeholders such as {USERNAME}, {PASSWORD}, {TOKEN}, or {CREDENTIALS_B64}.
Explicit projection relies on the DataOS Projections templating system to inject Secret values into the workload at runtime. See Projections for the full template syntax, data sources, and available variables.
Common cases:
API-style connectors
SaaS connectors with token auth
connectors that expect username and password in the URI
connectors that expect an encoded credential payload
How it works?
Select the Secret in
use.projection.secrets.Give it a
contextAlias.Map required fields to env vars in
use.projection.projections.envVars.Reference those env vars in the connector address.
Example: Username and password projection
Example: Encoded credential projection
Notes
Project only the fields the connector needs.
Use clear env var names such as
API_TOKENorCREDENTIALS_B64.Nilus resolves the placeholders at runtime.
Pattern 2: Automatic Depot Secret inference
If source.address or sink.address starts with dataos://, Nilus treats it as a Depot reference. The Stack projects the matching Depot spec and Secret automatically.
In this pattern, you do not assemble the source or sink credentials manually.
Example
How purpose works?
Set purpose explicitly when the Depot supports multiple access modes. This lets Nilus select the correct purpose-specific Secret.
Examples:
dataos://source_depot?purpose=readdataos://sink_depot?purpose=rw
What happens at runtime
Nilus reads the projected Depot files from the runtime and builds the final connector configuration. This is why dataos:// behaves differently from direct URIs that use {ENV_VAR} placeholders.
Pattern 3: Repo Secret inference
Nilus also supports one stack-managed repo, Secret path through stackSpec.repo.secretId. This is used for Git-sync authentication with repo-backed custom sources or destinations.
Example
In this pattern, the stack wires GITSYNC_USERNAME and GITSYNC_PASSWORD automatically for git-sync.
Best practices
Use
dataos://when the source or sink is backed by a Depot.Use explicit projection when the connector URI contains credential placeholders.
Use
repo.secretIdonly for repo sync authentication.
Common mistakes
Expecting direct connector credentials to be inferred automatically.
Not to project env vars for non-
dataos://connectors.Not adding
purposeondataos://addresses when multiple purposes exist.Adding direct connector credentials with
dataos://when it is not supported.
Consume Secret in Vulcan
Pattern 1: Vulcan data access via Depot
Vulcan accesses source systems via Depot, so the Secret is consumed through the Depot reference.
Pattern 2: Vulcan repository authentication
Vulcan uses a Secret for Git repository sync when the repository is private. Set it as deployment.repo.secret_id in config.yaml, using the <tenant>:<name> format:
Notes
Ensure the Secret exists before applying Depot/Nilus/Vulcan manifests.
Prefer Depot-based secret handling wherever supported.
Last updated
Was this helpful?