-1

When we set a file in s3 bucket as public, we can directly download it from its URL. But, if I set a bucket or a sub folder in bucket to public, I am getting below error.

<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>FD92231A86E4F761</RequestId>
<HostId>KcoKQ1mibo+NO9o46u9qDTp6ezTmUHuzR4bdWo6gZTJct5aBUxejjJ9Aqy72bCafEBBffcVeONI=</HostId>
</Error>

Any suggestions on how to access a complete bucket using public url?

uday
  • 352
  • 10
  • 30

1 Answers1

2

So you can download files made public but not browse S3 folders? S3 doesn't have folders, it has objects with keys that can be viewed as / thought of as folders. In short, you can't browse to what looks like an S3 folder because it doesn't actually exist.

What exactly are you trying to achieve? Make S3 work like a web interface to a standard file share? Knowing what you're trying to achieve we might be able to make suggestions.

Tim
  • 31,888
  • 7
  • 52
  • 78
  • I have some cloudwatch logs and other resources which I want to share to users.These files are generally 1000s in number in a folder.So I want to share the folder to users so that they can access whichever they want. – uday Feb 18 '21 at 19:11
  • My approach would probably be to give them IAM users and permissions to use commands such as "aws s3 ls" – Tim Feb 18 '21 at 19:25
  • In the S3 Web UI objects are presented as if they're in folders like you'd see in a filesystem but actually the whole "/this/looks/like/a/directory/structure" path is actually part of the object's name (called prefix). The prefix can be used as a condition for defining policies to access one particular set of objects but not the others. – Oscar De León Feb 23 '21 at 21:42