Closed artempartos closed 9 years ago
Nice! Thank you!
I'm trying to use IAM roles but passing just region and bucket is giving me the following error:
DEPRECATION WARNING: called deprecated method `access_key_id' of an Aws::CredentialProvider, use #credentials instead
(I'm sourcing the gem from github to get this PR).
I've seen the discussion in #18 but my configuration appears to be correct:
# config/initializers/refile.rb
require 'refile/s3'
if Rails.env.production?
aws = {
region: ENV['AWS_REGION'],
bucket: ENV['ATTACHMENT_BUCKET']
}
Refile.cache = Refile::S3.new(prefix: 'cache', max_size: 10.megabytes, **aws)
Refile.store = Refile::S3.new(prefix: 'store', **aws)
end
# config/initializers/aws.rb
if Rails.env.production?
Aws.config.update({
region: ENV['AWS_REGION'],
credentials: Aws::InstanceProfileCredentials.new()
})
end
Edited: copied the wrong error.
close #1