[Heroku] Associate AWS S3 with the deployed Rails app

Reference URL

https://qiita.com/params_bird/items/dc2a3868f4a2caf0504c

Basically, I referred to the article at the above URL.

Changed part

In the latter half of the above article, I could not enter the command in the terminal even if I did it according to the article, so I will describe the procedure I took only there.

$ heroku config --app The name of the app you are deploying

https://reasonable-code.com/heroku-config/ (The above command is from this article)

$ heroku config:set S3_ACCESS_KEY="Enter the access key you wrote down earlier here" --app The name of the app you are deploying
$ heroku config:set S3_SECRET_KEY="Similarly, enter the secret key" --app The name of the app you are deploying
$ heroku config:set S3_BUCKET="Enter the name of the bucket" --app The name of the app you are deploying
$ heroku config:set S3_REGION="Enter the name of the region" --app The name of the app you are deploying

The part that is different from the URL introduced at the beginning is [--app name of the deployed app]. By adding this, I was able to execute the command safely, and I was able to save the image from the application deployed on Heroku.

Recommended Posts

[Heroku] Associate AWS S3 with the deployed Rails app
[AWS] Publish rails app with nginx + puma
Publish the app made with ruby on rails
[Rails 6] RuntimeError with $ rails s
Heroku app moving (rails)
When the server does not start with rails s
Now that you have deployed AWS with Rails On Docker, let's organize the contents.
Created the first LINEbot on AWS Cloud9 (Rails + Heroku deployment)
The story of the first Rails app refactored with a self-made helper
Track Rails app errors with Sentry
Deploy your Rails app on Heroku
About the problem that the server can not be started with rails s
Learn RSpec with Everyday Rails. Until you bundle install the sample app.
[Rails] How to apply the CSS used in the main app with Administrate
Change the save destination of the image to S3 in the Rails app. Part 2
Deployed using Docker + Rails + AWS (EC2 + RDS)
[Rails6] Create a new app with Rails [Beginner]
Easy deployment with Capistrano + AWS (EC2) + Rails
Deploy heroku with Rails6 (Cloud9 + Ubuntu) + MySQL
Change the default timezone for the rails app
Deploy to heroku with Docker (Rails 6, MySQL)
Upload Rails app image file to S3
Prepare the format environment with "Rails" (VScode)
Error when building infrastructure with aws app
Check the processing contents with [rails] binding.pry
[Rails 5] Create a new app with Rails [Beginner]
The story of making an electronic New Year's card app with Vue.js + Rails
I rewrote the Rails tutorial test with RSpec
Downgrade an existing app created with rails 5.2.4 to 5.1.6
How to save images on Heroku to S3 on AWS
Ssh login to the app server on heroku
[Swift] How to link the app with Firebase
rails new app is not created with app name
Deploy Rails to ECS Fargate with AWS Copilot
Create an app by specifying the Rails version
Implement the Like feature in Ajax with Rails.
Error deploying rails5 + Mysql to heroku with Docker-compose
Determine the current page with Ruby on Rails
I made a LINE bot with Rails + heroku
Unify the Rails app time zone to Japan time
Try to summarize the common layout with rails
Deploy Line bot with rails5 + Docker + Heroku Note