Missing 'Scale to Zero After One Hour' option in Non-Interactive Postgres Cluster Creation

Open
#4,172 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
go, postgres
Domain
cli, databases

Research direction

Start at the fly postgres create command and compare the interactive Development flow with non-interactive option handling. Trace where FLY_SCALE_TO_ZERO="1h" is assigned, then verify that the equivalent non-interactive command sets it while preserving the reported cluster options.

Written by the indexing model from the issue text.

Description

bug

When creating a postgres cluster interactively with fly postgres create and select "Development" and "Scale single node pg to zero after one hour?" to "Yes" it will create a cluster which auto suspends all the machines in the postgres cluster.
But its not possible to create a cluster with the same behaviour non-interactively. For instance with this command fly postgres create --org my-org --region fra --autostart --name a-random-postgres-cluster-app-name --vm-size shared-cpu-1x --volume-size 1 --initial-cluster-size 1 --password $(pwgen -1 -cnsB 40) it will create the postgres cluster with the same size etc. without asking any question, but it is not possible to set the cluster to "scale to zero after one hour".
I compared the env vars, and the interactively created postgres cluster/machine has a FLY_SCALE_TO_ZERO env var set (FLY_SCALE_TO_ZERO="1h"), but the non-interactively created one is missing the env var.

  • macOS 15.1.1 (24B91)
  • fly version: fly v0.3.64 darwin/arm64 Commit: 962ba636e5d1279fc4da6e1e8eca876eb98ae9c3 BuildDate: 2025-01-15T18:32:05Z
Dominant language
Go
Stars
1.7k
Forks
311
Avg merge
12h 50m
Merged PRs (30d)
78

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from superfly/flyctl

All issues in superfly/flyctl

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.