amazon web services - Listing a bucket’s content -
listobjectsrequest request = new listobjectsrequest(); listobjectsresponse response = client.listobjects(request); foreach (s3object o in response.s3objects) { console.writeline(o.bucketname); } from above code i'm getting access denied status code(403 forbidden) want show buckets irrespective of access rights. how can handled ?
example: in amazon there 10 buckets, out of 2 buckets not accessible credentials. how at-least 8 buckets accessible?
your iam user/policy/role need atleast "list" permissions on s3 along permissions on individual bucket.
if not have "list" permissions; u need directly access bucket.
Comments
Post a Comment