Setting this globally seems sketchy to me. It will be harder to debug when it goes wrong (had to have been called somewhere before in the call stack) and harder to test. I'd use the version of the [S3 constructor](http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/S3.html) that takes the keys directly as arguments.