flexera-public / right_aws

RightScale Amazon Web Services Ruby Gems
MIT License
451 stars 175 forks source link

AccessDenied error listing buckets #88

Open kylefox opened 13 years ago

kylefox commented 13 years ago

I get an "AccessDenied" error when trying to list my buckets:

s3_interface = RightAws::S3Interface.new("access_key_id", "secret_key_id")
s3_interface.list_all_my_buckets # => RightAws::AwsError: AccessDenied

Same if I try to get a specific bucket:

 s3 = RightAws::S3.new(access_key, secret_key)
 s3.bucket('mybucket')

However, I am able to do other operations successfully:

s3_interface.get_bucket_acl('mybucket') # Success
s3_interface.get('mybucket', 'some/key.txt') # Success

The access/secret keys I'm using only have access to a few specific buckets (not all buckets in our AWS account). Could this be the cause of the problem?

konstantin-dzreev commented 13 years ago

Hi

Yes, this happens because s3.bucket('mybucket') uses s3_interface.list_all_my_buckets which requires full access to your account.