Skip to content
No way to make PR environments sleep after moving to IaC, and Config as Code ends 2027-01-01

6 minutes ago

With Config as Code, railway.json -> environments.pr.deploy.sleepApplication: true made every PR environment sleep, and it still works today. After I migrated a service to Infrastructure as Code (.railway/railway.ts), new PR environments never sleep:

  • Railway doesn't read .railway/ during deploys, so a ctx.isEnvironment("production") rule never reaches a new PR environment. The environment copies production's settings, where sleep is off.
  • The IaC service options have no sleep setting at all.
  • Config as Code stops being read on 2027-01-01, so after that there's no supported way to make PR environments sleep.

In practice, one preview ran 24/7 for over a week before I noticed.

Asks: a project-level "PR environments sleep when idle" setting, or an IaC option that applies when Railway creates a PR environment.

Related: PR environment teardown sometimes misses merged PRs. I found eight environments left over after their PRs merged, some from as far back as April.

Under Review

0 Threads mention this feature

0 Replies

Welcome!

Sign in to your Railway account to join the conversation.

Loading...