[ActiveStorage] Use different services for different attachments in the same app


Rails 5.2
Is it possible or is there a plan to support multiple services on a single app?
Say I configure these S3 services:
service: S3

bucket: first-bucket
service: S3

bucket: second-bucket
How would I access both buckets in the app?
Currently I can only see how to use one bucket per app.
I guess you could extend this question with, can I use an azure service and a google service in the same app?

Thanks for your time,



Did you get anywhere with this?

According to what I have been reading, it is currently not possible to handle multiple services per environment in a single app.

This should be a feature request.



Hi Lucas!

I have a PR for that - https://github.com/rails/rails/pull/34935, but it hasn’t been reviewed yet :frowning:


Let me know if you need anything.