Referencing Service Variables in Shared Variables
4man-dev
HOBBYOP

7 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.

Solved

5 Replies

Railway
BOT

7 months 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!


7 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 7 months ago


4man-dev
HOBBYOP

7 months ago

Hi Brody,

I am just curious. Is Railway planning to support this? 😊


Status changed to Awaiting Railway Response Railway 7 months ago


7 months ago

We do not have any current plans to.


Status changed to Awaiting User Response Railway 7 months ago


brody

We do not have any current plans to.

4man-dev
HOBBYOP

7 months ago

Got it! Thanks for sharing!


Status changed to Awaiting Railway Response Railway 7 months ago


Status changed to Solved 4man-dev 7 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...