Some Guy
Some Guy

Reputation: 13568

With Rails Aws Gem version 2, how do you configure it to use your access keys?

According to this blog post, the new version of the Aws gem switches the namespace from AWS to Aws. But what am I supposed to use instead of

Aws.config({
  access_key_id: "something",
  secret_access_key: "something"
})

It's explained here but doesn't say what the alternative is: http://ruby.awsblog.com/post/TxFKSK2QJE6RPZ/Upcoming-Stable-Release-of-AWS-SDK-for-Ruby-Version-2

Instead, I get an error:

Uncaught exception: wrong number of arguments (1 for 0)

Upvotes: 1

Views: 760

Answers (2)

Trevor Rowe
Trevor Rowe

Reputation: 6528

AWS.config is no longer a method in v2. You now call Aws.config.update with a simple hash:

# v1
AWS.config({
  access_key_id: "something",
  secret_access_key: "something"
})

# v2
Aws.config.update({
  access_key_id: "something",
  secret_access_key: "something"
})

Here you have the link to the configuration options for more info related to #v2.

Upvotes: 4

prettycoder
prettycoder

Reputation: 228

Looking at this section in the doc: http://docs.aws.amazon.com/sdkforruby/api/index.html#Configuration it seems that the way you configure the credentials has changed.

I can't find the .config method in the docs anymore, it is now an attribute of Aws.

Upvotes: 0

Related Questions