dimanche 26 juillet 2015

How to setup AWS credentials in rails for development?

I'm trying to figure out what is the best way to set up my credentials in development? I'm able to set up credentials in production because of heroku's configuration variables... but need help doing so if you're just testing app locally.

I have this in my development.rb

config.paperclip_defaults = {
  :storage => :s3,
  :s3_credentials => {
    :bucket => ENV['BUCKET_NAME'],
    :access_key_id => ENV['ACCESS_KEY_ID'],
    :secret_access_key => ENV['SECRET_ACCESS_KEY']
  }
}  

But, I'm not sure how to reference these ENV variables?

I created this aws.yml file in my /config folder

development:
  BUCKET_NAME: "somename"
  ACCESS_KEY_ID: "4205823951412980"
  SECRET_ACCESS_KEY: "123141ABNCEFEHUDSL2309489850"

I thought if I matched the ENV name, it'll work? I guess thats not the case...

I made sure to include aws.yml to my .ignore file

/config/aws.yml




Aucun commentaire:

Enregistrer un commentaire