Variables¶
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 accesses environment variables during configuration. Store secrets outside configuration files and change settings based on who's running Vulcan.
Using .env Files¶
Vulcan automatically 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=snowflake
Security
Add .env to your .gitignore file to avoid committing sensitive information.
Custom .env File Location¶
Specify a custom path using the --dotenv CLI flag:
Or set the VULCAN_DOTENV_PATH environment variable:
Note
The --dotenv flag must be placed before the subcommand (e.g., plan, run).
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 if they follow the VULCAN__ naming convention.
Override Naming Structure¶
Use double underscores __ to navigate the configuration hierarchy:
Example: Override a gateway connection password:
# Override with environment variable
export VULCAN__GATEWAYS__MY_GATEWAY__CONNECTION__PASSWORD="real_pw"
Dynamic Configuration¶
User-based Target Environment¶
Use the {{ user() }} function to dynamically set configuration based on the current user:
This allows running vulcan plan instead of vulcan plan dev_username.