Environment Variables
Learn how to create environment variables in dbt.
An environment variable is a value that users can set outside of the code file and that can be accessed by the program. Environment variables are often created by users who want to share a program without sharing the secrets they use.
In dbt projects, environment variables can also be accessed. They are often used to set up connections in the profiles.yml
file.
Setting up an environment variable
dbt environment variables are just regular environment variables that you can access through dbt. They are prefixed with DBT_
. We can set an environment variable in the terminal, just like we would with any environment variables:
Get hands-on with 1400+ tech skills courses.