Variables
Configure Vulcan variables and environment overrides: .env files, the env_var() function, VULCAN__ configuration overrides, and dynamic values like the user() function.
Store sensitive information like passwords and API keys without hardcoding them in your configuration files. Use environment variables, .env files, or configuration overrides to change settings dynamically.
Environment variables
Vulcan reads environment variables during configuration. Store secrets outside configuration files and change settings based on who's running Vulcan.
Using .env files
Vulcan loads environment variables from a .env file in your project directory:
# .env file
SNOWFLAKE_PW=my_secret_password
S3_BUCKET=s3://my-data-bucket/warehouse
DATABASE_URL=postgresql://user:pass@localhost/db
# Override Vulcan configuration values
VULCAN__DEFAULT_GATEWAY=production
VULCAN__MODEL_DEFAULTS__DIALECT=snowflakeCustom .env file location
Specify a custom path using the --dotenv CLI flag:
Or set the VULCAN_DOTENV_PATH environment variable:
Accessing variables in configuration
Use {{ env_var('VARIABLE_NAME') }} syntax:
Use os.environ:
Configuration overrides
Environment variables have the highest precedence. They override configuration file values when they follow the VULCAN__ naming convention.
Override naming structure
Use double underscores __ to navigate the configuration hierarchy:
Example: Override a gateway connection password:
Dynamic configuration
Vulcan exposes runtime functions you can use inside config.yaml to vary settings without hardcoding them.
User-based target environment
Use the {{ user() }} function to set configuration based on the current user:
You can now run vulcan plan instead of vulcan plan dev_username.
Last updated
Was this helpful?