10 months 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
10 months ago
Hey there! We've found the following might help you get unblocked faster:
- 🧵 Set a subset of service variables during templateDeployV2 via GraphQL API?
- 🧵 Referencing Service Variables in Shared Variables
- 🧵 Sync shared variables
If you find the answer from one of these, please let us know by solving the thread!
10 months 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 • 10 months ago
10 months ago
Hi Brody,
I am just curious. Is Railway planning to support this? 😊
Status changed to Awaiting Railway Response Railway • 10 months ago
Status changed to Awaiting User Response Railway • 10 months ago
brody
We do not have any current plans to.
10 months ago
Got it! Thanks for sharing!
Status changed to Awaiting Railway Response Railway • 10 months ago
Status changed to Solved 4man-dev • 10 months ago