Hello,
I am able to upload an image to S3 in a rails app when in development.
However when I deployed my app to Render I get the follower error message: Aws::Sigv4::Errors::MissingCredentialsError (missing credentials, provide credentials with one of the following options::access_key_id and :secret_access_key :credentials :credentials_provider).
I am manually deploying my app and I do not use render.yml.
I have set the environment variables ACCESS_KEY_ID, SECRET_ACCESS_KEY, and SECRET_BASE_KEY via the Render Dashboard.
Below is my storage.yml file
test:
service: Disk
root: <%= Rails.root.join(“tmp/storage”) %>
I used S3 as store to test out my settings and I can upload to S3 from my development environment
local:
service: S3
access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
region: us-east-2
bucket: dennis-testing-rails
Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
amazon:
service: S3
access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
region: us-east-2
bucket: dennis-testing-rails
I added this section on the off chance that Render was looking for something under the heading or ‘production’
production:
service: S3
access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
region: us-east-2
bucket: dennis-testing-rails
Any guidance will be appreciated.
Dennis