Mike Gmez
Mike Gmez

Reputation: 151

How to access aws s3 current bucketlist content info

I have been provided with the access and secret key for an Amazon S3 container. No more details were provided other than to drop some files into some specific folder.

I downloaded Amazon CLI and also the Amazon SDK. So far, seems to be no way for me to check the bucket name or list the folders where I'm supposed to drop my files. Every single command seems to require the knowledge of a bucket name.

Trying to list with aws s3 ls gives me the error:

An error occurred (AccessDenied) when calling the ListBuckets operation: Access Denied

Is there a way to list the content of my current location (I'm guessing the credentials I was given are linked directly to a bucket?). I'd like to see at least the folders where I'm supposed to drop my files, but the SDK client for the console app I'm building seems to always require a bucket name.

Was I provided incomplete info or limited rights?

Upvotes: 1

Views: 232

Answers (2)

Mike Gmez
Mike Gmez

Reputation: 151

Looks like it was just not possible without enhanced rights or with the actual bucketname. I was able to procure both later on from the client and able to complete the task. Thanks for the comments.

Upvotes: 0

Felix
Felix

Reputation: 10078

Do you know the bucket name or not? If you don't and you don't have permission to ListAllMyBuckets and GetBucketLocation on * and ListBucket on the bucket in question, then you can't get the bucket name. That's how it is supposed to work. If you know the bucket, then you can run aws s3 s3://bucket-name/ to get objects in the bucket.

Note, that S3 buckets don't have the concept of "folder". It's User interface "sugar" to make it look like folders and files. Internally, it's just the key and the object

Upvotes: 1

Related Questions