![](https://bigmachine.io/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsiZGF0YSI6MTgzLCJwdXIiOiJibG9iX2lkIn19--4587835e713678d8c1f51579dfb46199b4aa6c8b/eyJfcmFpbHMiOnsiZGF0YSI6e30sInB1ciI6InZhcmlhdGlvbiJ9fQ==--743878b0228ee81b4587d6ab790a4e67ea599217/deploy-s3.jpg)
Setting Up S3 CDN
Buy or Subscribe
You can access this course in just a minute, and support my efforts to rid the world of crappy online courses!
Setting up S3 is a matter of uncommenting some settings in your config/storage.yml file:
amazon: service: S3 access_key_id: <%=ENV.fetch("AWS_ACCESS_KEY_ID")%> secret_access_key: <%= ENV.fetch("AWS_SECRET_ACCESS_KEY") %> region: us-west-1 bucket: bigrails public: true
You then need to set config/environments/production.rb to use the amazon provider:
config.active_storage.service = :amazon