a year ago
Hello,
I’d like to run multiple instances of my service, and each instance needs different environment variables (for example, unique API keys). Is there a simple way to give each instance its own set of environment variables?
Thanks in advance!
3 Replies
a year ago
Hello,
We don't provide a way to give specific instances specific variables at this time.
Best,
Brody
Status changed to Awaiting User Response Railway • over 1 year ago
a year ago
If specific variables per instance is not supported, how can we assign unique, persistent numeric IDs (0-1023) to instances in an autoscaling group that:
- remain consistent across container restarts
- are exposed as environment variables (e.g., INSTANCE_ID)
- Change only when a new instance is provisioned
Our distributed ID generator requires this for collision-free operation. Do you have a built-in solution ?
Status changed to Awaiting Railway Response Railway • about 1 year ago
a year ago
we expose RAILWAY_REPLICA_ID👍
https://docs.railway.com/reference/variables#railway-provided-variables
Status changed to Awaiting User Response Railway • about 1 year ago
9 months ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 10 months ago
