aws-sdk-s3 doesn't appear to support the rails 5.2+ way of managing AWS credentials #2871
Unanswered
TB-Development
asked this question in
Q&A
Replies: 1 comment
-
Have you looked at https://github.com/aws/aws-sdk-rails? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Task
I am migrating an application's hosting from an AWS EC2 instance to a DigitalOcean droplet running a docker container.
Issue
The gem appears to only look for
ENV
variables or credentials at~/.aws/credentials
. I'm wondering if this is true, can I use the Rails 5.2+ way of managing credentials with this gem?into something like:
into the file
credentials.yml.enc
Trying to use
credentials.yml.enc
to give credentials to the application throws errors. Even though it appears to be working, as accessing the credentials on the machine spits out a proper response with:Current Behaviour
When I attempt to run a function responsible for uploading an
AWS::S3::Resource
inside of a migration, I get this stack trace:My
storage.yml
looks like this:but still the gem errors and expects something different. What gives?
Solutions
I can fix this issue by adding the file
~/.aws/credentials
on my machine manually. Though this is not idea for security reasons.I can also fix this by specifying the ENV variables on the
docker run
command, giving it the ENV variables, like this:Though I want to use the standard
rails credentials:edit
solution.Build Environment
aws-sdk-s3 (1.126.0)
Rails 6.0.2
Ruby 2.6.0
Docker version 23.0.5
Beta Was this translation helpful? Give feedback.
All reactions