IaC missing pieces to be production ready for my company
jingan-chen-generis
OP

a day ago

1. Project identifier/name doesn't anchor the project for railway CLI.

I ran "railway config pull" today for one of my project and this is the last few lines of the IaC ts file:

return project("product-generis", {
  resources: [A, B, C, D, E],
}); 

since "product-generic" is the project's name in my Railway, I thought when I run "railway config plan" on this file, it should automatically targeting this project. Turn out that it's not true, it's still targeting the project I'm currently "railway link" with.

This is the first confusing part I have. If "railway config plan" (I guess for "apply" too) is not respecting the project's identifier/name in the config file, why do you include it in your config file then?

My organization is doing a typical one-repo-multi-projects structure since our clients need data segregation, so I actually prefer the project's identifier being anchored in the config file. Just that it's not what it is doing at the moment.

2. Some config options missing from "railway config pull".

I ran "railway config pull" today to init a latest IaC from my existing project and noticed that some configuration options are gone. For example:

"Scale - Replica Limits - CPU/Memory" from UI.

"Deploy - start command" from UI.

And those options definitely exist before. I'm not sure whether I missed anything from your change log, but it seems like "railway config pull" is not doing 100% mapping at the moment.

Also, things like Postgres PITR setting is not in the config file either.

3. Env var reference from other services.

So my project contains typical API and WEB services, each one of them needs to use an env var that refer to the other service's configuration, to be more specific:

API has a env var "WEB_URL" = "https://${{WEB.RAILWAY_PUBLIC_DOMAIN}}"

WEB has a env var "VITE_API_URL" = "https://${{API.RAILWAY_PUBLIC_DOMAIN}}"

This is easily doable in UI with no obstacles. However in IaC file there're 2 problems:

  • In Typescript you can not use a variable before definition, so if you define API first you can not refer to WEB's env property which gets defined later;
  • In IaC file you can not use a template string to do "calculation" of strings while referring to other service's property, you can only do direct reference.

Those 2 issues are not the end of the world for us, but it'll be great if IaC file can do what we can already do on UI.


So above are the 3 missing pieces my company is experiencing from IaC, while dealing with one-repo-multi-projects deployments. I'm not sure whether there're solutions already or if I missed anything from doc - if so, my apologies. Thanks for your time, it'll be great to get help from Railway team on those, since the deadline for CoC is coming fast.

Under Review

0 Threads mention this feature

0 Replies

Welcome!

Sign in to your Railway account to join the conversation.

Loading...