Skip to content
railway.json
makkojoo
OP

2 years ago

I'm using the graphql api to deploy a new service but I haven't figured out a way to set the region for the service (and the edge). No matter what I've tried it sets the region to "US West, Oregon". Any tips?

Solved

11 Replies

makkojoo
OP

2 years ago

f8b1f109-885c-4293-8768-a02ba68194ee


2 years ago

Hey, I'm guessing you're talking about the GraphQL API instead of the railway.json config file, you'll need to call serviceInstanceUpdate with multiRegionConfig as variables:

mutation ($input: ServiceInstanceUpdateInput!) {
  serviceInstanceUpdate(
    input: $input
    serviceId: ""
  )
}

then as variables:

{
   "input": {
      "multiRegionConfig": {
         "us-east4-eqdc4a":null,
         "us-west2": {
            "numReplicas":1
         }
      }
   }
}

regions IDs can be obtainable by calling the following query:

query GetRegions {
  regions {
    name
  }
}

2 years ago

To set a default region across all services, you can use a simpler method by navigating to the dashboard, pressing CTRL + K, typing "update preferred region," and then selecting your desired default region.


2 years ago

From now on, all services will be created in that region, including those created by the API.


makkojoo
OP

2 years ago

thank you! Yes graphql.. not sure where discord picked up railway.json from


makkojoo
OP

2 years ago

and is there a way to get the new instances to use Metal edge by default as well?


2 years ago

afaik no


makkojoo
OP

2 years ago

I've now done both.. set the default region and updated the code to follow the multiRegionConfig.. it's still creating everything in US West, Oregon. I'm stumped.


makkojoo
OP

2 years ago

ok, it looks like it sets the region correctly initially but changes it to the US West legacy when we attach a volume to it. Does that make any sense? I've set the default region to US East virginia metal a well


makkojoo
OP

2 years ago

ok in the end the culprit was that we sent another serviceInstanceUpdate in the script later to set other paramenters, which didn't have the region set and that caused it to reset it.


2 years ago

!s


Status changed to Solved brody • over 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...