fly postgres CLI quirks / issues

I’m working on automating fly setup for an open source project, and so far almost everything works non-interactively. But I’m running into issues with the postgres part of things.

  • There seems to be no clear way to store, defer, or even provide the superuser password. For a long script with further commands, that means the text containing “these are your credentials, we won’t show them again” get lost in the history. I tried --json (combined with jq) to see if it would be presented after successful creation, but instead I get some logs while the cluster is being created. And no password. Either the ability to provide an initial password, or a way to retrieve it would be great.
  • There’s no way to generate a cluster name like there is with fly app launch --generate-name. This isn’t a blocker because I can just use the app name + “-cluster” and pass it in. But that does switch the order of operations from “db cluster” → “app”. To “app” → “db cluster” → “app”.
  • There’s no way to provide a concise sizing (basically, answering the “Select configuration” which is a shorthand for vm + volume. However, again, this can be manually provided by breaking up the flags. I do not know if these correspond to the answers though.
  • Volume provisioning sometime fails, I tried another region and it worked. I imagine this is just a capacity issue.

Currently, here’s the command I’m using that gets me close to non interactive (minus the superuser password being “lost”):

fly postgres create --name "$APP_NAME-cluster" --region ams --initial-cluster-size 1 --vm-size shared-cpu-1x --volume-size 10

Which I hope corresponds to Development - Single node, 1x shared CPU, 256MB RAM, 1GB disk in the recently announced free tier.

Let me know what more info I can provide! Fly 286 binaries.

Hey, you can use the --password flag to specify a password.

Indeed, generating a cluster name would be a useful addition.

You can see the correlation between the individual flags and the preconfigured list of cluster types here: flyctl/postgres.go at master · superfly/flyctl · GitHub. So, what you’re doing is correct.

1 Like

Shoot, I don’t know how I missed this. I blame the Ballmer peak. Thanks!

1 Like