Is there a Fly CLI command to suspend all apps within an org?

Hi! Quick question, I see in the docs that there is a command to suspend a specific application using fly suspend [appname], I was wondering if it is possible to be able to run something like fly suspend -o [orgname] -all to suspend all apps within an org?

I have a staging org with several apps I don’t need running all the time, so it would be great to spin them all down and then back up using the CLI easily! Thanks

It’s not baked in, but you can do this with bash pretty easily. :

fly apps list | \
egrep "\s+<org>\s+running" | \
awk '{print $1}' | \
xargs -I {} fly scale count 0 -a {}

Just replace <org> with the organization slug.

It’s better to scale to 0 than suspend. Suspend and resume are bad features we need to remove. :smiley:

Excellent, that worked - thanks for the script, that would have taken me a minute to figure out myself :slight_smile: