a month ago
There was an exact same question but no public follow-up: Referencing Service Variables in Shared Variables - Railway Help Station
I ran into the same problem. To elaborate, say:
I have a Redis service deployed, and I will have multiple services using it. It is very intuitive to make the Redis.REDIS_URL a shared variable, so that I don't have to manually set this for all services using the Redis.
But now, say:
We set in shared variable so that:shared.REDIS_URL = ${{Redis.REDIS_URL}}
We have a service Backend. And we add the env var to it:REDIS_URL = ${{shared.REDIS_URL}}
The actual REDIS_URL in Backend will be empty.
I guess the work to enable this feature is non-trivial, due to possible circular referencing. But it is not impossible to tackle, and I believe it can be quite a cool feature that saves time.
5 Replies
a month ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
a month ago
Hello,
Until we support this you would want to use service to service reference variables.
Best,
Brody
Status changed to Awaiting User Response Railway • about 1 month ago
a month ago
Hi Brody,
I am just curious. Is Railway planning to support this? 
Status changed to Awaiting Railway Response Railway • about 1 month ago
Status changed to Awaiting User Response Railway • about 1 month ago
brody
We do not have any current plans to.
a month ago
Got it! Thanks for sharing!
Status changed to Awaiting Railway Response Railway • about 1 month ago
Status changed to Solved 4man-dev • about 1 month ago