Even if you have only one Managed Postgres cluster, as soon as you have more than one App on Fly, you might find yourself thinking, “Which app is using this cluster?” Until now, there hasn’t been a good way to find that out. You might go to your App and look at the DATABASE_URL secret to see the connection string. But, that’s a secret of course so you won’t be able to see it.
If you need to destroy MPG clusters or Apps, having more information about what exactly is using those resources might help you avoid the mistake of deleting a database cluster that your App depends on. What? You’ve never deleted your entire production database? I don’t recommend it.
To help with this issue, you can now create an explicit attachment between an MPG cluster and the apps that use it.
If you are using the Dashboard to Launch an App and choose an MPG cluster as part of that launch, we’ll handle this attachment for you.
For existing MPG clusters and Apps, you can create this attachment in the Dashboard. When you look at “Connect” in the Managed Postgres section, you’ll see the familiar UI to connect your app to your database cluster. If you click “Set secrets and deploy”, we’ll create the secret as we’ve always done and, behind the scenes, we’ll also create an attachment record. If this is an existing cluster and app, you may not want to change any secrets, you can click “Track connection” and we’ll create the attachment without modifying any secrets.
Once I connect that App, I can then see that it’s connected in the App Overview dashboard. Or in the MPG dashboard. Of course, you can detach them too.
For now, this is a loose attachment more for record-keeping and sanity. Over time, we plan to make this attachment a more obvious and binding part of how MPG clusters and Apps (and perhaps other resources) work together. Do you have ideas of how an attachment like this could help you manage your Fly resources?
As a bonus, we also added a small highlight to the Dashboard navigation to let you know when you have an MPG cluster set up. It looks like this:



