Hey all, what is the best practice for setting var...
# ask-community
s
Hey all, what is the best practice for setting variables on the job itself, for example, if I wanted to set the value for "environment" and have it retrievable from any op what would be the best way? Currently, I am just setting it on the ops that need it via config, however, for bigger jobs I could see this being tedious. Also don't want to set it via environment variable because I want it more as a configurable option than something you have to set outside of dagster itself.
c
Hey Scott, If you don't want to provide a config for every op individually, you could create a resource that contains the config variables you need: https://docs.dagster.io/concepts/configuration/config-schema#passing-configuration-to-multiple-ops-in-a-job
s
Huh, I was actually doing this before however didn't necessarily feel that was a proper use case for Resources (or thought there might be another way).
y
👋 We wrote some example code for this use case in this GitHub discussion. Please feel free to leave a comment/answer there as well.