Does AWS S3
provide a way to make bucket's files available over HTTP
preferably protected with BASIC_AUTH
? I mean listing the files (index) and make it possible to download them over HTTP
.
3 Answers
Download - yes. Simply set each Object ACL to be publicly readable.
List - sort of. If you set the Bucket ACL to publicly readable anyone can list the content. However it's a rather human-unfriendly XML listing.
You can generate your directory listings to some
index.html
files through an external process and configure the bucket to serve those.Basic auth - nope. You can look at something like S3 pre-signed URLs to protect the content.
Hope that helps :)
One possibility is mounting the bucket as s3fs
and serving the root folder as usually done by Nginx.
In addition to Mlu answer, you can put Cloud front in front of the bucket and implement basic auth and probably listing/sorting with a Lambda@edge function.