I think cloudron provides exactly this. Have you tried it? Mastadon package is also under way.
wget https://cloudron.io/cloudron-setup chmod +x ./cloudron-setup ./cloudron-setup --provider [digitalocean,ec2,generic,ovh,...]
https://cloudron.io/get.html And that's it, after that it's only a web UI.
Does anybody know other examples of software which provides command line install personnalized to the provider you use?
I am currently working on an end-to-end test suite, as required by cloudron.io platform, to add it to their appstore,