{"action":"created","issue":{"url":"https://api.github.com/repos/phstc/shoryuken/issues/128","labels_url":"https://api.github.com/repos/phstc/shoryuken/issues/128/labels{/name}","comments_url":"https://api.github.com/repos/phstc/shoryuken/issues/128/comments","events_url":"https://api.github.com/repos/phstc/shoryuken/issues/128/events","html_url":"https://github.com/phstc/shoryuken/issues/128","id":104772914,"number":128,"title":"Publisher not using shoryuken.yml","user":{"login":"nritholtz","id":5275179,"avatar_url":"https://avatars.githubusercontent.com/u/5275179?v=3","gravatar_id":"","url":"https://api.github.com/users/nritholtz","html_url":"https://github.com/nritholtz","followers_url":"https://api.github.com/users/nritholtz/followers","following_url":"https://api.github.com/users/nritholtz/following{/other_user}","gists_url":"https://api.github.com/users/nritholtz/gists{/gist_id}","starred_url":"https://api.github.com/users/nritholtz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nritholtz/subscriptions","organizations_url":"https://api.github.com/users/nritholtz/orgs","repos_url":"https://api.github.com/users/nritholtz/repos","events_url":"https://api.github.com/users/nritholtz/events{/privacy}","received_events_url":"https://api.github.com/users/nritholtz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-03T20:16:20Z","updated_at":"2015-09-06T16:26:24Z","closed_at":null,"body":"I am using a Rails app in conjunction with this gem. I am loading the worker with `shoryuken -R -C config/shoryuken.yml` and everything works as I put in the config.\r\n\r\nHowever, when I am using this gem to publish a message to SQS within the app, it is not using the config, and is instead using the default [AWS SDK](http://docs.aws.amazon.com/sdkforruby/api/index.html) configuration setup (e.g. environment variables).\r\n\r\nWe would like to ensure that we are using the same config for both the worker and publisher. A \"hack-ish\" approach that we tested out was putting inside an initializer:\r\n```ruby\r\npath = \"#{Rails.root}/config/shoryuken.yml\"\r\nAws.config = YAML.load(ERB.new(IO.read(path)).result).deep_symbolize_keys[:aws].except(:receive_message)\r\n```\r\n\r\nIs there some way to include this in the gem itself, instead of implementing this brute hack to ensure consistency across the shoryuken components?"},"comment":{"url":"https://api.github.com/repos/phstc/shoryuken/issues/comments/138097737","html_url":"https://github.com/phstc/shoryuken/issues/128#issuecomment-138097737","issue_url":"https://api.github.com/repos/phstc/shoryuken/issues/128","id":138097737,"user":{"login":"phstc","id":105652,"avatar_url":"https://avatars.githubusercontent.com/u/105652?v=3","gravatar_id":"","url":"https://api.github.com/users/phstc","html_url":"https://github.com/phstc","followers_url":"https://api.github.com/users/phstc/followers","following_url":"https://api.github.com/users/phstc/following{/other_user}","gists_url":"https://api.github.com/users/phstc/gists{/gist_id}","starred_url":"https://api.github.com/users/phstc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phstc/subscriptions","organizations_url":"https://api.github.com/users/phstc/orgs","repos_url":"https://api.github.com/users/phstc/repos","events_url":"https://api.github.com/users/phstc/events{/privacy}","received_events_url":"https://api.github.com/users/phstc/received_events","type":"User","site_admin":false},"created_at":"2015-09-06T16:26:24Z","updated_at":"2015-09-06T16:26:24Z","body":"Hi @nritholtz \r\n\r\nCurrently the AWS initialization is coupled with other configurations in [initialize_aws](https://github.com/phstc/shoryuken/blob/master/lib/shoryuken/environment_loader.rb#L63-L65) method. But extracting it would be a great idea. PR?! :heart: :beers: \r\n\r\nWhat I would also suggest to you is to use ENV variables:\r\n\r\n```\r\nAWS_ACCESS_KEY_ID=...\r\nAWS_SECRET_ACCESS_KEY=...\r\nAWS_DEFAULT_REGION=us-east-1\r\nAWS_REGION=us-east-1\r\n````\r\n\r\nUsing ENV variables you can omit the `aws` config in the `shoryuken.yml`. In development you can use [dotenv](https://github.com/bkeepers/dotenv) to load these variables. wdyt?"}}