Moving along, here's how to move your Active Storage files over to Amazon S3:

1. Sign in to your AWS account and go to your S3 management console (the URL will be something like depending on your region).

2. Create a new bucket (for this tutorial, I'll use gstroop-production). Grant public read access to the bucket.

3. Retrieve the Access Key ID and Secret Access Key for your AWS account. Better yet, create a new pair just for this application.

4. Update your storage_services.yml file with a configuration stanza for Amazon:

  service: S3
  access_key_id: AKIA************
  secret_access_key: *********************************************
  region: us-west-2
  bucket: gstroop-production

NOTE: Obviously, you need to keep those keys confidential. Don't check them into a public repository, for example. You can use the Rails secrets file to store them, or whatever other mechanism you prefer for production secrets.

5. Add a line to your production.rb file:

config.active_storage.service = :amazon

6. Add the aws-sdk gem to your Gemfile and run bundle install.

7. Deploy the application. You should now be able to add user avatars and have then stored in the S3 bucket that you configured.