列出存储桶时,Ruby Amazon S3 Access被拒绝

时间:2012-06-21 22:51:49

标签: ruby-on-rails ruby amazon-s3 amazon-web-services buckets

Ruby newb在这里。

我获得了亚马逊云数据的访问权限。我开始认为访问键是关闭但我可能是错的。有人帮忙!

我将aws文件夹作为插件

>> Version
=> "0.6.3"

>> AWS::S3::Base.establish_connection!(:access_key_id =>'*******', :secret_access_key => '*****')
=> #<AWS::S3::Connection:0x007fd0539bb4c0 @options={:server=>"s3.amazonaws.com", :port=>80, :access_key_id=>"****", :secret_access_key=>"****"}, @access_key_id="****", @secret_access_key="****", @http=#<Net::HTTP s3.amazonaws.com:80 open=false>>

>> AWS::S3::Service.buckets   
=> AWS::S3::AccessDenied: Access Denied

from /Users/PBR/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/error.rb:38:in `raise'
from /Users/PBR/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/base.rb:72:in `request'
from /Users/PBR/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/base.rb:88:in `get'
from /Users/PBR/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/service.rb:21:in `buckets'
from /Users/PBR/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:183:in `block in buckets'
from /Users/PBR/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:152:in `expirable_memoize'
from /Users/PBR/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:182:in `buckets'

5 个答案:

答案 0 :(得分:19)

我必须去IAM - &gt;用户 - &gt; &#34;附加用户政策&#34;并让我的用户管理

答案 1 :(得分:8)

您可以通过以下方式解决此问题。

  1. 首先去亚马逊的s3控制台。
  2. 然后点击桶。
  3. 然后单击右侧的属性选项卡。
  4. 然后点击权限选项
  5. 点击添加更多权限
  6. 选中全部复选框并保存。

答案 2 :(得分:3)

IAM,您的用户所在的群组,并添加S3FullAccess或S3 ReadOnlyAccess

答案 3 :(得分:2)

原来我的访问密钥无效。我让管理员授予我进一步的权限,它终于有效了。

谢谢!

答案 4 :(得分:-2)

对此的正确答案肯定是: IAM - &gt;用户 - &gt; “附加用户政策”并让您的用户管理员 enter image description here